Skip to content
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

localeAlias is broken #49

Open
fermmm opened this issue Nov 9, 2020 · 1 comment
Open

localeAlias is broken #49

fermmm opened this issue Nov 9, 2020 · 1 comment

Comments

@fermmm
Copy link

fermmm commented Nov 9, 2020

I'm trying to make this work:

   locales(app, {
      defaultLocale: 'en',
      localeAlias: {
         es: 'es_AR',
         en: 'en_US',
      }
   });

Whatever I send in "Accept-Language" header parameter: "es", "es_AR" or "en_US" always loads the defaultLocale language, only when I completely remove localeAlias setting then I can set "es" in the header and the language changes otherwise I'm stuck with defaultLocale

It seems to be totally broken. Also what happens if I want 2 aliases for "es"?, since it's not possible to repeat keys in an object, maybe I should invert key values but that doesn't work and it's not how it's documented in the readme.

@chinfeng
Copy link

Same for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants