I added a local to my project in the sites app and can display translated content properly when using the /locale/path. The problem I have is with a custom content app which displays in English (the default locale) and the navigation menu bar also appears in English although there is a translated navigation title for every page.
What could be the reason?
The code to retrieve the custom content app is:
<div class="row-fluid foo-content">
[#assign articles = cmsfn.contentByPath("/", "articles") ]
[#assign article = cmsfn.children(articles, "lib:article")?sort_by("publish_date")?first ]
<div class="span4 newsroom">
<h4>${i18n.get('footer.newsroom')}</h4>
<section class="foo-container clearfix">
<div class="news-date">
<span class="date">${article.publish_date?string.dd}</span>
<span class="month">${article.publish_date?string.MMMM}</span>
<span class="year">${article.publish_date?string.yyyy}</span>
</div>
<div class="content">
<p class="upper">${article.title}</p>
<div class="fsize-12">
${article.description?substring(0, 170)}...
</div>
<p>
<a class="link-readmore" href="${cmsfn.link(cmsfn.siteRoot(content))}client/articles/view-article~${article.@name}~.html">${i18n.get('footer.readMore')}</a>
</p>
</div>
</section>
[#assign rootNode = cmsfn.contentByPath("/alqasemi/articles")]
[#if rootNode??]
<a class="btn-blue" href="${cmsfn.link(rootNode)}">${i18n.get('footer.viewAlqaswmiNews')}</a>
[/#if]
</div>
The problem you are facing is due to the fact that you are creating links manually to your articles here:
Same way as you translate text of the link, you also need to provide locale to the
view-articlepage/template so it knows what to translate to. You can look for details in thelink.ftlof the demo project. Copied from there (should therefore work in 6.2.x), try to change the link to something like:where
getDynamicLink()function would look like:(Disclaimer: didn't check if the above code actually runs, there might be typos, but should give you the direction of the solution)