Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrew Ozz

    (@azaozz)

    This plugin adds only default TinyMCE plugins. As of version 4.0 these plugins don’t include separate translation files, all strings are in the main TinyMCE translation. This is included in WordPress, except for the Link popup, see https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/class-wp-editor.php#L751.

    Best would be if custom TinyMCE plugins can reuse these strings as they are translated with WordPress in all languages and always present. If that is not possible, the functionality to load a language file is the same as in WP 3.8: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/class-wp-editor.php#L366

    If the filter 'mce_external_languages' is not used WP will look for translations in a /langs/ subdirectory. Then if a language file for the current locale is not present, it will look for and load en.js.

    Oh yeah, it does look like all the standard TinyMCE options are translated via GlotPress. I think this wasn’t the case with WP 3.8 and earlier, but now it seems all should be translated with no [lang].js needed. The Polish translation of WP will ship within days so I will get back to you on this and mark as resolved if that’s the case.

    If the filter ‘mce_external_languages’ is not used WP will look for translations in a /langs/ subdirectory. Then if a language file for the current locale is not present, it will look for and load en.js.

    Not sure about this one, I currently have pl.js (100% translation) downloaded from the TinyMCE website in /langs/ and it doesn’t load even though get_locale() returns pl_PL and $mce_locale (or whatever it was called) returns ‘pl’. This is rather WP-related so I’m not going to bug you with it here, but if you ever come across it, please test it (WP_LANG=’pl_PL’ and uploading pl.js will suffice to test this).

    Thanks Andrew for your time on this issue and for your core and plugins development!

    Plugin Author Andrew Ozz

    (@azaozz)

    Ah, I understand better now 🙂

    The above is when creating a custom TinyMCE plugin. For core, WP always outputs the “main” translation for TinyMCE and sets that translation is loaded (so TinyMCE doesn’t try to load non-existing files). That’s why it won’t load another langs/[locale].js file.

    I can confirm that the translations work!
    The title attribute on “non-breaking space” button is not translated, but if I enable the dropdown menus, the Insert -> “non-breaking space” text IS translated. Conclusion: the title attr for the nbsp button is not using the translation, which I think you could fix easily.
    Aside from that, thanks for your help.
    Marking as resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translations not working?’ is closed to new replies.