linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Allow to pass locales as atoms to MemorizedVocabulary

Open dolfinus opened this issue 4 years ago • 0 comments

Hello.

I've already fixed passing locales as atoms into t! and t functions: #30 But MemorizedVocabulary module does not check locale before saving it to :ets. So you can easily add call locale(:en, ...), but then you cannot call t(:en, "path") because locale here is checked with normalize_locale function which accepts only strings.

What I've changed::

  1. Added locale name normalization step to locale/2 function
  2. Allowed to pass atom locales into normalize_locale/1 function
  3. Added few tests for this case

dolfinus avatar Mar 21 '21 10:03 dolfinus