[wp-trac] [WordPress Trac] #3989: TinyMCE default language fails
when get_locale() is empty for external plugins
WordPress Trac
wp-trac at lists.automattic.com
Sat Mar 17 16:46:26 GMT 2007
#3989: TinyMCE default language fails when get_locale() is empty for external
plugins
------------------------+---------------------------------------------------
Reporter: ev3rywh3re | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.1.3
Component: TinyMCE | Version: 2.2
Severity: normal | Keywords: tinymce, l10n
------------------------+---------------------------------------------------
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.
--
Ticket URL: <http://trac.wordpress.org/ticket/3989>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list