elixir-cldr / cldr

Elixir implementation of CLDR/ICU
Other
447 stars 33 forks source link

Don't fall back to language-only locale #129

Closed kipcole9 closed 4 years ago

kipcole9 commented 5 years ago

Consider disallowing fallback from "en-US" to "en" -> that is, do not fall back to the language specific locale.

This would be a configuration option on the backend module. Maybe something like:

defmodule MyApp.Cldr do
  use Cldr,
    fallback: :language,   # Fallback to the language locale, ie. en-US validates as en if en-US is not configured. This is the current behaviour
    fallback: :default, # Fallback to the default locale
    fallback: :none, # No fallbacks
    fallback: [:language, :default]  # Fall back to :language first, then the default

end
kipcole9 commented 4 years ago

Closing for now there being no known compelling reason to move forward with this.