Localizing an application
Supported languages
English (EN) is the default language of the BMC Helix Innovation Studio application. You can localize your application in any of the following languages to translate error messages, warning messages, and static strings on your application UI:
- French—fr
- German—de
- Italian—it
- Japanese—ja
- Korean—ko
- Portuguese (Brazil)—pt-BR
- Russian—ru
- Simplified Chinese—zh-CN
- Spanish—es
- Dutch—nl
- Swedish—sv
- Danish—da
- Norwegian—no
- French (Canada)—fr-CA
- English(Canada)—en-CA
- Thai—th
Before you begin
Before you begin with the localization of your application, make sure that the application is localizable. To make your application localizable, extract the strings that you want to localization from your application code and definitions:
- Extract the Java-based string in the localized-strings.properties file.
- Extract the JavaScript-based strings in the localized-strings.json file.
To localize definition-based strings
The following video gives you information to localize your application. The video shows an older version of BMC Helix Innovation Studio. Although there might be minor changes in the UI, the overall functionality remains the same:
- Mark the custom view component properties (like field labels, column labels, action button labels, and so on) as localizable:
- Navigate to the <view-component-name>.config.js file located in the view-components/<view-component-name> folder.
Mark the view component properties as localizable by setting them as true.
The following sample code shows how to configure a view component as localizable:rxViewComponentProvider.registerComponent([
{
name: 'Display Greetings',
group: 'Hello World Components',
icon: 'speaker',
type: 'rx-greeting',
designType: 'rx-greeting-design',
propertiesByName: [
{
name: 'greeting',
type: 'string',
isRequired: true,
isConfig: true,
isProperty: true,
localizable: true
}
]
}
]);
Navigate to the application parent directory and run the following command to redeploy your application:
mvn clean install –Pexport -Pdeploy- In BMC Helix Innovation Studio, if you have created any view definition using the custom view component, you must create the view definition again (this step is required because you would have changed the source code for the view component in Step 1).
- Apply translations.
To localize Java-based strings
- In the localized-strings.properties file, located at bundle\src\main\resources, add the strings that you want to localize.
Go to the application parent directory and run the following command to import the strings from the localized-strings.properties file to BMC Helix Innovation Studio :
mvn clean install -Plocalization- Apply translations.
To localize static strings
To localize any static strings in your application code, apply the localization filter to all static HTML strings. To retrieve localized strings, use the localization service.
The following code snippet is an example for using the translate filter:
The following code snippet is an example for using the $translate service:
'tms.approvals.myApprovals.title',
'tms.approvals.myApprovals.subtitle'
]).then(function (translations) {
$scope.title = translations['tms.approval.myApprovals.title'];
$scope.subtitle = translations['tms.approval.myApprovals.subtitle'];
});
To localize OOTB view component definitions
As an application business analyst, you can customize a view definition and localize it by using BMC Helix Innovation Studio. For example, you can edit or create view definitions and then localize your application.
- Log in to BMC Helix Innovation Studio, and through Workspace, navigate to the application for which you want to customize definitions.
- Customize the definitions according to your requirements and save the definitions.
- Apply translations.
To localize record instances
You can localize record instances by using the locale field. The field ID of the locale field is 160.
- Localize the server.
- In a browser, log in to Mid Tier and open the Action Request System Administration Console.
- Navigate to General > Server Information > Advanced, and enable Localized Error Messages (Localize Server).
- Create a text field with field ID 160 in the record definition for which you want to localize record instances.
- Create record instances and provide valid values for the locale fields.
To apply translations
In BMC Helix Innovation Studio, in your application, navigate to Translations > Download Translations and download the localized-strings.json file.
The following example shows a localized-strings.json file:{
"7a97b657-0162-426b-9df9-78e35d0fde6a":"Welcome"
}Translate the localized-strings.json file in the following format:
{
"fr" : {
"7a97b657-0162-426b-9df9-78e35d0fde6a":"Bienvenue"
},
"de": {
"7a97b657-0162-426b-9df9-78e35d0fde6a":"
Willkommen
"
}
}- In BMC Helix Innovation Studio, navigate to Translations > Upload Translations and upload the translated localized-strings.json file.
To localize error messages
To localize the error messages, perform the steps listed in the To localize Java-based strings section.