N/translation Module for SuiteScript Translations Management
The N/translation module enables SuiteScript developers to manage translation collections programmatically, enhancing localization efforts in NetSuite.
The N/translation module allows SuiteScript developers to interact programmatically with NetSuite Translation Collections, which are crucial for effective localization. This module provides read-only access to translation data, enabling the retrieval of various translated strings intended for different language locales.
What is a Translation Collection?
A Translation Collection in NetSuite is a customization object that organizes translation strings alongside their respective translations. Each collection can contain multiple key/value pairs, where the key acts as an identifier and the value represents the original string that can be translated into multiple languages supported by NetSuite.
How Does the N/translation Module Work?
The N/translation module primarily relies on a hierarchical object known as translation.Handle. This object encapsulates a collection of translations for a specified locale. When you create a Translation Collection, you can incorporate parameter placeholders in your translation strings, allowing for dynamic content generation.
Utilizing the Translation Module
To access translation strings in your scripts, you exploit the following key methods and objects:
Key Methods and Objects
| Member Type | Name | Return Type / Value Type | Supported Script Type | Description |
|---|---|---|---|---|
| Object | translation.Handle | Object | Client and server scripts | Encapsulates a Translation Collection for a locale. |
| Object / Function | translation.Translator | Object / Function | Client and server scripts | Represents a translator function that returns translated strings with variables passed as parameters. |
| Method | translation.get(options) | translation.Translator | Client and server scripts | Creates a translator function for a key in the specified Translation Collection and locale. |
| Method | translation.load(options) | translation.Handle | Client and server scripts | Creates a translation.Handle object with translations for the specified Translation Collections and locales. |
| Method | translation.selectLocale(options) | translation.Handle | Client and server scripts | Creates a translation.Handle object in a specified locale from an existing translation.Handle object. |
| Enum | translation.Locale | enum | Client and server scripts | Holds supported locales for Translation Collections. |
Code Sample
Here’s a sample code snippet demonstrating how to use the translation.get(options) method:
1// key HELLO_1 = 'Hello, {1}'2 3message: translation.get({4 collection: 'custcollection_my_strings',5 key: 'HELLO_1'6})({7 params: ['NetSuite']8})In this example, the function retrieves a translation string with a key of HELLO_1, which might return "Hello, NetSuite" when provided the corresponding parameter.
Managing Translation Collections in the UI
While the N/translation module provides programmatic access, managing Translation Collections also occurs within the NetSuite UI. Administrators can navigate to Customization > Translations > Manage Translations to create, edit, or delete collections depending on their needs.
Key Takeaways
- The N/translation module provides SuiteScript developers with a way to manage translation collections programmatically.
- Translation Collections store key/value pairs for easy localization across multiple languages supported by NetSuite.
- Methods such as translation.get(options) and translation.load(options) enable retrieval and management of translation strings dynamically.
- Administrators can manage collections directly through the NetSuite UI.
Source: This article is based on Oracle's official NetSuite documentation.
Frequently Asked Questions (4)
Can the N/translation module be used in both client and server scripts in NetSuite?
How does the translation.Handle object function within the N/translation module?
Is it possible to manage Translation Collections directly within the NetSuite UI?
Does the N/translation module allow for translation of dynamic content?
Was this article helpful?
More in Localization
- Brazil Certification Tax Authorities XML Updates in NetSuite
New e-document templates for Brazil's tax authorities introduced in NetSuite January 26, 2026, enhancing compliance with tax reforms.
- E-Document Certification for Brazil in NetSuite 2026.1
Starting in NetSuite 2026.1, E-Document Certification streamlines electronic invoice compliance for Brazilian businesses with tax authorities.
- Brazil Reports SuiteApp for Compliance in NetSuite 2026.1
Updates for Brazil Reports SuiteApp now available in NetSuite 2026.1, including enhanced reporting features.
- Mexico Complementary Features SuiteApp Enhancements for NetSuite
Explore Mexico Complementary Features SuiteApp enhancements, improving electronic reporting and transaction support.
Advertising
Reach Localization Professionals
Put your product in front of NetSuite experts who work with Localization every day.
Sponsor This Category