#5769 closed enhancement (fixed)
TinyMCE 3.0 Translation update
Reported by: | azaozz | Owned by: | ryan |
---|---|---|---|
Milestone: | 2.5 | Priority: | high |
Severity: | normal | Version: | |
Component: | TinyMCE | Keywords: | has-patch i18n |
Focuses: | Cc: |
Description
The internal translation functions in TinyME 3.0 have changed a bit, complicating the existing translation functionality for WordPress.
This patch adds all strings from TinyMCE's [lang].js and [lang]_dlg.js files in a single wp-langs.php file, so it can be included in the main .pot file and translated by WordPress' standard translation functions (similarly to the other js translations).
The output from this file is added directly into the gzip compressor for TinyMCE, so when TinyMCE initializes, all strings are already translated and loaded.
The only possible drawback is that wp-langs.php will have to be maintained, however the translation strings in TinyMCE don't change much. They may eventually change when a new major version is released and since v 3.0 just came out, it will be at least a year - year and a half before then. (I've also made a small script to check for new/missing strings that can be run after each TinyMCE upgrade in WordPress.)
Attachments (2)
Change History (11)
#3
in reply to:
↑ 1
@
16 years ago
Replying to nbachiyski:
Just one note: why aren't you escaping the original strings? IMHO you'd better put real new lines in the translatable strings and let
js_escape
do its work. Thus the strings will look more natural to translators.
I've copied them from the different en.js files, so the English version is ready for javascript. Also edited the 2 strings to shorten them and removed the breaks (breaks can be used in the translations as they will run through js_escape() ).
#4
@
16 years ago
Rechecked all strings again: $str == js_escape($str) is true, no need to run the English version through it, but if you prefer, we will put it back in. Also added couple more comments to better explain the purpose of few strings.
#7
follow-up:
↓ 8
@
16 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
check the string in trunk/wp-includes/js/tinymce/langs/wp-langs.php:383
I like the patch. Although I am not a great fan of hard coding the strings, it seems a pretty reasonable compromise.
It would be nice if this one gets sooner in core, so that we can arrange enough testing with the translators.
Just one note: why aren't you escaping the original strings? IMHO you'd better put real new lines in the translatable strings and let
js_escape
do its work. Thus the strings will look more natural to translators.