Adding a New Locale to ThingWorx Flow
Prerequisite
Ensure that you have created the locale in ThingWorx.
Steps
Complete the following steps to add a new locale to ThingWorx Flow:
1. Under your ThingWorx Flow installation directory at \ThingWorxOrchestration\modules\static-ux\locales, create a folder with your locale ID.
2. Create the following JSON files under your locale folder:
◦ editor.json
◦ common.json
◦ server.json
◦ services.json
It is recommended that you use the en locale files as a template, and edit those files accordingly. This ensures that you have English values as a fallback option.
3. Under \ThingWorxOrchestration\modules\db_seed, edit the localizations.json file, and add the following localization tokens:
{
"namespace": <Connector Configuration Value>,
"locale": <Locale ID>,
"token": <Source Code Key (Do Not Change)>,
"value": <Translated Value>,
}
Connector configuration values for third-party services is available
here.
For example, if you want to add the localized token of “Download a specific file” for Google Drive in the “he” locale, add the following lines of code:
{
"namespace": "google_drive",
"locale": he,
"token": gd_1_usage_html,
"value": <Translated Value>,
}
|
For any value, do not change the original value of the token parameter.
|
4. After you add all the required tokens to the localizations.json file, save the file.
5. Navigate to \ThingWorxOrchestration\modules\db_seed, start Command Prompt, and run the following command to set the new tokens in the database:
node migrate_collection.js -u <ThingWorx Flow Database User> -p <ThingWorx Flow Database Password>
6. Refresh your browser.
The new locale is available in ThingWorx Flow.