Modules

filter

 

Objects/Functions

module (N/translation)

SuiteScript 2.0

translation.Translator

{translation}.Translator{params: {string[]}})

N/translation Module
translation.Translator
Object / Function Description: Represents a translator function that returns translated strings. Use translation.get(options) to obtain this function for the specified Translation Collection and locale. The translator function is called with any parameters that you specify, and the translator function returns the appropriate translated string. When you create a Translation Collection in the NetSuite UI, you can include parameter placeholders in your translation strings. Translation strings that include placeholders are called parametrized translation strings. Placeholders use braces and a number (starting from 1). The translator function injects the specified parameter values into the placeholders in the translation string. For example, “Hello, {1}!” is a valid translation string, where {1} is a placeholder for a parameter. If you call translation.get(options) and specify a parameter of “NetSuite”, the translator function returns “Hello, NetSuite!” in the appropriate locale.
Supported Script Types: Client and server-side scripts For additional information, see SuiteScript 2.0 Script Types.
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.Translator

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_1541706219.html