Skip to content

Custom i18n locales names #17163

@vltansky

Description

@vltansky

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

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 key i18n.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 like en-corporate, en-private, en-pb. So while en-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions