The Translation Process
This topic applies to the Kilimanjaro release of SCA and earlier. If you are localizing text using an extension, see Localize Text in an Extension.
When you set a specific language for a website, any string literals wrapped in the _.translate()
function get replaced with language-specific strings on the site. The diagram below shows how this works.
-
The application’s SuiteScript Server Page (SSP) requests information from the backend to confirm that the requested language is properly set up in NetSuite.
-
All
_.translate()
functions in your JavaScript files contain string literals to be translated, and these match up with name-value pairs in theSC.Translations
array in JSON language files.JSON language files are located in the Languages subfolder for each application module. For example, Modules > suitecommerce > ShoppingApplication@x.x.x > Languages.
Note:In the final Distribution folder, these files are located in the languages subfolder at the root level.
-
The name-value pairs in the
SC.Translations
array contain translated values for the active language, and the array sends these values back to the_.translate()
function. -
The translated content appears on the site.
If a literal in a _.translate()
function doesn't have a matching name-value pair in the SC.Translations
array for the active language, it won't be replaced.
In addition to the localization elements the client handles, many elements—like NetSuite error messages, prices, and dates—are localized by the NetSuite backend and can't be customized or extended.