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

Allow to pass locales as atoms to MemorizedVocabulary #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dolfinus
Copy link
Contributor

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 dolfinus mentioned this pull request Apr 5, 2021
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

Successfully merging this pull request may close these issues.

1 participant