Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#5769 closed enhancement (fixed)

TinyMCE 3.0 Translation update

Reported by: azaozz Owned by: ryan
Priority: high Milestone: 2.5
Component: TinyMCE Version:
Severity: normal Keywords: has-patch i18n
Cc: Focuses:

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)

tmce-translation.patch​ (51.8 KB ) - added by azaozz 19 years ago.
wp-langs.php.r6883.patch​ (929 bytes ) - added by rnt 19 years ago.
Correct a string

Download all attachments as: .zip

Change History (11)

#1 follow-up: @nbachiyski
19 years ago

  • Keywords i18n added
  • Priority normal → high

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.

#2 @ryan
19 years ago

  • Owner changed from anonymous to ryan

#3 in reply to: ↑ 1 @azaozz
19 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 @azaozz
19 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.

#5 @ryan
19 years ago

(In [6765]) gettext for tinymce strings. Props azaozz. see #5769

#6 @ryan
19 years ago

  • Resolution → fixed
  • Status new → closed

@rnt
19 years ago

Correct a string

#7 follow-up: @rnt
19 years ago

  • Resolution fixed
  • Status closed → reopened

check the string in trunk/wp-includes/js/tinymce/langs/wp-langs.php:383

#8 in reply to: ↑ 7 @azaozz
19 years ago

Replying to rnt:

check the string in trunk/wp-includes/js/tinymce/langs/wp-langs.php:383

Yes, there's a typo.

#9 @ryan
19 years ago

  • Resolution → fixed
  • Status reopened → closed

(In [6893]) Fix TinyMCE translation typo. Props rnt. fixes #5769

Note: See TracTickets for help on using tickets.