Opened 13 years ago
Last modified 22 months ago
#417 accepted defect
JavaScripts and WTForms messages are not translated
Reported by: | Jakob Kramer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | programming | Keywords: | |
Cc: | Parent Tickets: |
Description
The strings in the JavaScripts (e. g. show_password.js
) and the !WTForms messages (e. g. “Invalid Input”) cannot be translated right now.
Change History (9)
comment:1 by , 13 years ago
comment:2 by , 12 years ago
Component: | component1 → programming |
---|
comment:3 by , 12 years ago
Owner: | removed |
---|---|
Status: | new → assigned |
comment:4 by , 12 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:5 by , 12 years ago
I added the appropriate translation tags where I had text displayed in what I was working on for in #492.
comment:6 by , 12 years ago
Keywords: | review added |
---|
comment:7 by , 12 years ago
Keywords: | review removed |
---|
I've looked at the work done for #453; as said there, the javascript stuff isn't really translated via that method, since it doesn't pass through jinja2.
I think this requires some extra thinking about how to do translations for javascript. One option is that the browser can pull down .mo files and read and parse them in-browser, but that seems kind of strange.
Some suggestions:
- We can try to avoid using translatable strings as much possible in JS, and use hidden fields that are translated in the browser, etc.
- We can have an additional page that serves up a big ol json document with all the relevant strings translated at a path like
/i18n-es.js
... but this is actually served (and cached) by the mediagoblin application. (It would actually be really nice if this could be rendered once and served via apache for each language somewhere, but I don't know how to do that.)
comment:8 by , 12 years ago
Owner: | removed |
---|---|
Status: | assigned → accepted |
comment:9 by , 11 years ago
Current command that generate the strings to be translated should also take care of javascript files using something like http://jsgettext.berlios.de/ and/or https://github.com/wikimedia/jquery.i18n. This process should generate two file client.po and server.po (for instance) and merge them in app.po. app.po will be submitted for translation.
Another command will take care of splitting the translated files into two .po per language one for client side consumption another for server side consumtion.
The problem with WTForms can be solved easily by translating our own strings with our own function and by using an own “Form” class.