National Language Support (NLS) is responsible for character and language conversion according to the configured language.
With the support of NLS, UDTT applications are able to display in different languages according to customers' requirements without further translation. This is because an NLS element consists of a value and a key. Different languages refer to different values while they share the same key.
This bar can help users to invoke a search throughout the whole workspace.
Advanced Options
This module can help users to search under more specific requirements.
Language Option
The option list includes all the language locales of all the properties files in the workspace. This option can identify the specific language users want to use.
Case sensitive Option
This option can determine whether to follow the capital and lower case of the search criteria.
Diacritical marks sensitive Option
This option can determine whether to ignore the diacritical marks of the search criteria.
File List
This list can help user to view NLS properties and select specific properties file. User will need to import some multinational properties files into the NLS folder in advance in order to access the required NLS files.
Keyword Bar
This bar can help user to invoke a search in one file selected from File List.
Element List
This list is used to display the key and value of NLS properties file.
There are generally two scenarios to use NLS: in XUI file and in transaction file.
In XUI file
Widget properties
NLS can help user to update the language for text or hint properties of widgets, including
▪ Label, Button, and Link widgets which possess the text and hint properties.
▪ Text and Table column when the data name is set as string type, and TextArea.
Note Normally, the latter group is not recommended to bundle NLS. In some specific scenario which need to bundle NLS with these widgets, it is only recommended to use NLS for message display. Otherwise, submission, validation or other data management would lead to logical contradiction.
Choices
▪ Double-click the widget that has the NLS.
▪ Right click the project in the UDTT Project Explorer, and then click BTT Tools > NLS editor.
▪ Click the widget and turn to the Properties view. Click Browse in the Value column.
ECA rules
When defining Condition in an ECA rule, you could use NLS to define the left and right value in Expression as well as the multilanguage string value in Global Function.
If select Constant, select NLS as Type of Constant and then click Browse to define the value:
In transaction file
Condition State
In transaction files, users can use NLS when defining condition state. Compared with defining Condition in an ECA rule, the procedure is generally alike. You could also define the left and right value in Expression as well as the multilanguage string value in Global Function.
Input/output mapping
Users can also use NLS when defining input/output mapping for a transition. Compared with defining Condition in an ECA rule, the procedure is generally alike.
The following instruction helps you to better understand how to quickly find the key or value you want.
There are two ways to search for NLS element you want: Search inside workspace and Search inside file. Note that when you chose to search inside workspace, Keyword Bar would be disabled so that you can't search inside file.
In both ways, you can use Advanced options for smarter search:
▪ Select a language locale in the language bar (see NLS support). This means the search will be done only on files with that locale.
▪ Choose case sensitive or not.
▪ Choose diacritical marks sensitive or not. "Diacritical sensitive" means the search will be done only on those have the exact diacritical marks.
Search inside workspace
Its basic functionality is to allow users search for a text among all the properties files in the workspace. The following procedure provides detailed steps:
▪ Type a value in the input text box of the Search Bar. Then the search button is activated.
▪ Click the search button or press Enter to invoke the search. The window searches the input text on both key and value elements of all the properties files in the workspace. During the execution, a progress bar appears, showing the number or files with properties that match the search criteria, and the file name that is being scanned at that moment.
▪ If the search criteria has one or more match, the File List panel on the left would list all the files that have the matched element, each file with a number in the right bracket that corresponds to the number of occurrences in that file. And the Element List on the right would list all the properties that match the criteria. At the bottom of the window, there is a message indicating that user should select a property value from the list to proceed.
▪ If the search criteria has no match, a message informing the situation is raised and no element is shown. Then you can return to the initial state by pressing Reload or Cancel button on the Search Bar. You can refer to more information about them in the last two section of this page.
Search inside file
Its basic functionality is to allow users search for a text in one selected file. The following procedure provides detailed steps:
1 Firstly select a file from File List panel. Then Element List would display all the NLS elements in the selected file. If the file has a short list, you can directly select the NLS element from the list. If the list is long, you can go on to invoke Search inside file.
2 Input a value in the input text box of the Keyword Bar. Element List would display the match result instantly as you type. If there is no match, Element List would be blank.
3 Clear the input text box or select another file would start another Search inside file.
Reload
Reload means the window returns to the initial state that no property file or property value is selected. You can click the reload button at the Search Bar.
If there is a file selected on the left side, user “Ctrl+Click” on that file, the behavior is the same as clicking the reload button. If user takes any of these two actions, the result will be:
Cancel
Cancel means the window returns to the initial state that no search was done. You can click the cancel button at the Search Bar.
UDTT uses a group of NLS property files to switch between multi-language interfaces. One file is for one language with a set of values (backend content) in this language pointing to relative keys (ID). In this tutorial, we will take Korean interface as an example to teach you how to use and configure NLS.
1 Create a new properties file in the location of NLS folder. Name the file in this way [ProjectName]_[ language]_[locale].properties.
Use the list of language locale to indicate the language:
▪ en_US (English)
▪ zn_CN (Mandarin)
▪ es_ES (Spanish)
▪ ja_JP (Japanese)
▪ fr_FR (French)
▪ ko (Korean)
For example, the Korean NLS property file name for bttsample should be named as bttsample_ko.properties.
2 Add new NLS items for this file. Here we take text property of a label widget as an example. Open index.xui file and click on browse of the label properties. For more ways to use NLS, see Launching the NLS window.
3 Click on the file bttsample.properties and Select language locale, ko.
4 Click Add, and then enter the new item in the dialog box.
You can provide values with parameters whenever an NLS property is being edited. If the value text has parameters, the parameters box is displayed:
If parameters are required, the OK button is disabled until parameter values are provided.
5 Repeat step 2 to 4 to add new items for the NLS file.
6 Select the item you want to link to the widget, and then click OK.
Customizing the Client-side JavaScript validation message
UDTT uses Dojo to provide basic client-side validations. If you want to customize the validation message, you can override the default message in relative JavaScript file.
1 In the Java EE perspective, expand the directory WebContent > js > dojo > nls from Project Explorer.
2 Choose the language file. In this case, open dojo_ko.js.
3 Find the validation message and rewrite it between double quotation marks.