Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(i18n): fix and update CLDR to v30.0.1 #15997

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 45 additions & 4 deletions i18n/closure/currencySymbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ goog.i18n.currency.SPACE_FLAG_ = 0x20;
goog.i18n.currency.tier2Enabled_ = false;


/**
* Tests if currency is available.
*
* Note: If the currency is not available it might be in the tier2 currency set:
* {@link goog.i18n.currency.CurrencyInfoTier2}. If that is the case call
* {@link goog.i18n.currency.addTier2Support} before calling any other function
* in this namespace.
*
* @param {string} currencyCode Currency code to tested.
* @return {boolean} If the currency is available.
*/
goog.i18n.currency.isAvailable = function(currencyCode) {
return currencyCode in goog.i18n.currency.CurrencyInfo;
};

/**
* This function will add tier2 currency support. Be default, only tier1
* (most popular currencies) are supported. If an application really needs
Expand All @@ -84,6 +99,7 @@ goog.i18n.currency.addTier2Support = function() {


/**
* Deprecated.
* Global currency pattern always uses ISO-4217 currency code as prefix. Local
* currency sign is added if it is different from currency code. Each currency
* is unique in this form. The negative side is that ISO code looks weird in
Expand All @@ -92,6 +108,9 @@ goog.i18n.currency.addTier2Support = function() {
*
* @param {string} currencyCode ISO-4217 3-letter currency code.
* @return {string} Global currency pattern string for given currency.
* @deprecated Format numbers using {@link goog.i18n.NumberFormat} with
* {@link goog.i18n.NumberFormat.Format.CURRENCY} and
* {@link goog.i18n.NumberFormat.CurrencyStyle.GLOBAL}
*/
goog.i18n.currency.getGlobalCurrencyPattern = function(currencyCode) {
var info = goog.i18n.currency.CurrencyInfo[currencyCode];
Expand Down Expand Up @@ -119,12 +138,16 @@ goog.i18n.currency.getGlobalCurrencySign = function(currencyCode) {


/**
* Deprecated.
* Local currency pattern is the most frequently used pattern in currency's
* native region. It does not care about how it is distinguished from other
* currencies.
*
* @param {string} currencyCode ISO-4217 3-letter currency code.
* @return {string} Local currency pattern string for given currency.
* @deprecated Format numbers using {@link goog.i18n.NumberFormat} with
* {@link goog.i18n.NumberFormat.Format.CURRENCY} and
* {@link goog.i18n.NumberFormat.CurrencyStyle.LOCAL}
*/
goog.i18n.currency.getLocalCurrencyPattern = function(currencyCode) {
var info = goog.i18n.currency.CurrencyInfo[currencyCode];
Expand All @@ -145,6 +168,7 @@ goog.i18n.currency.getLocalCurrencySign = function(currencyCode) {


/**
* Deprecated.
* Portable currency pattern is a compromise between local and global. It is
* not a mere blend or mid-way between the two. Currency sign is chosen so that
* it looks familiar to native users. It also has enough information to
Expand All @@ -154,6 +178,9 @@ goog.i18n.currency.getLocalCurrencySign = function(currencyCode) {
*
* @param {string} currencyCode ISO-4217 3-letter currency code.
* @return {string} Portable currency pattern string for given currency.
* @deprecated Format numbers using {@link goog.i18n.NumberFormat} with
* {@link goog.i18n.NumberFormat.Format.CURRENCY} and
* {@link goog.i18n.NumberFormat.CurrencyStyle.PORTABLE}
*/
goog.i18n.currency.getPortableCurrencyPattern = function(currencyCode) {
var info = goog.i18n.currency.CurrencyInfo[currencyCode];
Expand All @@ -174,12 +201,17 @@ goog.i18n.currency.getPortableCurrencySign = function(currencyCode) {


/**
* This function returns the default currency sign position. Some applications
* This function returns the default currency sign's position. Some applications
* may want to handle currency sign and currency amount separately. This
* function can be used in such situations to correctly position the currency
* sign relative to the amount.
*
* To match the behavior of ICU, position is not determined by display locale.
* Use {@link goog.i18n.NumberFormat#isCurrencyCodeBeforeValue} for a locale
* aware version of this API (recommended). isPrefixSignPosition() returns the
* default currency sign's position in the currency's default locale (e.g. 'en'
* for 'USD'), but most commonly the position is needed for the locale in which
* the number is going to be displayed. For example, in 'fr' 10.10 USD would be
* displayed as '10,10 $'.
*
* @param {string} currencyCode ISO-4217 3-letter currency code.
* @return {boolean} true if currency should be positioned before amount field.
Expand Down Expand Up @@ -267,6 +299,10 @@ goog.i18n.currency.adjustPrecision = function(pattern, currencyCode) {
* 18: two decimals precision (2), currency sign last (16), no space (0)
* 50: two decimals precision (2), currency sign last (16), space (32)
*
* It's not recommended to read this data directly. Format numbers using
* {@link goog.i18n.NumberFormat} with
* {@link goog.i18n.NumberFormat.Format.CURRENCY} instead.
*
* @const {!Object<!Array<?>>}
*/
goog.i18n.currency.CurrencyInfo = {
Expand Down Expand Up @@ -310,7 +346,7 @@ goog.i18n.currency.CurrencyInfo = {
'NOK': [50, 'kr', 'NOkr'],
'PAB': [2, 'B/.', 'B/.'],
'PEN': [2, 'S/.', 'S/.'],
'PHP': [2, '\u20B1', 'Php'],
'PHP': [2, '\u20B1', 'PHP'],
'PKR': [0, 'Rs', 'PKRs.'],
'PLN': [50, 'z\u0142', 'z\u0142'],
'RON': [2, 'RON', 'RON'],
Expand All @@ -334,6 +370,11 @@ goog.i18n.currency.CurrencyInfo = {

/**
* Tier 2 currency information.
*
* It's not recommended to read this data directly. Format numbers using
* {@link goog.i18n.NumberFormat} with
* {@link goog.i18n.NumberFormat.Format.CURRENCY} instead.
*
* @const {!Object<!Array<?>>}
*/
goog.i18n.currency.CurrencyInfoTier2 = {
Expand Down Expand Up @@ -431,7 +472,7 @@ goog.i18n.currency.CurrencyInfoTier2 = {
'XAF': [0, 'FCFA', 'FCFA'],
'XCD': [2, '$', 'EC$'],
'XOF': [0, 'CFA', 'CFA'],
'XPF': [0, 'FCFP', 'FCFP'],
'XPF': [48, 'FCFP', 'FCFP'],
'ZMW': [0, 'ZMW', 'ZMW'],
'ZWD': [0, '$', 'Z$']
};
Loading