Work with Localization

This topic provides information about localizing presentation objects.

Modify or Delete Individual Localization Keys and Variables

Semantic Modeler automatically creates localization keys and name variables for all subject areas and presentation objects. You can modify or delete these keys and variables. You can also manually add description variables.

Localization keys are assigned when presentation objects are created. When externalized and used to translate strings, a localization key serves to map the object's name with its translated value. Be careful when modifying localization keys because it can break this mapping.
If you modify or manually add variables, then you must include VALUEOF(NQ_SESSION.CN) in name variables (for example, VALUEOF(NQ_SESSION.CN_A_-_Sample_Sales_Offices) and VALUEOF(NQ_SESSION.CD) in description variables (for example, VALUEOF(NQ_SESSION.CD_A_-_Sample_Sales_Offices).
When the localization keys and variables are finalized, you can externalize strings for the subject area. See Externalize Strings for a Subject Area.
  1. On the Home page, click Navigator and then click Semantic Models.
  2. In the Semantic Models page, click a semantic model to open it.
  3. Click Presentation Layer.
  4. In the Presentation Layer pane locate and double-click a subject area or the presentation table that you want to modify keys and variables for.
  5. In the subject area or presentation table page, click the Localization tab.
  6. Optional: To update a localization key, do one of the following:
    • For a subject area, click the Localization Key field and delete or modify its value.
    • For a presentation table, locate an object and double-click its table row. Click the object's Localization Key field and delete or modify its value.
  7. Optional: To update a description value, do one of the following:
    • For a subject area, click the Name Variable or Description Variable field and delete or modify its value.
    • For a presentation table, locate an object and double-click its table row. Click the object's Localization Key field or Description Variable and modify or delete its value.
  8. Click Save.

Clear All Name and Description Variables

You can clear name and description variables for a subject area only, for a subject area and all of its child objects, or for a presentation table and all of its objects.

  1. On the Home page, click Navigator and then click Semantic Models.
  2. In the Semantic Models page, click a semantic model to open it.
  3. Click Presentation Layer.
  4. In the Presentation Layer pane locate and double-click a subject area or the presentation table that you want to clear variables for.
  5. In the subject area or presentation table, click the Localization tab.
  6. To clear variables, do one of the following:
    • For a subject area, click Clear Variables and select which variables to clear, and then specify if you want to clear variables for the subject area object only or the subject area and all of its child objects.
    • For a presentation table, click Clear Variables and select which variables to clear.
  7. Click Clear.
  8. Click Save.

Generate Localization Keys and Name and Description Variables

You can generate localization keys and name and description variables for a subject area only, for a subject area and all of its child objects, or for a presentation table and all of its objects.

  1. On the Home page, click Navigator and then click Semantic Models.
  2. In the Semantic Models page, click a semantic model to open it.
  3. Click Presentation Layer.
  4. In the Presentation Layer pane locate and double-click a subject area or the presentation table that you want to generate localization keys and variables for.
  5. In the subject area or presentation table, click the Localization tab.
  6. To generate variables, do one of the following:
    • For a subject area, click Generate Variables and select which variables to generate, and then specify if you want to generate variables for the subject area object only or the subject area and all of its child objects.
    • For a presentation table, click Clear Variables and select which variables to generate.
  7. Click Generate.
  8. Click Save.

Externalize Strings for a Subject Area

You can externalize strings for a subject area, its presentation tables, hierarchies, columns, and their descriptions. Externalizing strings for the subject area outputs a CSV file.

After you externalized the strings for the subject area and its objects, you use the resulting files to translate the strings. See Translate Strings.
  1. On the Home page, click Navigator and then click Semantic Models.
  2. In the Semantic Models page, click a semantic model to open it.
  3. Click Presentation Layer.
  4. In the Presentation Layer pane locate and right-click the subject area you want to externalize strings for.
  5. Click Externalize Strings.
  6. In the Name field, enter a name for the outputted CSV file.
  7. Click Externalize.

Externalize Strings for All Subject Areas

You can externalize strings for all of the presentation layer's subject area, their presentation tables, hierarchies, columns, and their descriptions. Externalizing strings for all subject areas outputs a CSV file.

After you externalized the strings for the subject area and its objects, you use the resulting files to translate the strings. See Translate Strings.
  1. On the Home page, click Navigator and then click Semantic Models.
  2. In the Semantic Models page, click a semantic model to open it.
  3. Click Presentation Layer.
  4. In the header, click Page Menu and then click Externalize Strings.
  5. In the Name field, enter a name for the outputted CSV file.
  6. Click Externalize.

Translate Strings

After you externalized translation keys and strings, you can use the resulting files to translate the strings for the presentation objects.

Note the contents of the output file:
  • The first column contains the actual semantic model object names with a prefix indicating its object type.

  • The second column contains the session variables that correspond to the name of each object or description, with a default prefix of CN_ for custom names and CD_ for custom descriptions.

  • The third column contains the translation keys that correspond to the name of each object.

  1. Open each string file Add a fourth column called Language. In this column, specify the code for the language in which the name was translated, such as de.
  2. Load each string file into a database table.
  3. In the Semantic Modeler, import the table into the physical layer.
  4. Load the translated strings using row-wise initialization blocks. Ensure that you set the target of the initialization block to Row-wise initialization and that the execution precedence is set correctly. For example:
    1. Create a session initialization block that has the data source from a database, using a SQL statement such as the following one:
      SELECT 'VALUEOF(NQ_SESSION.WEBLANGUAGE)' FROM DUAL
      
    2. In the Session Variable Initialization Block dialog box for SET Language, specify the LOCALE session variable for the Variable Target. This specification ensures that whenever a user signs in, the WEBLANGUAGE session variable is set. Then this variable sets the LOCALE variable using the initialization block.
    3. Create another session initialization block that creates a set of session variables using a database-specific SQL statement such as the following one in the Session Variable Initialization Block Data Source dialog box:
      select SESSION_VARIABLE, TRANSLATION from external where LANGUAGE =
      'VALUEOF(NQ_SESSION.LOCALE)'
      
      This block creates all the variables whose language matches the language that the user specified during sign-in.
    4. In the Session Variable Initialization Block Variable Target dialog box, set the target of the initialization block to Row-wise initialization.
    5. In the Execution Precedence area of the Session Variable Initialization Block dialog box, specify the previously created initialization block, so that the first block that you created earlier is run first.
  5. Click Save.