2

How do we handle multi language requirements in our customisation? We can use suitescript API nlapiGetContext().getPreference('language') to retrieve the user preference.

My question is - what is the best practice to store the localized strings?

Should these be stored in multiple files in the file cabinet? Or should these be in a library module?

Is there a tighter support within NetSuite to handle this scenario?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Binoy Samuel
  • 144
  • 8

2 Answers2

0

In Netsuite you can use (For the backend) Custom Records (Customization > List, Records & Fields > Record Types > New) for storing the localized string which you can fetch in your suitelet or client script.

As long as it is a small string (or even for large) you can use custom records or there is another way you can use Email Template(Documents > Templates > Email Templates > New) for the same but here you need to create multiple files per language per string (I recommend this only for the long strings.)

Based upon the language you can compare and load the appropriate string.

You can fetch Email template using: nlapiLoadRecord('emailtemplate', 'template-id')

and Custom Records using: nlapiLoadRecord("record-id","row-id")

Ayush92
  • 1
  • 2
0

I the same problem, not being able to easily localise the language of NetSuite SuiteScript 2 scripts so I built my own language module that I just include in my scripts.

It allows you to separate all the text strings out of the actual coding so they can be easily updated / translated into any language.

Take a look at the project on my GitHub here: https://github.com/mdbkaustralia/netsuite_language_controller_module

There is a short help doc in the readme, plus there is a working example you can upload to your NetSuite to try it out!

Kane Shaw
  • 314
  • 1
  • 8