Skip to content

Unable to use uncommon ISO localisation subtags #52177

@peteduel

Description

@peteduel

Which @angular/* package(s) are the source of the bug?

localize

Is this a regression?

No

Description

When setting locales it appears that only common subtags are accepted, en-US, en-CA etc:

https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

Anything else is rejected with a not found error message, but should say something like "only stdlib ISO codes":

Locale data for 'en-pirate' cannot be found. Using locale data for 'en'.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

$ npx ng build app --localize --build-optimizer --configuration=production
...
Locale data for 'en-pirate' cannot be found. Using locale data for 'en'.

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 16.2.3
Node: 18.15.0
Package Manager: npm 9.5.0
OS: darwin x64

Angular: undefined
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1602.4
@angular-devkit/core         16.2.4
@angular-devkit/schematics   16.2.3
@schematics/angular          16.2.3

Anything else?

Initially would prefer to be able to use a third segment:
en-US-pirate

Perhaps everything after the first 2 segments can be loosely validated?

Metadata

Metadata

Assignees

Labels

area: i18nIssues related to localization and internationalization

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions