From 4400fe6e325efd594c60e2260911dbfc4ec5b8c4 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 26 Mar 2007 22:05:36 +0000 Subject: [PATCH] Fallback to loading english for tinyMCE if requested locale is not there. see #3882 git-svn-id: http://svn.automattic.com/wordpress/trunk@5114 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/tinymce/tiny_mce_gzip.php | 18 +++++++++++++++--- wp-includes/script-loader.php | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/tinymce/tiny_mce_gzip.php b/wp-includes/js/tinymce/tiny_mce_gzip.php index d3d7c7949c..59af4b6b5c 100644 --- a/wp-includes/js/tinymce/tiny_mce_gzip.php +++ b/wp-includes/js/tinymce/tiny_mce_gzip.php @@ -119,23 +119,35 @@ if ($index > -1) { $content .= "tinyMCECompressed.loadPlugins();"; // Add core languages + $lang_content = ''; foreach ($languages as $lang) - $content .= getFileContents("langs/" . $lang . ".js"); + $lang_content .= getFileContents("langs/" . $lang . ".js"); + if ( empty($lang_content) ) + $lang_content .= getFileContents("langs/en.js"); + $content .= $lang_content; // Add themes foreach ($themes as $theme) { $content .= wp_compact_tinymce_js(getFileContents( "themes/" . $theme . "/editor_template" . $suffix . ".js")); + $lang_content = ''; foreach ($languages as $lang) - $content .= getFileContents("themes/" . $theme . "/langs/" . $lang . ".js"); + $lang_content .= getFileContents("themes/" . $theme . "/langs/" . $lang . ".js"); + if ( empty($lang_content) ) + $lang_content .= getFileContents("themes/" . $theme . "/langs/en.js"); + $content .= $lang_content; } // Add plugins foreach ($plugins as $plugin) { $content .= getFileContents("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js"); + $lang_content = ''; foreach ($languages as $lang) - $content .= getFileContents("plugins/" . $plugin . "/langs/" . $lang . ".js"); + $lang_content .= getFileContents("plugins/" . $plugin . "/langs/" . $lang . ".js"); + if ( empty($lang_content) ) + $lang_content .= getFileContents("plugins/" . $plugin . "/langs/en.js"); + $content .= $lang_content; } // Add custom files diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 625ec296cc..20dadfd13a 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -15,7 +15,7 @@ class WP_Scripts { $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' ); $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' ); $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); - $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070325' ); + $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20070326' ); $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20070225' ); $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0-0');