Language support for TinyMCE. Props capt_kirk and Stephen Chu. fixes #2476

git-svn-id: http://svn.automattic.com/wordpress/trunk@3623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-03-06 22:51:28 +00:00
parent b8bbbd656e
commit 14ece75d6f
1 changed files with 22 additions and 5 deletions

View File

@ -76,15 +76,32 @@
// Load theme, language pack and theme language packs
$theme = apply_filters('mce_theme', 'advanced');
echo wp_compact_tinymce_js(file_get_contents(realpath("themes/" . $theme . "/editor_template.js")));
echo wp_translate_tinymce_lang(file_get_contents(realpath("themes/" . $theme . "/langs/en.js")));
echo wp_translate_tinymce_lang(file_get_contents(realpath("langs/en.js")));
// Get the WordPress locale
$locale = get_locale();
$themeLanguageFile = realpath("themes/" . $theme . "/langs/" . $locale . ".js");
if (!file_exists($themeLanguageFile))
$themeLanguageFile = realpath("themes/" . $theme . "/langs/en.js");
echo wp_translate_tinymce_lang(file_get_contents($themeLanguageFile));
$tinymceLanguageFile = realpath("langs/" . $locale . ".js");
if (!file_exists($tinymceLanguageFile))
$tinymceLanguageFile = realpath("langs/en.js");
echo wp_translate_tinymce_lang(file_get_contents($tinymceLanguageFile));
// Load all plugins and their language packs
$plugins = apply_filters('mce_plugins', array('wordpress', 'autosave', 'wphelp'));
$plugins = apply_filters('mce_plugins', array('wordpress', 'autosave','wphelp'));
foreach ($plugins as $plugin) {
$pluginFile = realpath("plugins/" . $plugin . "/editor_plugin.js");
$languageFile = realpath("plugins/" . $plugin . "/langs/en.js");
$languageFile = realpath("plugins/" . $plugin . "/langs/" . $locale . ".js");
if (!file_exists($languageFile))
$languageFile = realpath("plugins/" . $plugin . "/langs/en.js");
if ($pluginFile)
echo file_get_contents($pluginFile);