desc.CreateI18nObject.txt Maven / Gradle / Ivy
Creates an object to retrieve the messages from.
This following table shows the available methods.
| *Method* | *Description* |
| get _[ messageCode ]_ | Retrieves message for the selected locale given the {{messageCode}}. |
| getDisplayCountry | Returns the display country. |
| getDisplayLanguage | Returns the display language. |
| getLanguage | Returns the language locale code. |
| getCountry | Returns the country locale code. |
When no locale was set using the `Set i18n Locale` keyword, this will use the machine locale settings.
Example:
{{Messages_en.properties}} - English language messages.
| login.page.title=Login Page
{{Messages_ja.properties}} - Japanese language messages.
| login.page.title=\u30ED\u30B0\u30A4\u30F3\u30DA\u30FC\u30B8
_usage_
| ${i18n}= | `Create i18n Object` | |
| `Set i18n Locale` | en | *# -> (1) After locale set 'en'* |
| `Set i18n Locale` | ja | *# -> (2) After locale set 'ja'* |
=>
| ${i18n.get('login.page.title')} = "Login Page" *# -> (1) After locale set 'en'*
| ${i18n.getDisplayLanguage()} = "English"
| ${i18n.getLocaleLanguage()} = "en"
|
| ${i18n.get('login.page.title')} = "{{unicode:\u30ED\u30B0\u30A4\u30F3\u30DA\u30FC\u30B8}}" *# -> (2) After locale set 'ja'*
| ${i18n.getDisplayLanguage()} = "Japanese"
| ${i18n.getLocaleLanguage()} = "ja"