The N/translation module provides access to NetSuite’s string translation infrastructure. It enables developers to build fully localized SuiteScript customizations that display the correct language to users based on their locale settings.
Loading Translations
define(["N/translation", "N/log"], (translation, log) => {
const handle = translation.load({
collections: ["netsuite.common", "custcollection_my_strings"]
});
const welcomeMsg = translation.get({
collection: "custcollection_my_strings",
key: "WELCOME_MESSAGE"
});
log.debug("Translated string", welcomeMsg);
return {};
});
Key Methods
| Method | Description |
|---|---|
translation.load(options) | Load translation collections into memory |
translation.get(options) | Retrieve a translated string by collection and key |