Rails [已解决] 如何在 JS 文件里面使用 I18n 呢

zhbinx · January 08, 2013 · Last by zhbinx replied at January 08, 2013 · 4433 hits

比如 js 有个方法…… function () { return "not found"; } 我咋对 not found 用上 I18n…… 试了下function () { return "<%=t('not_found')%>"; }不行……

自问自答: 这个可以,而且很简单 https://github.com/fnando/i18n-js

You need to Sign in before reply, if you don't have an account, please Sign up first.