Rails i18n and routes in javascript

前端 未结 1 1156

Sometimes it would be really handy to have the Rails localization files available in JavaScript. Same is true for for the routes helpers.

I found these two plugins which

1条回答
  •  执念已碎
    2021-02-14 00:04

    I use the first plugin you listed (i18n-js) and recommend it highly. It does exactly what you are asking -- make localizations available to javascript -- with very little fuss.

    At its core it does two things:

    • autogenerates a messages.js file from your localization files
    • provides a Javascript API very similar to the Rails I18n API.

    You include a

提交回复
热议问题