From 5ab50ba7d5bca778d86aa45d4df6f90ec4b3f267 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 14 Apr 2014 03:23:15 +0000 Subject: [PATCH] TinyMCE: Always load translations, even in English, as we modify some strings. Move a setting to after the translations filter, and remove unused strings. see #24067. Built from https://develop.svn.wordpress.org/trunk@28112 git-svn-id: http://core.svn.wordpress.org/trunk@27943 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-editor.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 68fbfeb497..3298cc700f 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -754,13 +754,6 @@ final class _WP_Editors { // Default TinyMCE strings 'New document' => __( 'New document' ), 'Formats' => _x( 'Formats', 'TinyMCE' ), - 'Headers' => _x( 'Headings', 'TinyMCE' ), - 'Header 1' => __( 'Heading 1' ), - 'Header 2' => __( 'Heading 2' ), - 'Header 3' => __( 'Heading 3' ), - 'Header 4' => __( 'Heading 4' ), - 'Header 5' => __( 'Heading 5' ), - 'Header 6' => __( 'Heading 6' ), 'Headings' => _x( 'Headings', 'TinyMCE' ), 'Heading 1' => __( 'Heading 1' ), @@ -983,11 +976,6 @@ final class _WP_Editors { $baseurl = self::$baseurl; $mce_locale = self::$mce_locale; - // Set direction - if ( is_rtl() ) { - $mce_translation['_dir'] = 'rtl'; - } - /** * Filter translated strings prepared for TinyMCE. * @@ -1004,6 +992,11 @@ final class _WP_Editors { } } + // Set direction + if ( is_rtl() ) { + $mce_translation['_dir'] = 'rtl'; + } + return "tinymce.addI18n( '$mce_locale', " . json_encode( $mce_translation ) . ");\n" . "tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\n"; } @@ -1097,8 +1090,7 @@ final class _WP_Editors { echo "\n"; } - if ( 'en' != self::$mce_locale ) - echo "\n"; + echo "\n"; if ( self::$ext_plugins ) { // Load the old-format English strings to prevent unsightly labels in old style popups