N/machineTranslation Module Features for SuiteScript 2.1
The N/machineTranslation module offers features for seamless document translation in SuiteScript, enhancing server-side script capabilities.
The N/machineTranslation module provides essential tools for document translation within SuiteScript 2.1. This module facilitates the creation, translation, and response handling of documents sent to a translation service, making it a vital resource for developers aiming to integrate multilingual support into their applications. Understanding its members and functionalities is crucial for effective implementation.
Overview of N/machineTranslation Module Members
The N/machineTranslation module consists of several core members that developers can leverage:
Member Types
| Name | Type | Supported Script Types | Description |
|---|---|---|---|
| machineTranslation.Document | Object | Server scripts | A document with untranslated text or translated text from the translation service. |
| machineTranslation.Error | Object | Server scripts | An error object returned from the translation service. |
| machineTranslation.Response | Object | Server scripts | The response object that includes translated documents. |
Methods
| Name | Type | Supported Script Types | Description |
|---|---|---|---|
| machineTranslation.createDocument(options) | Object | Server scripts | Creates a document to serve as source content for translation. |
| machineTranslation.translate(options) | Object | Server scripts | Translates a set of documents into the target language. |
| machineTranslation.translate.promise(options) | Promise | Server scripts | Asynchronously translates documents into the target language. |
Enumeration
| Name | Type | Description |
|---|---|---|
| machineTranslation.Language | Enum | Holds string values for source or target languages. |
Best Practices
When using the N/machineTranslation module, keep these considerations in mind:
- Document Uniqueness: Each document ID must be unique.
- Character Limits: A single document can contain up to 5,000 characters, with a total of 20,000 characters across all documents.
- Non-Empty Documents: Documents cannot be empty.
- Language Detection: The translation service can automatically detect the source language unless specified.
For optimal translation accuracy, ensure each document consists solely of text in one language.
Who This Affects
This module primarily impacts:
- Developers implementing multilingual features.
- Administrators managing translation workflows.
Key Takeaways:
- The N/machineTranslation module facilitates seamless document translation within SuiteScript.
- Includes essential objects like Document, Error, and Response for handling translation tasks.
- Employ best practices to ensure high-quality translations and effective integration.
Frequently Asked Questions (4)
What script types support the N/machineTranslation module?
Are there any character limits when using the N/machineTranslation module for document translation?
Can the machineTranslation module automatically detect the source language of documents?
What are the consequences of not following the document uniqueness rule in the machineTranslation module?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
