Opened 17 years ago
Closed 17 years ago
#3989 closed defect (bug) (fixed)
TinyMCE default language fails when get_locale() is empty for external plugins
Reported by: | ev3rywh3re | Owned by: | |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | 2.1.2 |
Component: | TinyMCE | Keywords: | tinymce, l10n |
Focuses: | Cc: |
Description
I know there is probably an easy solution here, and it may my own fault for not following some proper guideline for language files.
When loading an external plugin that does not reside in /wp-includes/js/tinymce/plugins/ using a TinyMCE JS init something like:
plugins : "-g2image" tinyMCE.loadPlugin('g2image', 'http://wierdplacefortinymceplugin.com/g2image/');
Language files for external plugins seem to be ignored if get_locale() returns a blank to the "language :" TinyMCE init in tiny_mce_config.php.
Here is a filtered work-around that works (NOT a PATCH):
function tinymce_locale_fix($locale) { if (strstr($_SERVER['REQUEST_URI'], 'tiny_mce_config')) { if ( $locale == '' ) { $locale = 'EN'; } } return $locale; } add_filter('locale', 'tinymce_locale_fix');
If you give the TinyMCE initArray a proper language it works. I don't really know if this is buried in the TinyMCE docs, and I just have-no-clue, but I thought I would post this here incase there is something that should be addressed in Wordpress.
This was fixed before.