Procedure
- Upload the Global_retail_sales_multilingual.xlsx and
Metadata.xlsx sample files to Cognos®
Analytics.
- Create a data module selecting the two uploaded files as the sources.
- Click the Languages icon .
- In the pane, click the Add metadata translation icon .
- In the Create language dialog box, add the French and Chinese
translation definitions.
For the French translation, specify the following settings:
- For Label, type French.
- To language
- For , select French.
- For From language, select English.
- In the data tree, expand Metadata.xlsx, and drag the column
Original text onto the Original text field field.
- Drag the column French text onto the Translated text
field field.
- Optional: Drag the column Long identifier onto the Long
identifier field field.
- Click OK.
For the Chinese translation, specify the following settings:
- For Label, type Chinese (China).
- For To language, select Chinese (China).
- For From language, select English.
- In the data tree, expand Metadata.xlsx, and drag the column
Original text onto the Original text field
field.
- Drag the column Chinese text onto the Translated text
field field.
- Optional: Drag the column Long identifier onto the Long
identifier field field.
- Click OK.
The following translation definitions are added to the Languages
pane.
- Create a filter in the data module that will return only the rows that contain the user’s
locale, as specified in the Product language column in the
Global_retail_sales_multilingual.xlsx file.
- In the Data module pane, select the
Global_retail_sales_multilingual.xlsx file, and from its context menu, click
Properties.
- On the Filters tab, from the Select a
column drop-down menu, click via expression
editor.
- Click Add a filter.
- In the expression editor, specify the filter name Product
language, and enter the following expression:
Product_language IN (#sq(toupper(substr($runLocale,0,2)))#)
- Validate the expression, and click OK to save the
filter.
In the Data module pane, the filter Product
language is added as the last column within the
Global_retail_sales_multilingual.xlsx data tree. The filter is set to English
(EN).
- Save the data module.
- Test the data module to see if the translated metadata is displayed as expected.
- From the Personal menu
in the application bar, click
Profile and settings.
- On the Settings tab, set Content
language to French, and reload the page.
In the Data module pane, the filter Product
language is now set to French (FR).
- In the Global_retail_sales_multilingual.xlsx data tree, click any
column with the text data type. For example, Product line or
Product.
The labels in the grid are now displayed in French and
the data uses French locale settings.