Create and localize interface messages for designed pages - Fluid Topics - Latest

Manage Languages in Fluid Topics

Category
Technical Notes
Audience
public
Version
Latest

It is possible to create and localize custom interface messages exclusively for designed pages. Users can then display these labels through the use of the Localized label component.

To do so, users with the ADMIN or PORTAL_ADMIN role must modify the custom-$LanguageCode-messages.xml file.

To access this file:

  1. Go to the Languages tab of the Portal menu.
  2. Scroll to the language in question.
  3. Select Download under the Custom labels for designed pages section.
  4. Open the XML file.
  5. Add as many <context> sections as needed.

    The <context> tags help users organize their custom labels.

  6. Under a <context>, add as many <label> sections as needed, following the example provided below:

    For example:

    <context>
        <comment>This is an example context with localized labels</comment>
        <label>
            <id>Test.MyVeryOwnLabel</id>
            <comment>This is an example of localized label</comment>
            <translation>
                <custom>Lorem ipsum dolor sit amet.</custom>
            </translation>
        </label>
    </context>
    

    The new label must be between <custom> tags under <translation>.

    Under <id>, the example value Test is the context ID. The example value MyVeryOwnLabel is the label key.

    • All labels in the same context must begin with the same context ID (in this case, Test.)
    • Each interface message must have a unique id.
  7. Save the XML file.

  8. Select Upload to upload the modified XML file.
  9. Select the Save button.

Example

The following lines show how to add interface messages for designed pages.

<?xml version="1.0" encoding="UTF-8"?>
<contexts>
    <locale>en-US</locale>
    <context>
        <comment>
            Labels for the homepage
        </comment>
        <label>
            <id>homepage.mainTitle</id>
            <comment>Main title of the homepage</comment>
            <translation>
                <custom>Fluid Topics Documentation</custom>
            </translation>
        </label>
        <label>
            <id>homepage.latestContent</id>
            <comment>Latest content section title</comment>
            <translation>
                <custom>Latest Content</custom>
            </translation>
        </label>
        <label>
            <id>homepage.trendingDocs</id>
            <comment>Trending Documents section title</comment>
            <translation>
                <custom>Trending Documents</custom>
            </translation>
        </label>
    </context>
    <context>
        <comment>
            Labels for the first introduction to Fluid Topics
        </comment>
        <label>
            <id>FT101.mainTitle</id>
            <comment>Main title of the page</comment>
            <translation>
                <custom>Fluid Topics 101 - Getting Started with Fluid Topics</custom>
            </translation>
        </label>
        <label>
            <id>FT101.welcomeTitle</id>
            <comment>Welcome section title</comment>
            <translation>
                <custom>Welcome!</custom>
            </translation>
        </label>
        <label>
            <id>FT101.welcomeDescription</id>
            <comment>Quick description of the page's content</comment>
            <translation>
                <custom>Watch this video series about Fluid Topics.</custom>
            </translation>
        </label>
    </context>
</contexts>