elixir-cldr / cldr

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

Fix typespec and don't log warning if no matching locale was found #147

Closed adriankumpf closed 3 years ago

adriankumpf commented 3 years ago

This MR …

If the latter is not desired, I would suggest making the log level configurable so that the user of this library can decide whether errors are logged.

kipcole9 commented 3 years ago

Thanks very much for the PR. My thinking behind logging the "no match" is primarily that if there is a community of users consistently requesting a locale that is not supported then the app team might consider implementing that locale. For that reason I would prefer a configurable log level to that reducing the noise to zero is also an option.

kipcole9 commented 3 years ago

I've published ex_cldr version 2.22.0 with the following changelog entry:

Soft deprecation

Bug Fixes

Enhancements

Revised Plug.Cldr.AcceptLanguage Options

* `:cldr_backend` is any backend module. The default
  is `Cldr.default_backend/0`. If no `:cldr_backend`
  option is provided and no default backend is configured
  then an exception will be raised.

* `:no_match_log_level` determines the logging level for
  the case when no matching locale is configured to meet the users
  request. The default is `:warn`. If set to `nil` then no logging
  is performed.
adriankumpf commented 3 years ago

Thanks!