Localizing a Progressive Web Application
To localize a progressive web application, you don't need the static, locale-specific views created by the localization toolkit for standard applications. For PWA, the localization toolkit is used only to extract the localizable strings from the objects and to export the strings into a TSV file.
PWA uses the AR System Message Catalog form to store and retrieve translations as required. Thus, as a Remedy developer, you do not need to create locale-specific views for the same objects by using the new form.
If you are a BMC Helix ITSM user, you must configure a client gateway to access and customize your application by using Developer Studio.
Review the Best practices for localizing a progressive web application section below before you perform the localization process.
The following video (7:31) provides an overview of how to localize a Progressive Web Application.
PWA supports the following languages out-of-the-box:
- en—English (default)
- de—German
- es—Spanish
- fr—French
- iw_IL—Hebrew
- it—Italian
- ja- Japanese
- ko-Korean
- pt_BR—Portuguese
- ru—Russian
- zh_CN—Chinese
If you want to localize your Progressive Web Application in any other language, use the following localization process.
Localization process
Perform the following steps in Developer Studio to complete the localization process:
- Prepare your application that you want to localize.
- Install the localization toolkit.
- Set a root folder.
- Create a package definition for the forms that you want to localize.
- Extract the strings that you want to localize.
- Export the strings in a file that has the default Tab Separated Values (TSV) format.
- Translate the strings in the TSV file.
- Import the TSV file to the AR System Message Catalog form.
To prepare your application that you want to localize
To be ready for localization, your server must be configured for localization. Additionally, applications must have the correct localization properties set for forms, their associated views, and fields. By default, all forms, views, and fields are configured to be localized, so you should not have to manually set each property. Conversely, if you have specific forms, views, or fields that you do not want localized, set the property accordingly.
For instructions, see Preparing-your-application-to-be-localized.
To install the localization toolkit
When you install the localization toolkit, the localization toolkit files are added to the DeveloperStudio folder of your AR System installation. (The default installation directory is C:\Program Files\BMC Software\ARSystem\ DeveloperStudio.)
The localization toolkit plug-ins are placed in the plugins folder with the other Developer Studio plug-ins. A Localization Package Definitions branch is added to each server in the AR System Navigator in Developer Studio.
For instructions, see Installing-the-localization-toolkit.
To set a root folder
To begin the localization process, set a root folder, which stores:
- The localization database (l10n.db )
- The log file that logs the translation progress (l10n.log )
- Package definition files that you create for translation
The default root folder is the BMCRemedyDeveloperStudioInstallDir\workspace\l10N folder.
For instructions, see Setting-a-root-folder.
To create a package definitions for the forms
The Localization Package Definition editor in Developer Studio makes it easy to create a localization package definition for your application and any other forms that you want in the package definition.
For instructions, see Creating-a-localization-package-definition.
To extract the strings that you want to localize
After you create a localization package definition, you can extract the strings for localization into the localization database (l10n.db in the root folder).
For instructions, see Extracting-the-strings-for-localization.
To export the extracted strings to a TSV file
For Progressive Views, you must use the TSV format.
Perform the following steps:
- In Developer Studio, open the localization package definition.
- Click Export Strings.
- In the Localization Item Export dialog box, enter the full path to a target .tsv file that will contain the extracted strings.
If the path you enter does not have a TSV file, then it is created. If you specify a full path, the file is created at that location. If you specify only a file name, the file is created in the root folder.
The default root folder is the BMCRemedyDeveloperStudioInstallDir\workspace\l10N folder. - Select the locale you want to export.
- Select the state of the strings that you want to export.
Click OK.
Only those items that are set to the state you selected in step 5 (for example, "Ready to Translate") are exported to the .tsv file. For more information, see Reviewing the status of the translation progress.
Tab Separated Values (TSV) file
The following image shows a sample TSV file before translation:
The following table provides information about the columns in the exported TSV file:
Column name | Description |
---|---|
Message-Type | The type of the object for which the string is extracted. |
Form Name/Message ID | The name of the Form or Active Link or Filter |
VUI ID | The View ID of the Form |
Field ID/Message Num | Field ID or message number from the Active Link or Filter actions |
Source Text | The string to be localized. It includes the following:
|
Because TSV is a delimiter-separated file, characters such as commas or new lines in the file result in localization strings occupying multiple cells and rows instead of just one cell. Therefore, these are replaced by tags as shown in the following table:
Character | Description | Tag used |
---|---|---|
\r\n | Carriage return and new line | <crlf> |
\n | New line | <lf> |
\r | Carriage return | <cr> |
, | Comma | <comma> |
Types of objects exported
To translate the strings in a TSV file
Send the exported TSV file to a vendor for translation.
After the translation is completed, the TSV file has an additional sixth column which contains all the translations. The TSV file contains localized strings starting from the sixth column. That is, each column represents a single locale.
The following image shows a sample TSV file after translation:
To import a TSV file containing translated strings to the AR System Message Catalog Form
You can use the ARMsgCatalogEntryCreator utility that reads the TSV file and creates or updates an entry in the AR System Message Catalog form. The ARMsgCatalogEntryCreator utility accepts only a TSV file as an input.
Perform the following steps to import a TSV file to the AR System Message Catalog form using the ARMsgCatalogEntryCreator utility:
Before you use this utility, sort the TSV file four times—first by the Form Name column, next by the Field ID column, next by the View ID column, and finally by the Message Type column.
- Navigate to <ARSystemInstallDir>/ARSystem/artools and find the armsgcatalogentrycreator.bat file.
From a command prompt, run the armsgcatalogentrycreator.bat file by using the following command:
ARMsgCatalogEntryCreator utility command syntaxarmsgcatalogentrycreator.bat [-x] [-u] [-p] [-t] [-f]ARMsgCatalogEntryCreator utility command examplearmsgcatalogentrycreator.bat -f <Location of TSV file>\Translations.tsv -u <Username> -x <Server Name>The following table describes the inputs for the Command Line Interface (CLI) and parameters for connecting to the AR System:
Parameter
Description
-x
Name of the server to connect to.
-u
Name that identifies the user account for the AR System server.
-p
Password for the user account.
If you have a blank password, you can ignore this option.
-t
TCP port number to connect to.
If the port number is unknown, use -t 0.
-f
Name of the TSV file.
Depending upon the row data, an entry is created or updated. For every locale, a separate entry is created per row. For example, a single row entry in the TSV file with three translations (that is, three different locales) creates three new entries for that string.
Best practices for localizing a progressive web application
- Use independent forms only so that the related Active Links and Filters are also considered.
- For the form fields that you want to localize, set the value of the "Localize Label" property in Display Properties to True.
- When you delete a package definition, the package definition is deleted, but the extracted strings are not deleted from the localization database. If you create a package definition with the same name as the deleted one and export, you get the extracted strings from the deleted package definition as well. To avoid this issue, we recommend that you explicitly delete those strings from the database.