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.