Forum Discussion

Claudius's avatar
13 years ago

Localizable category and board names

We've create multiple language sub-"communities" by creating categories and boards below for the seperate language. The community (e.g. the root node in the community structure) title remained the English "Support Network" when accessing all the localized categories though.

 

I'd like to have that community title localizable as well. I've tried adding this as the title:

${text.format("skype.community.title")}

 ...but it seems freemarker is  not evaluated in that context. 

Couldn't find the string replicated in Studio's Text Editor either. 

 Any other way I could achieve that?

  • We recently did a similar customization, here's the code we used for the custom breadcrumb component:

     

    <div class="${page.content.nav.breadcrumb.css}">
    	<ul class="lia-list-standard-inline">
    	<#list page.content.nav.breadcrumb.crumbs as crumb>
    	<#if (crumb_index = 0) && (page.content.nav.breadcrumb.crumbs?size > 1)>
    		<li class="lia-breadcrumb-node crumb">		
    		<a class="lia-link-navigation crumb-community lia-breadcrumb-community lia-breadcrumb-forum" href="/">${text.format("custom.breadcrumb.title")} </a>
    		</li>
    		<li class="lia-breadcrumb-seperator crumb-community lia-breadcrumb-community lia-breadcrumb-forum">
    			<span class="separator">${page.content.nav.breadcrumb.seperator}</span>
    		</li>
    	<#elseif (page.content.nav.breadcrumb.crumbs?size > 1)>
    		<li class="${crumb.wrapperCss}">
    			<#if crumb.isLink>
    			<a href="${crumb.url}" class="${crumb.css}">${crumb.text}</a>
    			<#else>
    			<span>${crumb.text}</span>
    			</#if>
    		</li>
    		<#if crumb_has_next>
    		<li class="${crumb.separatorCss}">
    			<span class="separator">${page.content.nav.breadcrumb.seperator}</span>
    		</li>
    		</#if>
    	</#if>
    	</#list>
    	</ul>
    </div>

     You can then set the community title for each language by defining "custom.breadcrumb.title"

  • AdamN's avatar
    AdamN
    Khoros Oracle

    Hi Claudius,

     

    The breadcrumb titles for community nodes rely directly on what's configured in the admin (via "title" and "short title"), rather than on text keys. If you want to have different text in the breadcrumb for different languages, your best bet would likely be to create a custom breadcrumb.

     

    There's an example at the bottom of this page that should help get you started with creating a custom breadcrumb:

    http://lithosphere.lithium.com/t5/Developer-Knowledge-Base/Context-objects-for-custom-components-page/ta-p/9331

     

    If you're just interested in localizing the community title, you wouldn't even necessarily have to replace the entire breadcrumb. You could use some CSS to hide the standard community crumb, place your custom component in front of the standard crumb, and then style as needed to acheive the desired effect.

     

    The only other alternative that comes to mind would be swapping out the community title via some JavaScript. I'm not a huge fan of that approach, but jQuery should make it fairly easy.

     

    I hope this helps!

     

    -Adam

    • ChiaraS's avatar
      ChiaraS
      Lithium Alumni (Retired)

      We recently did a similar customization, here's the code we used for the custom breadcrumb component:

       

      <div class="${page.content.nav.breadcrumb.css}">
      	<ul class="lia-list-standard-inline">
      	<#list page.content.nav.breadcrumb.crumbs as crumb>
      	<#if (crumb_index = 0) && (page.content.nav.breadcrumb.crumbs?size > 1)>
      		<li class="lia-breadcrumb-node crumb">		
      		<a class="lia-link-navigation crumb-community lia-breadcrumb-community lia-breadcrumb-forum" href="/">${text.format("custom.breadcrumb.title")} </a>
      		</li>
      		<li class="lia-breadcrumb-seperator crumb-community lia-breadcrumb-community lia-breadcrumb-forum">
      			<span class="separator">${page.content.nav.breadcrumb.seperator}</span>
      		</li>
      	<#elseif (page.content.nav.breadcrumb.crumbs?size > 1)>
      		<li class="${crumb.wrapperCss}">
      			<#if crumb.isLink>
      			<a href="${crumb.url}" class="${crumb.css}">${crumb.text}</a>
      			<#else>
      			<span>${crumb.text}</span>
      			</#if>
      		</li>
      		<#if crumb_has_next>
      		<li class="${crumb.separatorCss}">
      			<span class="separator">${page.content.nav.breadcrumb.seperator}</span>
      		</li>
      		</#if>
      	</#if>
      	</#list>
      	</ul>
      </div>

       You can then set the community title for each language by defining "custom.breadcrumb.title"