Rails I18n not working properly on Heroku -



Rails I18n not working properly on Heroku -

i18n works expected locally not on heroku. shows english language if browser set pt-br. set locale in before filter:

class applicationcontroller < actioncontroller::base before_filter :set_locale private def set_locale i18n.set_preferred_locale(env.http_accept_language) end end module i18n class << self def set_preferred_locale(http_accept_language) locale = http_accept_language.preferred_language_from(i18n.available_locales) if locale.present? i18n.locale = locale i18n.default_locale = locale #added based on stackflow reply heroku , i18n end end end end

i have confirmed through logger i18n.locale has right value (pt-br) in views translations still coming in english.

i have tried test setting straight 'pt-br' , still same result:

class applicationcontroller < actioncontroller::base before_filter :set_locale private def set_locale i18n.locale = 'pt-br' end end

turns out setting fine. issue there byte order mark in pt-br.yml. apparently heroku can't load language files them - heroku not loading language file.

i used vim remove marker with:

:set nobomb :w

ruby-on-rails heroku rails-i18n

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -