Forum Discussion

JeffT's avatar
8 years ago

Localize Category and Board Names

We are adding in language packs to our platform. Our navigation component automatically pulls the name of the categories and boards from our Community Structure in Admin, which is great for the English site, but I can't find what the best practice is for embedding a reference to a custom text field so that the navigation component can show the nav in the user's language. Note that using a <p>${text.format("custom.board-name")} context object won't work as a category or board name (I tried).

 

Anyone have a suggestion for how to make the category and board names localizable... other than creating a 100% custom-coded navigation component (the reason this is not preferred for us is that it would mean creating multiple versions of the component to present different variations of the nav based on the sections each role has access to)?

 

Jeff

4 Replies

  • JeffT

    You have to create a similar structure for every locale, on the base of that you have to create a custom navigation. See screenshot https://prnt.sc/h5jo1w  and can also apply those different variations of nav in a single component on the bases of language. 

    Here is a discussion might be helpful.

     

  • JeffT's avatar
    JeffT
    Ace
    8 years ago

    Thanks VikasB. The issue with those scenarios (if I'm reading them correctly) is that these would work with categories/boards that are language-specific. Our community is set up for real-time translation, so users who speak different languages can communicate with each other in the same board.

     

    The solution looks to be creating a custom nav with the embedded custom text references.

  • VikasB's avatar
    VikasB
    Boss
    8 years ago

    JeffT

    Option 1: Locale-Specific category structure: Real-time translation would not be required here. As you set the language-specific redirection in page init. i.e. users who are coming from the US will be redirected to English category, if coming from JA they will be redirected to Japan category. 
    Option 2: One structure for all the locale: You already using this one. In this case, you really need to use real-time translation. But I know you are facing the problem here with the board/category name translation. As you can not use text keys here.
    A workaround can be used here. You can show the self-created board/category name instead of Lithium's OOTB. You can create the text key on the bases of board/category id as id will be unique. i.e. a board having id "HealthTips" can be replaced by the key ${text.format(coreNode.id)}
    in text keys, you can set the value of HealthTips = 健康のヒント

  • JeffT Were you able to resolve the localization?  We too have real-time translation of content and I'm struggling to get the structure (libraries, categories, sub-categories) localized.  We're now about 90% localized except with the exception for that one key area.  Would love to hear how your resolved it.