Open drewchandler opened 11 years ago
It should work in master.
@berk @drewchandler How I can translate Javascript strings?
I have following one option regarding javascript in config.yml which I have already enabled. enable_client_sdk: true # allows javascript to use tr8nProxy object
When I try to translate any javascript string like: taskNames = -> d = new Date() weekday = new Array(7) weekday[0] = tr("Sunday") weekday[1] = tr("Monday") weekday[2] = tr("Tuesday") weekday[3] = tr("Wednesday") weekday[4] = tr("Thursday") weekday[5] = tr("Friday") weekday[6] = tr("Saturday") Then tr8n adds keys for all above weekdays but does not translate these days.
Any Idea?
Results in something like:
As you can see, only the first one is translated.
The md5 of the key and description is used as an id for a tr8n element. The above example will result in 2 elements with the same id. In the javascript, when the translations come back from the server, since we find elements needing translations using the id, we will only see the first element.