From 02e94f35b6c3173b01dd732ba3221489eb47288a Mon Sep 17 00:00:00 2001 From: Phil Brown Date: Fri, 27 Nov 2015 16:24:14 +1100 Subject: [PATCH] feat($locale): Include original locale ID in $locale Most systems use *IETF language tag* codes which are typically a combination of the ISO 639 language code and ISO 3166-1 country code with an underscore or hyphen delimiter. For example `en_US`, `en_AU`, etc. Whilst the `$locale.id` comes close, the lowercase format makes it impossible to transform to an IETF tag reliably. For example, it would be impossible to deduce `en_Dsrt_US` from `en-dsrt-us`. It would be very handy for communicating with external systems to be able to pass the IETF tag format, at least with the character casing intact. --- i18n/src/closureI18nExtractor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/i18n/src/closureI18nExtractor.js b/i18n/src/closureI18nExtractor.js index c5d1b0d2de87..427a5b0b9114 100644 --- a/i18n/src/closureI18nExtractor.js +++ b/i18n/src/closureI18nExtractor.js @@ -161,6 +161,7 @@ function outputLocale(localeInfo, localeID) { if (!localeObj.DATETIME_FORMATS) { localeObj.DATETIME_FORMATS = fallBackObj.DATETIME_FORMATS; } + localeObj.localeID = localeID; localeObj.id = correctedLocaleId(localeID); var getDecimals = [