How to I18n content which is dynamically loaded via javascript (assets)?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to I18n content which is dynamically loaded via javascript (assets)?

JuliusR
Suppose there is some content which is added dynamically by javascript because it provides javascript functionality only. As an example, I could imagine some buttons to sort a table with the help of js like in https://github.com/foodcoop-rostock/foodsoft/blob/improve-delivery-workflow-further/app/assets/javascripts/application.js#L135 .

How to handle these expressions correctly? I guess the code should be moved to a place where embedded ruby is allowed, but I could not find an example.
Reply | Threaded
Open this post in threaded view
|

Re: How to I18n content which is dynamically loaded via javascript (assets)?

fsmanuel
Administrator
we can use:

it converts the locale files to js. In JS you can do I18n.t('key')…



Am 14.06.2013 um 12:51 schrieb "JuliusR [via foodsoft]" <[hidden email]>:

Suppose there is some content which is added dynamically by javascript because it provides javascript functionality only. As an example, I could imagine some buttons to sort a table with the help of js like in https://github.com/foodcoop-rostock/foodsoft/blob/improve-delivery-workflow-further/app/assets/javascripts/application.js#L135 .

How to handle these expressions correctly? I guess the code should be moved to a place where embedded ruby is allowed, but I could not find an example.


If you reply to this email, your message will be added to the discussion below:
http://foodsoft.51229.x6.nabble.com/How-to-I18n-content-which-is-dynamically-loaded-via-javascript-assets-tp75.html
To start a new topic under foodsoft-dev, email [hidden email]
To unsubscribe from foodsoft-dev, click here.
NAML