Create Custom String Literals

You can add new or customize existing string literals to change the default language values and corresponding translated values. You can do this in two ways, depending on your implementation.

Method 1: Use the SuiteCommerce Configuration Record

This information refers to SuiteCommerce or the Vinson release of SuiteCommerce Advanced or later.

Use the SuiteCommerce Configuration record to specify new string literals that translate at runtime. NetSuite suggests this method for making small changes to translated content.

To configure properties in NetSuite:

  1. Select the domain to configure at Commerce > Websites > Configuration.

  2. In the SuiteCommerce Configuration record, go to the Multi-Domain tab and the Translations subtab.

  3. Add custom strings in the available table as needed. See Translations Subtab for details.

  4. Save the Configuration record.

Method 2: Extend the Application

This method is required for sites implementing the Kilimanjaro release of SCA and earlier. You can also use this method for any Commerce web store when making multiple changes, especially if Method 1 becomes cumbersome.

You can extend the application to change the string literals in the code and update the name-value pairs in the existing SC.Translation arrays.

Note:

If using this method on a SuiteCommerce site or a site implementing the Aconcagua release of SCA or later, you must introduce these changes as an extension. See Localize Text in an Extension.

You can also add new string literals that translate at runtime. When you extend an application, make sure new string literals you want to localize are wrapped in the _.translate() function and the language files are updated. If you only have a few customizations, manually add new translated name-value pairs to the SC.Translations arrays for each language. But if your web store has a lot of new string literals, you should consider scripting the process. Every time you compile your website code, all string literals wrapped in the _.translate() function are processed to generate the right name-value pairs in each language file.

Important:

These language files must use UTF-8 character encoding to display international characters correctly.

Related Topics

General Notices