i trying use i18n.transliterate "normalize" text accented characters can analyze , compare different languages.
however, when using method following error pops out
i18n::invalidlocale: :en not valid locale /home/xxx/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!' /home/xxx/.rvm/gems/ruby-2.1.5/gems/i18n-0.7.0/lib/i18n.rb:235:in `transliterate' (irb):2 /home/xxx/.rvm/rubies/ruby-2.1.5/bin/irb:11:in `<main>' i have made searches problem , found solutions related rails configuration. using in ruby file, nothing related rails, so... can do?
i seem have similar problem resolved inspecting source code associated error.
i found have explicitly set available locales so:
i18n.config.available_locales = :en i'm not sure if correct approach, see following achieves same effect , more robust.
Comments
Post a Comment