Modules

filter

 

Objects/Functions

module (N/translation)

SuiteScript 2.0

translation.selectLocale(options)

{translation}.selectLocale({handle: {translation.Handle*},locale: {string*}})

N/translation Module
translation.selectLocale()
Method Description: Creates a translation.Handle object in the specified locale from an existing translation.Handle object. This method returns a translation.Handle object that contains the same translation strings as the options.handle object, and the strings are in the options.locale locale. Before you can use this method to select a locale, the locale must be loaded using the locales parameter of translation.load(options).
Returns: translation.Handle
Supported Script Types: Client and server-side scripts For additional information, see SuiteScript 2.0 Script Types.
Governance: None
Module: N/translation Module
Sibling Object Members: N/translation Module Members
Since: 2019.1
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=translation.selectLocale(options)

Example:

// Code Example 1
// Add additional code
//...
var germanStrings = translation.load({
collections: [{
alias: 'myCollection',
collection: 'custcollection_my_strings',
keys: ['MY_TITLE', 'MY_MESSAGE'],
}],
locales: [translation.Locale.de_DE, translation.Locale.es_ES]
});

var spanishStrings = translation.selectLocale({
handle: germanStrings,
locale: translation.Locale.es_ES
});
//...
// Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_1541708921.html