#10749 closed defect (fixed)
`babel.Translations.load({...}).install()` from a plugin breaks the loaded translations catalog
| Reported by: | Jun Omae | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0 |
| Component: | i18n | Version: | 0.12 |
| Severity: | normal | Keywords: | |
| Cc: | ryano@… | Branch: | |
| Release Notes: |
Correctly handle multiple i18n domains in JavaScript translations. |
||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
generate_messages_js command of setuptools works for Trac and Trac plugins. The command generates "messages file for javascript" as the following;
// Generated messages javascript file from compiled MO file babel.Translations.load({"domain":"{plugin-name}-js",...}).install();
The babel.Translations.install() installs _, genetext and ngettext functions binded the loaded translations instance to window instance.
When a plugin loads the messages catalog for javascript, Therefore, it overwrites the last installed functions (maybe from trac/htdocs/messages/*.js) and messages for Trac will not be translated.
Related branches
Attachments (1)
Change History (12)
follow-up: 3 comment:2 by , 13 years ago
Looks sound. Unfortunately, I don't have a quick way to try this by myself, so feel free to apply.
comment:3 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:4 by , 13 years ago
| Owner: | set to |
|---|
by , 13 years ago
| Attachment: | Comment1.png added |
|---|
comment:5 by , 13 years ago
comment:6 by , 13 years ago
I think comment:1 contains a newline, so it isn't considered empty. (Reproduce it on the demo-0.13 site by pressing the Enter key in the comment field before submitting.)
follow-up: 10 comment:8 by , 13 years ago
comment:9 by , 13 years ago
| Cc: | added |
|---|
comment:10 by , 13 years ago
Replying to Ryan J Ollos <ryano@…>:
The behavior seems closely related to the patch in #10748, so I'll add to my todo list to handle this case as part of that patch as well.
Issue has been addressed in the following patch ticket:10748:t10748-r11103-1.patch
comment:11 by , 13 years ago
| Release Notes: | modified (diff) |
|---|



