JS INTL APIs
Support for a subset of ECMA-402 INTL APIs has been added to the Hermes Engine bundled with React Native for Vega. See: https://hermesengine.dev/docs/intl/ The INTL methods supported may differ for Vega than for other platforms, refer to details below for supported methods.INTL Supported Methods Vega
Intl.Collator
The Intl.Collator object enables language-sensitive string comparison. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/CollatorIntl.DurationFormat
The Intl.DurationFormat object enables language-sensitive duration formatting. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormatIntl.DateTimeFormat
The Intl.DateTimeFormat object enables language-sensitive date and time formatting. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormatIntl.DateTimeFormat.format()
The format() method of Intl.DateTimeFormat instances formats a date according to the locale and formatting options of this Intl.DateTimeFormat object.
Intl.DateTimeFormat.formatRange()
The formatRange() method of Intl.DateTimeFormat instances formats a date range in the most concise way based on the locales and options provided when instantiating this Intl.DateTimeFormat object.
Intl.DateTimeFormat.formatRangeToParts()
The
formatRangeToParts() method of Intl.DateTimeFormat instances returns an array of locale-specific tokens representing each part of the formatted date range produced by this Intl.DateTimeFormat object.
Intl.DateTimeFormat.formatToParts()
The formatToParts() method of Intl.DateTimeFormat instances allows locale-aware formatting of strings produced by this Intl.DateTimeFormat object.
Intl.DateTimeFormat.resolvedOptions()
The resolvedOptions() method of Intl.DateTimeFormat instances returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this Intl.DateTimeFormat object.
Intl.DateTimeFormat.supportedLocalesOf()
The Intl.DateTimeFormat.supportedLocalesOf() static method returns an array containing those of the provided locales that are supported in date and time formatting without having to fall back to the runtime’s default locale.
Intl.RelativeTimeFormat
The Intl.RelativeTimeFormat object enables language-sensitive relative time formatting. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormatIntl.RelativeTimeFormat() Creates a new Intl.RelativeTimeFormat object.
Intl.RelativeTimeFormat.format()
Formats a value and a unit according to the locale and formatting options of the given Intl.RelativeTimeFormat object.
Intl.RelativeTimeFormat.formatToParts()
The formatToParts() method of Intl.RelativeTimeFormat instances returns an Array of objects representing the relative time format in parts that can be used for custom locale-aware formatting.
Intl.RelativeTimeFormat.resolvedOptions()
The resolvedOptions() method of Intl.RelativeTimeFormat instances returns a new object with properties reflecting the locale and relative time formatting options computed during initialization of this Intl.RelativeTimeFormat object.
Intl.RelativeTimeFormat.supportedLocalesOf()
The Intl.RelativeTimeFormat.supportedLocalesOf() static method returns an array containing those of the provided locales that are supported in relative time formatting without having to fall back to the runtime’s default locale.
Intl.NumberFormat
The Intl.NumberFormat object enables language-sensitive number formatting. See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormatIntl.NumberFormat() Creates a new NumberFormat object.
Intl.NumberFormat.format()
The format() method of Intl.NumberFormat instances formats a number according to the locale and formatting options of this Intl.NumberFormat object.
Intl.NumberFormat.formatRange()
The formatRange() method of Intl.NumberFormat instances formats a range of numbers according to the locale and formatting options of this Intl.NumberFormat object.
Intl.NumberFormat.formatRangeToParts()
The formatRangeToParts() method of Intl.NumberFormat instances returns an Array of objects containing the locale-specific tokens from which it is possible to build custom strings while preserving the locale-specific parts. This makes it possible to provide locale-aware custom formatting ranges of number strings.
Intl.NumberFormat.formatToParts()
The formatToParts() method of Intl.NumberFormat instances allows locale-aware formatting of strings produced by this Intl.NumberFormat object.
Intl.NumberFormat.resolvedOptions()
The resolvedOptions() method of Intl.NumberFormat instances returns a new object with properties reflecting the locale and number formatting options computed during initialization of this Intl.NumberFormat object.
Intl.NumberFormat.supportedLocalesOf()
The Intl.NumberFormat.supportedLocalesOf() static method returns an array containing those of the provided locales that are supported in number formatting without having to fall back to the runtime’s default locale.
Intl.Locale
TheIntl.Locale object is a standard built-in property of the Intl object that represents a Unicode locale identifier. The Intl.Locale object was created to allow for easier manipulation of Unicode locales. Unicode represents locales with a string, called a locale identifier. The locale identifier consists of a language identifier and extension tags. Language identifiers are the core of the locale, consisting of language, script, and region subtags. Additional information about the locale is stored in the optional extension tags. Extension tags hold information about locale aspects such as calendar type, clock type, and numbering system type.
Traditionally, the Intl API used strings to represent locales, just as Unicode does. This is a simple and lightweight solution that works well. Adding a Locale class, however, adds ease of parsing and manipulating the language, script, and region, as well as extension tags.
See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale
Intl.Locale() Creates a new Locale object.
Intl.Locale.maximize()
The maximize() method of Intl.Locale instances gets the most likely values for the language, script, and region of this locale based on existing values.
Intl.Locale.minimize()
The minimize() method of Intl.Locale instances attempts to remove information about this locale that would be added by calling maximize().
Intl.Locale.toString()
The toString() method of Intl.Locale instances returns this Locale’s full locale identifier string.
Intl.Locale.baseName
The baseName accessor property of Intl.Locale instances returns a substring of this locale’s string representation, containing core information about this locale, including the language, and the script and region if available. baseName returns the language ["-" script] ["-" region] *("-" variant) subsequence of the unicode_language_id grammar. It only includes information explicitly specified in the constructor, either through the locale identifier string or the options object.
The set accessor of baseName is undefined. This property cannot be changed directly.
Intl.Locale.calendar
The calendar accessor property of Intl.Locale instances returns the calendar type for this locale. While most of the world uses the Gregorian calendar, there are several regional calendar eras used around the world. The calendar property’s value is set at construction time, either through the ca key of the locale identifier or through the calendar option of the Intl.Locale() constructor. The latter takes priority if they are both present; and if neither is present, the property has value undefined. For a list of supported calendar types, see Intl.Locale.prototype.getCalendars(). The set accessor of calendar is undefined. This property cannot be changed directly.
Intl.Locale.caseFirst
The caseFirst accessor property of Intl.Locale instances returns whether case is taken into account for this locale’s collation rules. A locale’s collation rules are used to determine how strings are ordered in that locale. Certain locales use a character’s case (UPPERCASE or lowercase) in the collation process. This additional rule can be expressed in a Intl.Locale object’s caseFirst property. There are 3 values that the caseFirst property can have - upper, lower and false.
Intl.Locale.collation
The collation accessor property of Intl.Locale instances returns the collation type for this locale, which is used to order strings according to the locale’s rules. Collation is the process of ordering strings of characters. It is used whenever strings must be sorted and placed into a certain order, from search query results to ordering records in a database. While the idea of placing strings in order might seem trivial, the idea of order can vary from region to region and language to language. The collation property’s value is set at construction time, either through the co key of the locale identifier or through the collation option of the Intl.Locale() constructor. The latter takes priority if they are both present and if neither is present, the property has value undefined. For a list of supported collation types, see Intl.Locale.prototype.getCollations(). The set accessor of collation is undefined. This property cannot be changed directly.
Intl.Locale.hourCycle
The hourCycle accessor property of Intl.Locale instances returns the hour cycle type for this locale. There are 2 main types of time keeping conventions (clocks) used around the world: the 12 hour clock and the 24 hour clock. The hourCycle property’s value is set at construction time, either through the hc key of the locale identifier or through the hourCycle option of the Intl.Locale() constructor. The latter takes priority if they are both present; and if neither is present, the property has value undefined. For a list of supported hour cycle types, see Intl.Locale.prototype.getHourCycles(). The set accessor of hourCycle is undefined. This property cannot be changed directly.
Intl.Locale.language
The language accessor property of Intl.Locale instances returns the language associated with this locale. Language is one of the core attributes of a locale. The Unicode specification treats the language identifier of a locale as the language and the region together (to make a distinction between dialects and variations, e.g. British English vs. American English). The language property of a Intl.Locale returns strictly the locale’s language subtag. The language property’s value is set at construction time, either through the language subtag (first part) of the locale identifier or through the language option of the Intl.Locale() constructor. The latter takes priority if they are both present. The set accessor of language is undefined. This property cannot be changed directly.
Intl.Locale.numberingSystem
The numberingSystem accessor property of Intl.Locale instances returns the numeral system for this locale. A numeral system is a system for expressing numbers. The numberingSystem property’s value is set at construction time, either through the nu key of the locale identifier or through the numberingSystem option of the Intl.Locale() constructor. The latter takes priority if they are both present; and if neither is present, the property has value undefined. For a list of supported numbering system types, see Intl.Locale.prototype.getNumberingSystems().
Intl.Locale.numeric
The numeric accessor property of Intl.Locale instances returns whether this locale has special collation handling for numeric characters. Like caseFirst, numeric represents a modification to the collation rules utilized by the locale. numeric is a boolean value, which means that it can be either true or false. If numeric is set to false, there will be no special handling of numeric values in strings. If numeric is set to true, then the locale will take numeric characters into account when collating strings. This special numeric handling means that sequences of decimal digits will be compared as numbers.
For example, the string "A-21" will be considered less than "A-123".
Intl.Locale.region
The region accessor property of Intl.Locale instances returns the region of the world (usually a country) associated with this locale. Region is one of the core attributes of a locale. It allows selection for differences between the same language in, say, different countries.
For example, English is spoken in the United Kingdom and the United States of America, but there are differences in spelling and other language conventions between those two countries. Knowing the locale’s region helps JavaScript programmers make sure that the content from their sites and applications is correctly displayed when viewed from different areas of the world. The region property’s value is set at construction time, either through the region subtag (third part if script is present, second part otherwise) of the locale identifier or through the region option of the Intl.Locale() constructor. The latter takes priority if they are both present; and if neither is present, the property has value undefined. The set accessor of region is undefined. This property cannot be changed directly.
Intl.Locale.script
The script accessor property of Intl.Locale instances returns the script used for writing the particular language used in this locale Script, sometimes called writing system, is one of the core attributes of a locale. It indicates the set of symbols, or glyphs, that are used to write a particular language. For instance, the script associated with English is Latin, whereas the script typically associated with Korean is Hangul. In many cases, denoting a script is not strictly necessary, since the language (which is necessary) is only written in a single script. There are exceptions to this rule, however, and it is important to indicate the script when multiple scripts are applicable. The script property’s value is set at construction time, either through the script subtag (second part, if present) of the locale identifier or through the script option of the Intl.Locale() constructor. The latter takes priority if they are both present; and if neither is present, the property has value undefined. The set accessor of script is undefined. This property cannot be changed directly.
I18NManager Vega
Other internationalization and localization utilities for apps can be accessed via theI18NManager.
I18NManager Example
I18NManager Methods
getAppLocale()
setAppLocale()
getSystemLocale()
resetLocale()
getTimezone()
setTimezone()
getSystemTimezone()
resetTimezone()
addListener()
eventName
This can be any of the following:
I18nManager.SettingEventName.LocaleI18nManager.SettingEventName.Timezone

