Method: I18n::Inflector::API_Strict#prep_locale
- Defined in:
- lib/i18n-inflector/api_strict.rb
#prep_locale(locale = nil) ⇒ Symbol (protected)
Note:
If the locale
is not correct, it tries to use locale from I18n.locale and validates it as well.
Processes locale
identifier and validates whether it’s correct (not empty and not nil
).
653 654 655 656 657 |
# File 'lib/i18n-inflector/api_strict.rb', line 653 def prep_locale(locale=nil) locale ||= I18n.locale raise I18n::InvalidLocale.new(locale) if locale.to_s.empty? locale.to_sym end |