Ticket #5769 (closed enhancement: fixed)

Opened 1 year ago

Last modified 11 months ago

TinyMCE 3.0 Translation update

Reported by: azaozz Assigned to: ryan
Priority: high Milestone: 2.5
Component: TinyMCE Version:
Severity: normal Keywords: has-patch i18n
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

tmce-translation.patch (51.8 kB) - added by azaozz on 02/08/08 07:07:58.
wp-langs.php.r6883.patch (0.9 kB) - added by rnt on 02/17/08 18:56:35.
Correct a string

Change History

(follow-up: ↓ 3 ) 02/07/08 23:23:14 changed by nbachiyski

  • keywords changed from has-patch to has-patch i18n.
  • priority changed from normal to 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.

02/08/08 00:01:32 changed by ryan

  • owner changed from anonymous to ryan.

(in reply to: ↑ 1 ) 02/08/08 03:00:48 changed by azaozz

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() ).

02/08/08 07:07:44 changed by azaozz

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.

02/08/08 07:07:58 changed by azaozz

  • attachment tmce-translation.patch added.

02/09/08 06:43:15 changed by ryan

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

02/13/08 18:33:35 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

02/17/08 18:56:35 changed by rnt

  • attachment wp-langs.php.r6883.patch added.

Correct a string

(follow-up: ↓ 8 ) 02/18/08 02:35:17 changed by rnt

  • status changed from closed to reopened.
  • resolution deleted.

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

(in reply to: ↑ 7 ) 02/18/08 08:46:38 changed by azaozz

Replying to rnt:

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

Yes, there's a typo.

02/18/08 17:07:23 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

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