Translation API in SuiteScript 2.0

In SuiteScript, the N/translation module lets developers use the Translation API and work with NetSuite Translation Collections.

You can watch a video that shows how to use the N/translation module with Translation Collections.

A Translation Collection is a customization object that stores translation strings and their translations. One Translation Collection can have many translation strings. Each translation string has a key (identifier), a value (source string), and possibly translations of the source string. A key points to one string that can be translated into multiple languages. For example, the translation string for "hello" might use the key HELLO and the value "hello". You can translate this string into any language NetSuite supports. For a list of these languages, see Configuring Multiple Languages.

You can create a collection of terms for translation in the NetSuite UI. To do this, your role needs the Manage Translations permission. Alternatively, you can create a collection as an Administrator. You can export the collection as an XLIFF file and send it to a translation vendor. After you get the translations back, you can import the file into your NetSuite account. You can use the collection to translate labels and messages in your scripts, Suitelets, and SuiteApps. For information about managing Translation Collections in the UI, see Manage Translations.

Note:

The N/translation module is read-only. If you want to create or change Translation Collections, you can do it in the NetSuite UI at Customization > Translations > Manage Translations.

A Translation Collection is wrapped in the translation.Handle object. The translation.Handle object is hierarchical, so each node is either another translation.Handle object or a translation.Translator function. Translator functions combine strings with parameters. When you create a Translation Collection in the NetSuite UI, you can add parameter placeholders to your translation strings. The translator function puts the parameter values into the placeholders in the returned translation string.

For more information, see N/translation Module.

Related Topics:

General Notices