Skip to content

localeAlias is broken #49

Open
Open
@fermmm

Description

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.

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