translation.selectLocale(options)
Method Description |
Creates a translation.Handle object in the specified locale from an existing This method returns a translation.Handle object that contains the same translation strings as the |
Returns |
|
Supported Script Types |
Client and server scripts For additional information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Sibling Object Members |
|
Since |
2019.1 |
Parameters
The options
parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
required |
The translation.Handle object to select a locale for. |
|
|
string |
required |
The locale to select. Use the values in the translation.Locale enum to set this value. |
Errors
Error Code |
Thrown If |
---|---|
SSS_MISSING_REQD_ARGUMENT |
A handle or locale parameter is missing. |
WRONG_PARAMETER_TYPE |
The |
INVALID_LOCALE |
The specified translation.Handle object uses an unknown or unsupported locale. |
TRANSLATION_HANDLE_IS_IN_AN_ILLEGAL_STATE |
The specified translation.Handle object is in an illegal state. |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/translation Module Script Samples.
// Add additional code
...
let germanStrings = translation.load({
collections: [{
alias: 'myCollection',
collection: 'custcollection_my_strings',
keys: ['MY_TITLE', 'MY_MESSAGE'],
}],
locales: [translation.Locale.de_DE, translation.Locale.es_ES]
});
let spanishStrings = translation.selectLocale({
handle: germanStrings,
locale: translation.Locale.es_ES
});
...
// Add additional code