Demonstrate how to build SuiteApps to support internationalization and localization. Flashcards
What is the purpose of the N/currency module?
We can use it to find the exchange rate between 2 currencies based on a certain date
Using the nCurrency.exchangeRate(options) function in N/currency module, what are the 3 ‘options’ parameters?
◦ source: The original currency
◦ target: The target currency
◦ date: The date the currency exchange should take place
What are the 2 main purposes of the N/format module?
We can format strings into a specified format
We can parse formatted dates into strings
The N/format/i18n module is used for what 4 main purposes?
- Formatting of strings in international context
- Formatting of numbers to currency or number strings
- Formatting of phone numbers to strings
- Parsing of strings to phone numbers
What does the nFormat.getCurrencyFormatter(options) function do?
Creates an nFormat.CurrencyFormatter object to format numbers into currency strings
What are the 2 options of the nFormat.getCurrencyFormatter(options) function
▪ currency: Code of the currency that is used by formatter
▪ locale: Code of the locale that is used by formatter
What does the nFormat.getNumberFormatter(options) function do?
Creates an nFormat.NumberFormatter object to format numbers into strings.
What are the 5 options in the nFormat.getNumberFormatter(options) function?
▪ groupSeparator:
▪ decimalSeparator
▪ precision
▪ negativeNumberFormat
▪ locale: Indicates the locale from which default settings are determined
True or False?
The locale option in the nFormat.getNumberFormatter(options) function, can be overridden by the other 4 options in the function.
True.
The locale determines the formatting of numbers.
E.G. 1.5 in the UK would be 1,5 in France. They use a comma to denote a decimal instead of a point.
This can be overridden by the other options because they specify what to use in those instances.
What does the nFormat.spellOut(options) function do, and what are the options parameters?
Spells out positive and negative number as a string in a specific language.
Options are:
▪ number
▪ locale: language code
What does the nFormat.getPhoneNumberParse(options) function do, and what are the options parameters?
Create nFormat.PhoneNumberParser object to parse the string with the phone number to an object.
Options are:
▪ defaultCountry
What is the purpose of the N/recordContext module?
Used to get all the available context types of the record, such as localization
Using the N/recordContext module, what does the localisation context type indicate?
The localization context type indicates which country a script is using for execution
When SDFing, to make the object only run for records with a specific localization context, we must do what 2 things?
▪ Specify the name of the country in the localizationcontext field in the XML definition
▪ Set the alllocalizationcontexts field in the XML definition to “F”
What is one good thing we can do with the logic of a script using the N/recordContext module?
Can be used to create conditional statements within a script so that the script behaves differently based on the context.