Rails: Internationalization of Javascript Strings?

前端 未结 10 1435
你的背包
你的背包 2020-12-07 10:45

So, we have an existing Rails 2.3.5 app that does not support Internationalization at all. Now, I\'m well familiar with Rails I18n stuff, but we have a LOT of output strings

10条回答
  •  青春惊慌失措
    2020-12-07 10:54

    Ryan solution is brillant. But to not include the entire file you should use: @translations[I18n.locale].with_indifferent_access["alpha"] instead of I18n.backend.send(:translations)["alpha"]

提交回复
热议问题