Repository: angular
Issue: Use platform `Intl` APIs in Angular's i18n subsystem
Labels: area: i18n

In 2017 (#18284), it was chosen to drop the `Intl` API in favor of custom i18N data extracted from the CLDR (`@angular/common/locales/...`. 

Since then the `Intl` API has matured a lot and is now able to cover the feature provided by the framework. 

Replacing the legacy i18n implementation with the `Intl` API is move to shift the localisation responsability from the framework to the platform (browsers, Node or Cloud workers). 

### Benefits of switching to an `Intl` implementation
Replacing the legacy implementation with data from locale files with the an `Intl` based implementation has several benefits. 
* No need to import locale files to add support for additional languages (default was only english) 
* Bundle size improvements
* Support for extended locales which allow specifying numbering system, calendar extension etc (ie `fa-AF-u-nu-latn` specifies  Persian, Afghanistan,Western Digits).
* Support for IANA timezones when formating dates

### Deprecations 
This will lead to the deprecation of the following locale getters : 

* `getCurrencySymbol(code: string, format: 'wide' | 'narrow', locale?: string)`
* `getLocaleCurrencyCode(locale: string)`
* `getLocaleCurrencyName(locale: string)`
* `getLocaleCurrencySymbol(locale: string)`
* `getLocaleDateFormat(locale: string, width: FormatWidth)`
* `getLocaleDateTimeFormat(locale: string, width: FormatWidth)`
* `getLocaleDayNames(locale: string, formStyle: FormStyle, width: TranslationWidth)`
* `getLocaleDayPeriods(locale: string, formStyle: FormStyle, width: TranslationWidth)`
* `getLocaleDirection(locale: string)`
* `getLocaleEraNames(locale: string, width: TranslationWidth)`
* `getLocaleExtraDayPeriodRules(locale: string): (Time | [Time, Time])`
* `getLocaleExtraDayPeriods(locale: string, formStyle: FormStyle, width: TranslationWidth)`
* `getLocaleFirstDayOfWeek(locale: string)`
* `getLocaleId(locale: string)`
* `getLocaleMonthNames(locale: string, formStyle: FormStyle, width: TranslationWidth)`
* `getLocaleNumberFormat(locale: string, type: NumberFormatStyle)`
* `getLocaleNumberSymbol(locale: string, symbol: NumberSymbol)`
* `getLocalePluralCase: (locale: string) => (value: number)`
* `getLocaleTimeFormat(locale: string, width: FormatWidth)`
* `getLocaleWeekEndRange(locale: string)`
* `getNumberOfCurrencyDigits(code: string)`

Those functions, barring exceptions mentioned below, should be replacing by using the `Intl` API with `Intl.formatNumber`, `Intl.formatDate`, `Intl.Plural`. 

#### Getters with none/partial replacements : 

* `getLocaleWeekEndRange` & `getLocaleFirstDayOfWeek` : [`Intl.getWeekInfo()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo) not supported by Firefox (122 ATM) 
* * Alternatives
* * * [`luxon`](https://moment.github.io/luxon/api-docs) falls back to the ISO week definition (starts on monday, 4 days in week for the week year). 
* * * [`day.js`](https://day.js.org/docs/en/i18n/i18n) Provides locale data for `yearStart` and `weekStart` but not the weekend range
* * * [`date-fns`](https://date-fns.org/v3.3.1/docs) Provides locale data `weekStartsOn` & `firstWeekContainsDate` but not the weekend range.
*  `getLocaleDirection` : [`Intl.getTextInfo()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo) not supported by Firefox (122 ATM)
* * Alternative : [`rtl-detect`](https://www.npmjs.com/package/rtl-detect) 
* `getLocaleCurrencySymbol`/`getLocaleCurrencyCode`: We recommend developers fully drop this function as currencies shouldn’t be determined from a locale. 


### Rolout plan
The feature will be enabled by default for new projects and opt-out on existing project when migrated with `ng update`. 

Schedule TBD. 

### Related PRs
* #54483
* #55283 

### Related issues 

* angular/angular#20487
* angular/angular#33803 
* angular/angular#39606
* angular/angular#42315
* angular/angular#48279
* angular/angular#48697
* angular/angular#49143
* angular/angular#49540
* angular/angular#52177
* angular/angular#54114
* angular/angular#54320

#### Components 
* angular/components#23073