-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom i18n locales names #17163
Comments
Language tags are a standardized format with each subtag expressing specific meaning. The Angular and the Angular CLI support a commonly used set of the subtags. Each subtag can have an effect on the behavior of the application and invalid tags may cause runtime errors or invalid localization data to be used (leading to potential incorrect currency, number separators, etc.). This is especially true with browser APIs that can leverage the tags. To enabled the above use case, support could be added for private use subtags which are part of the standardized format. This will allow for the creation of valid tags containing the custom information. However, this will require a change to each tag to become conformant. Private use subtags must be at the end of the tag. They begin with |
@clydin Thanks, sounds good enough for me :) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🚀 Feature request
Command (mark with an
x
)Description
Hi, I'm sorry in advance. Wasn't sure where should I open issue in Angular repo or here + not sure if it is a bug or feature request :)
Anyway here is the thing:
In our project, we use i18n in a bit different way. We have 13 variations of our app. They share the same core and logic, but the logo, design, and content is different. So we not translating with i18n, but using it to deliver different options of content (for example in one website the welcome message will be 'Welcome customer' and in another, it will be 'Welcome dear partner').
Now we are updating to angular 9 and we are very excited that we won't need to build 13 times, but only once. We started to make a POC, and turns out that in
angular.json
the keyi18n.locales
have a regex pattern of^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,20})?$
according to./node_modules/@angular/cli/lib/config/schema.json
. Our translation for today is smth likeen-corporate
,en-private
,en-pb
. So whileen-private
would work two another wouldnt. I understand that it is not a scenario that you built it for. But is there a solution that we could use without renaming? Is it possible to disable regex validation somehow?Describe the solution you'd like
To be able to use custom locale names or to disable pattern validation
The text was updated successfully, but these errors were encountered: