Modules

filter

 

Objects/Functions

module (N/translation)

SuiteScript 2.0

translation.get(options)

{translation}.get({collection: {string*},key: {string*},locale: {string}})

N/translation Module
translation.get()
Method Description: Creates a translator function for a key in the specified Translation Collection and locale. This method returns a translator function, which is subsequently called with any specified parameters. When you call translation.get(options) and do not specify a locale, the method uses the current user's session locale. You can use the options.locale parameter to specify another locale. The translation.Locale enum lists all locales that are enabled for a company, and you can use these locales in translation.get(options).
Returns: translation.Translator
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.get(options)

Example:

// Code Example 1
// Add additional code
//...
var myMsg = message.create({
title: translation.get({
collection: 'custcollection_my_strings',
key: 'MY_TITLE'
})(),
message: translation.get({
collection: 'custcollection_my_strings',
key: 'HELLO_1'
})({
params: ['NetSuite']
}),
type: message.Type.CONFIRMATION
});
//...
// Add additional code

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