Successfully!

Error!

Internationalization plugin

  • Last update:  2022-09-26
  • I. Overview

    1. Version

    Report Server VersionPlugin Version
    10.0.17V1.4


    2. Application scenarios

    Some users want to switch report languages. Currently, they can use formulas to determine and change the strings in labels and text content, and then use conditions to determine the data source in the field content. For details, see Switching between Chinese and English in a single report. This solution is for a single template. If there are multiple reports that require language switching, the operation cost is too high.


    3. Functional Description

    By installing the Internationalization plugin, users of different languages can display reports in their native language when viewing reports, and users can also switch the display language by themselves.

    The plugin is set through the corresponding relationship of [key-value], and the set [key] is called in the system to switch the language.

    The currently supported language types are: Simplified Chinese, Traditional Chinese, English, Japanese, and Korean.

    Note: This plugin is suitable for environments with jar package versions of 10.0.17 and above.

    II. Plugin introduction

    1. Plugin installation

    Click to download the plugin: Internationalization plugin

    For the method of installing plugins in the designer, please refer to: Designer plugin management

    Server installation plug-in method refer to: Server plugin management


    2. Attribute Settings - Template Internationalization Switch

    1) Template internationalization setting - setting interface entry

    The template internationalization setting is to set the corresponding mapping relationship of [key-value], and the setting content is only valid for the current template.

    Click Template > Template Internationalization to enter the internationalization setting interface.

    There are two tabs on the interface. The template tab supports adding, deleting, modifying, and viewing the corresponding relationship of [key-value]. The server tab only supports viewing.

    The search box at the top of the interface supports keyword search for the [Key-Value] content under the template tab and server tab in the current interface, but the Description column does not support searching.

    1.png

    2) Template Internationalization Settings - [Key-Value] Settings

    Click the + button to pop up the [Key-Value] setting interface.

    Enter the object used for formula calling in [Key], and any value can be customized. Enter the explanation of the current key in [Description], and enter the display content of the current key in different languages in each language field.

    Note: The display content of at least one language can be submitted in the language field.

    Click the [2.png] button to modify the current [Key-Value] setting.

    Click the [3.png] button next to the corresponding [Key-Value] row to delete a single [Key-Value] setting.

    After selecting the checkbox in front of the [Key-Value] row, click the [3.png] button at the top of the list to delete multiple [Key-Value] settings.

    4.gif

    3) Template Internationalization Settings - Template Language Settings

    Click the [5.png] button at the top right of the list to enter the template language setting interface, and the settings will only take effect for this template.

    Template language settings can be selected from [Use server settings] or [Set for this template].

    Use server settings is default language and backup language options are grayed out and cannot be modified.

    Set for this template can customize default language and backup language

    The default language can be chosen to follow the platform/browser language or specific language content.

    • When choosing to follow the platform/browser language, if the platform and browser language are inconsistent, the default language of the template is the platform language.

    • When choosing to follow the platform/browser language, if the browser language is not included in the supported languages, the template language is the backup language.

    6.gif

    4) Server Template Internationalization Settings - Setting Interface Entry

    The server template internationalization setting is to set the [key-value] mapping relationship, and the setting content takes effect for all templates on the current server.

    Log in to the decision-making platform as an administrator, click Manage > Language Configuration to enter the internationalization setting interface.

    The search box on the right at the top of the interface supports keyword search for the content of [Key-Value], but the [Remarks] column does not support search.

    [Display Field] can switch the language field displayed in the current [Key-Value] list.

    7.gif

    5) Server Template Internationalization Settings - [Key-Value] Settings

    Click the + button to pop up the [Key-Value] setting interface.

    Enter the object used for calling in [Key], and any value can be customized. Enter the explanation of the current key in [Remarks], and enter the display content of the current key in different languages in each language column.

    Note: The display content of at least one language can be submitted in the language field.

    Click the [8.png] button to modify the current [Key-Value] setting.

    Click the [9.png] button next to the corresponding [Key-Value] row to delete a single [Key-Value] setting.

    After selecting the checkbox in front of the [Key-Value] row, click the [9.png] button at the top of the list to delete multiple [Key-Value] settings.

    [Key-value] list also supports batch import and export.

    10.gif

    6) Server Template Internationalization Settings - Server Template Language Settings

    Click Server > Server Template Language Settings in the menu bar to enter the setting interface.

    Default language and backup language can be customized.

    The default language can be chosen to follow the platform/browser language or specific language content.

    • When choosing to follow the platform/browser language, if the platform and browser language are inconsistent, the default language of the template is the platform language.

    • When choosing to follow the platform/browser language, if the browser language is not included in the supported languages, the template language is the alternate language.

    11.png

    7) Template Language Switching - Toolbar Widget

    • Click Template > Web Attributes to enter the Pagination Preview Settings or Data Entry Settings or Data Analysis Settings page.

    • After selecting Individually set for the template, you can customize the widgets in the toolbar.

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

    • Template language cwidget support custom widget icons and widget names, and whether to display icons and names.

    After the setting is complete, preview the template and click the widget in the top toolbar to select the language to be switched. The effect is shown in the following figure.

    12.gif

    8) Template language switching - URL passing parameters

    After previewing the template, add "&fr_locale=" after the URL, and enter the value of the corresponding language to switch the language. The effect is shown in the following figure.

    Note: [Simplified Chinese] corresponds to [zh_CN], [Traditional Chinese] corresponds to [zh_TW], [English] corresponds to [en_US], [Japanese] corresponds to [ja_JP], and [Korean] corresponds to [ko_KR].

    13.gif

    9) Template language switching - parameter widget

    Note: This method is only valid for the content after the query, and the content loaded before the query (such as toolbar, other widget text, etc.) does not take effect.

    Add a new template parameter or global parameter named fr_locale.

    Generate the parameter fr_locale in the template parameter panel, and set the parameter widget as a drop-down box widget.

    Set the data dictionary for the widget, set the type to [Custom], add the required language options, and the actual values should correspond to zh_CN, zh_TW, en_US, ja_JP, ko_KR.

    The display value of the parameter widget is fixed and cannot be set to switch between multiple languages.

    14.gif

    10) Template language switching - front-end display

    When the front-end display text is encountered in the template, such as: prompts, pop-up windows, etc., the cell formula "I18N()" does not take effect on the front-end displayed text. At this time, events can be used to realize the multi-language of the front-end text exhibition.

    The text in the corresponding language is returned through the front-end function "FR.i18nText()", which is convenient for the internationalized key call of the text in the front-end toolbar and events.

    Here is an example of hyperlinks, other places where events can be added are the same.

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

    The JS code is as follows:

    var a = FR.i18nText('Washing temperature does not exceed 30 degrees Celsius!');//The text here needs
    to set the key-value in [Template Internationalization]
    FR.showDialog("Details",600,400,a);
    var a = FR.i18nText('No.1');//The text here needs to be set as key-value in [Template
    Internationalization]
    FR.showDialog("Details",600,400,a);

    16.gif


    3. Attribute Settings - Platform Internationalization Switch

    1) Platform internationalization [Key-value] setting

    Log in to the decision-making platform as an administrator, and click Manage > Language Configuration to enter the internationalization setting interface.

    The search box on the right at the top of the interface supports keyword search for [Key-Value] content, but the [Remarks] field does not support search.

    [Display Field] can switch the language field displayed in the current [Key-Value] list.

    Support for adding, deleting, modifying, viewing, batch importing, and batch exporting the mapping relationship of [key-value].

    17.png

    • Batch import

    Create an Excel file locally as the data source. The Excel field name must meet the format, otherwise the import will fail. The Excel sample table is shown in the figure.

    18.png

    Click Import in the decision-making platform, select the data source, and the import is successful, as shown in the following figure.

    19.png

    20.png

    • Batch export

    Click Export > Export Excel in the decision-making platform.

    21.png

    2) Platform Language Preferences

    Log in to the decision-making platform as an administrator, click Manage > Language Configuration > More Settings to enter the platform language preference setting.

    The system language setting supports Simplified Chinese, Traditional Chinese, English, Japanese, and Korean. After setting, any user logs in to the platform and displays in the current language.

    To use the login page language switching function, the platform language preference needs to be set to [Simplified Chinese].

    22.png

    3) Platform internationalization switch settings

    The display parts that can be customized in the system can be switched internationally by calling [Key], such as: report directory, login title, platform title.

    • Report directory

    Click Manage > Directory, select a folder, and you can customize the name in the right panel.

    23.png

    • Login title

    Click Manage  > Appearance > Login Page to customize the login title.

    24.png

    • Platform title

    Click Manage > Appearance > Platform Style to customize the title of the platform.

    25.png

    • Management platform internationalization switching settings

    The display of the management platform does not need to be set separately. Click Manage > Security > Security Headers > Browser Cache Disabled, and then switch the language button to achieve internationalization.

    26.png

    27.png

    • Login page internationalization switch settings

    On the login interface of the decision-making system, there is a language selection at the bottom of the page.

    28.png

    III. Template internationalization example

    1. Data Preparation

    Prepare an Excel file with different languages, add a [Language] field to the file, and enter the value of the corresponding language in the field, such as: zh_CN, zh_TW, en_US, ja_JP, ko_KR. Click to download the sample file: 

    Example.xlsx

    Create a new Excel dataset in the template and import the Excel file just prepared.

    29.gif


    2. Making a report - setting data

    • Drag the fields in the dataset into cells A2:E2, and set the center for cells A2:E2 and add the inner and outer frames of the table.

    • Select cell A2, double-click to enter the data column setting interface, and click Filter.

    • Set the data filter to display the data of the corresponding language according to the value of the language parameter.

    • Set the Language field Equal to parameter fr_locale, and click + Add to generate filter conditions.

    At this time, if the current browser language is Traditional Chinese, only the data of Traditional Chinese will be displayed.

    30.png


    3. Set the list title in multiple languages

    • Click Template > Template Internationalization to enter the internationalization setting interface.

    • Click thebutton to add a [key-value] mapping relationship, and enter the key name and display in different languages in the setting interface.

    • After completing the settings, click OK.

    31.png


    4. Making Reports - Inserting Multilingual Titles

    • Insert the title of the list in the cells A1:E1, and set the center of the cells A1:E1 and add the inner and outer frames of the table.

    • Use the formula for the title, select insert formula, and enter i18n ("key").

    • After all the titles are set, if the current browser language is Traditional Chinese, the title content will be displayed in Traditional Chinese.

    32.png


    5. Setting language switching

    • Click Template > Web Attributes to enter the Pagination Preview Settings interface.

    • After selecting Individually set for the template, you can customize the widgets in the toolbar.

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

    After completing the settings, click OK, click Preview, and view the effect in the browser. After switching the language, the report toolbar, title, and data are displayed as the content of the corresponding language, and the effect is shown in the following figure.

    33.gif

    IV. Template download

    Click to download the template: 

    Multilingual program.cpt


    Attachment List


    Theme: Decision-making Platform
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback