Successfully!

Error!

Template Multilingual Switchover

  • Last update:  2023-12-21
  • Overview

    Version

    Report Server Version
    Multilingual Solution Plugin VersionNew Function

    11.0

    V1.3

    /

    11.0

    V2.0.7

    1. Added an option to import all keys of the i18n function in the current template.

    2. Supported the import/export of Excel files in the XLSX format.

    3. Changed the format of exported Excel files from XLS to XLSX.

    11.0

    V2.0.8

    1. Supported name internationalization of exported files.

    2. Supported name internationalization of browser tabs.

    3. Supported the i18n formula internationalization in FVS.

    Application Scenario

    Enterprises may need to display templates in different languages on different occasions. In this case, they can use the Multilingual Solution plugin to display a template in different languages, reducing the production and maintenance costs of multiple templates.

     1.png

     

    Function Description

    This document introduces how to achieve template internationalization in the designer and on the platform, how to switch template languages through the Template Language widget on the toolbar, the URL parameter, and the parameter widget, and how to switch languages through JS when content needs to be displayed on the front end.

    Prerequisite

    You have installed the Multilingual Solution plugin. For details, see Multilingual Solution Plugin Overview.

    Template Internationalization in the Designer

    iconNote:
    You cannot set keys and corresponding values for FVS dashboards in the designer. Refer to section "Setting Template Internationalization on the platform" to set.

    Setting the Entry

    Template internationalization can be achieved by setting corresponding key-value mapping relationships. The setting only takes effect for the current template.

    Choose Template > Template Internationalization to go to the internationalization setting page, where the Template tab allows you to add/delete/modify/view the corresponding key-value relationship and the Server tab allows you to read only.

    The search box on the top of the page allows you to enter keywords and search for keys and values (except for the Description column) on the Template tab and the Server tab of the current page.

     2.png

    Setting Keys and Values

    Click the + icon. The key-value setting page pops up.

    Enter the object (any value) for formula calling in Key Name, enter descriptions for the current key in Description, and enter the display content of the current key in different languages in corresponding language setting items.

    iconNote:
    You must enter the display content in at least one language in language fields for submission.

    Click the edit icon to modify the current key and value.

    Click the deletion icon at the end of the corresponding key-value line to delete single key-value setting.

    Select the checkbox in front of the key-value line and click the deletion icon at the top of the list to delete multiple key-value settings.

     3.png

    iconNote:
    You can import all keys of the i18n function in the current template with the Multilingual Solution plugin 2.0.7 and later versions.

     4.png

    iconNote:
    You can import/export Excel files in the XLSX format with the Multilingual Solution plugin 2.0.7 and later versions, as shown in the following figure.

    The default format for exported Excel files is XLS. You can manually change the format to XLSX and export Excel files.

    iconNote:
    The effects are the same for imported Excel files in the XLSX format and those in the XLS format.  

     5.png

    Setting the Template Language

    Click the Template Language Settings icon in the upper right corner of the list to go to the template language settings page and select Set for This Template.

    Template Language Settings can be set to Use Server Settings or Set for This Template.

    Use Server Settings: The Default Language and Backup Language settings are grayed out and cannot be modified.

    Set for This Template: You can customize a default language and a fallback language.

    Default Language can be set to Platform/Browser Language or one of the five languages (zh_CN, en_US, ja_JP, zh_TW, and ko_KR).

    • If you select Platform/Browser Language, the default template language follows the platform language in the case of inconsistent platform and browser languages.

    • If you select one of the five languages, the template language follows the backup language in the case of the browser not supporting the selected language.

     6.png

    Template Internationalization on the Decision-making Platform

    iconNote:
    You need to upgrade the FineVis Data Visualization plugin to 1.11.1 or later versions and the Multilingual Solution plugin to 2.0.8 or later versions.

    Setting the Entry

    The server template internationalization is to set the corresponding relationship between keys and values. The setting only takes effect for the current template.

    Log in to the decision-making system as the admin and choose System Management > Language Configuration to go to the internationalization setting page.

    The search box on the top right of the page allows you to search for keys and values (except for the Remarks column) through keywords.

     7.png

    Setting Keys and Values

    Click the + icon. The key-value setting page pops up.

    Enter the object (any value) for formula calling in Key. Enter descriptions for the current key in Remarks. Enter the display content of the current key in different languages in corresponding language setting items.

    iconNote:
    You must enter the display content in at least one language in language fields for submission.

    Click the edit icon to modify the current key and value.

    Click the deletion icon at the end of the corresponding key-value line to delete single key-value setting.

    Select the checkbox in front of the key-value line and click the deletion icon at the top of the list to delete multiple key-value settings.

    You can also import/export keys and values in batch.

     8.png

    Setting the Server Template Language

    Choose Server (on the menu bar) > Internationalization Manage to go to the setting page.

    You can set Default Language and Backup Language.

    Default Language can be set to Platform/Browser Language or one of the five languages (zh_CN, en_US, ja_JP, zh_TW, and ko_KR).

    • If you select Platform/Browser Language, the default template language follows the platform language in the case of inconsistent platform and browser languages.

    • If you select one of the five languages, the template language follows the backup language in the case of the browser not supporting the selected language.

     9.png

    Setting the Language for the Browser Tab Name

    iconNote:
    The browser tab name internationalization function is added in the Multilingual Solution plugin 2.0.8.

    Set the template name (complete match) as the key and set the name to be displayed as the value.

    For example, set Key to WorkBook3 and English to Analysis Table.

     10.png

    The browser tab name becomes Analysis Table during preview.

     11.png

    Setting the Language for the Exported File Name

    iconNote:

    1. The Multilingual Solution plugin 2.0.8 supports the name internationalization function for exported files.

    2. The supported formats of exported files are Excel, PDF, and Word.

    3. If the file name is specified through the __filename__ parameter, the name internationalization is not supported.

    After you have set the key and value based on section "Browser Tab Name Internationalization", the file name can be internationalized during export.  

     12.png

    Setting Language Internationalization Through  I18N Formula in FVS Dashboards

    iconNote:
    The Multilingual Solution plugin 2.0.8 supports the internationalization function through the I18N formula in FVS dashboards.

    After you have set the key and value based on section "Browser Tab Name Internationalization", the file name can be internationalized through the formula i18n('Analysis Table') in FVS dashboards.  

     13.png

    Template Language Switchover

    Method 1: Through the Toolbar Widget

    • Choose Template > Web Attribute and click the Pagination Preview (or Data Entry Setting/Data Analysis Setting) tab.

    • Set Following Settings to Set for This Template Separately and customize the toolbar widgets.

    • Double-click the Template Language widget to add it to the toolbar of the current template.

    You can customize the name and icon of the Template Language widget and determine whether to display the name and icon.

    After completion, preview the template, click the widget on the top toolbar, and select the needed language, as shown in the following figure.

     14.png

    15.png

    Method 2: Through the URL Passing Parameters

    After previewing the template, add &fr_locale= to the end of the URL and enter the value corresponding to the needed language to switch languages, as shown in the following figure.

    iconNote:
    The values corresponding to five languages are zh_CN (Simplified Chinese), zh_TW (Traditional Chinese), en_US (English), ja_JP (Japanese), and ko_KR (Korean).

     16.png

    Method 3: Through the Parameter Widget

    iconNote:
    This method only takes effect on the content after the query, not on the content (like toolbar and other widget texts) loaded before the query.


    Add a template parameter or global parameter named fr_locale.

    Generate the parameter fr_locale on the template parameter panel and set the parameter widget as Drop-down Box Widget.

    Set Type in Data Dictionary of the widget to Custom and add the needed languages with actual values as zh_CN, zh_TW, en_US, ja_JP, or ko_KR.

    The display value of the parameter widget is fixed and cannot be set for multilingual switch.

     17.png

    18.png

    19.png

    Method 4: Through Events

    You may need to display template texts (such as prompts and pop-ups) on the front-end. In this case, the I18N() function does not take effect on these texts. You can display front-end texts multilingually through events.

    Texts of corresponding languages can be returned through the front-end function FR.i18nText(), facilitating calling the text internationalization keys on the front-end toolbar and in events.

    Take the hyperlink as an example here. The method is the same for other scenarios where events are needed.

    Add a JavaScript event, enter JS code, save the template, and preview.

    Java codes are as follows:

    var a = FR.i18nText('Washing temperature does not exceed 30 degrees Celsius!'); // You need to set the key and value in Template Internationalization. FR.showDialog("Details",600,400,a);
    var a = FR.i18nText('No.1'); // You need to set the key and value in Template Internationalization. FR.showDialog("Details",600,400,a);


     20.png

    21.png

    22.png

    Template Internationalization Example

    Data Preparation

    Click to download the sample file: Sample.xlsx.

    1. Prepare an Excel file with different languages, add a Language field, and enter the corresponding language values (such as zh_CN, zh_TW, en_US, ja_JP, ko_KR) in the field.

    2. Create an Excel datasetin a template and import the prepared Excel file.

     23.png

    Setting Data

    • Drag the fields from the dataset into cells A2:E2 and set the cells A2:E2 to be centered with all borders.

    • Double-click cell A2 to go to the data column setting page and click Filter.

    • Set a data filter condition to display data of corresponding languages based on the language parameter values.

    • Set Available Column to Language and Operator to Equal to, add the parameter $fr_locale, and click Add to generate a filter condition.

    Only data in English is displayed if the current browser language is English.

     24.png

    Setting the Multilingual Template Title

    • Choose Template > Template Internationalization to go to the internationalization setting page.

    • Click the + icon to add key-value relationships and enter key names and display content in different languages on the setting page.

    • Click OK after completion.

     25.png

    Inserting the Multilingual Title

    Insert template headers in cells A1:E1 (being centered with all borders).

    Click cell A1, set Insert Element to Insert Formula, and enter the formula I18N("key").

    After completion, only data in English is displayed if the current browser language is English.

     26.png

    Setting the Language Switchover Widget

    • Choose Template > Web Attribute and click Pagination Preview.

    • Set Following Settings to Set for This Template Separately and customize the toolbar widgets.

    • Double-click the Template Language widget to add it to the toolbar of the current template.

    After completion, click OK and preview the effect in the browser. Select a language from the Template Language widget. The report toolbar, title, and data are displayed in the corresponding language, as shown in the following figure.

     27.png

    28.png

    Template Download

    For details, you can download the template Multilingual Solution.cpt.


    Attachment List


    Theme: Designer and Upgrade
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback