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

Problems with "language-region" locale identifier #21

Open
rubas opened this issue Oct 17, 2024 · 0 comments
Open

Problems with "language-region" locale identifier #21

rubas opened this issue Oct 17, 2024 · 0 comments

Comments

@rubas
Copy link
Contributor

rubas commented Oct 17, 2024

Kip, your ongoing maintenance of the CLDR-related libraries is truly invaluable to the Elixir community. Thank you so much ❤️


Problem: Route Generation

Verified routes with mix phx.routes Application.Router

If I enable the locales: en-CH de-CH fr-CH, I only get routes for /en/...

If I enable the locales en-CH de, I get routes for /en/... and /de/...

Problem: Mismatch CLDR <> Gettext

I'm unsure, how to make everything work.

Mismatch

There is mismatch between CDLR (de-CH) and Gettext(de_CH), this creates issue with Cldr.Plug.PutLocale ([warning] Locale "de-CH" does not have a known Gettext locale. No Gettext locale has been set.

iex(1)> Gettext.put_locale(Application.Gettext, "de-CH")
nil
iex(2)> Gettext.put_locale(Application.Gettext, "de_CH")
"de-CH"

Recognition

As it's not working yet, I couldn't test it. But I'm wondering, if /de would match the correctly to de_CH or not.


Details

default_locale: "de-CH",
enabled_locales: ~w(de-CH en-CH fr-CH)

---

plug Cldr.Plug.PutLocale,
  apps: [:cldr, :gettext],
  from: [:route],
  gettext: BookingWeb.Gettext,
  cldr: Booking.Cldr

plug Cldr.Plug.PutSession, as: :string

---

Generating Application.Cldr for 7 locales named [:de, :"de-CH", :en, :"en-CH", :fr, ...] with a default locale named :"de-CH"
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

1 participant