Skip to content
Permalink
Browse files

Merge branch 't/9688b'

  • Loading branch information...
fredck committed Nov 21, 2012
2 parents 4f213b5 + 21fb447 commit e096626b6d125e9d4b20bb03a209f0205f2d815d
Showing with 23 additions and 4 deletions.
  1. +15 −2 core/editor.js
  2. +4 −1 plugins/a11yhelp/plugin.js
  3. +4 −1 plugins/specialchar/plugin.js
@@ -448,8 +448,21 @@
pluginLangs = pluginLangs.split( ',' );

// Resolve the plugin language. If the current language
// is not available, get the first one (default one).
lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] );
// is not available, get English or the first one.
if ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 )
lang = editor.langCode;
else {
// The language code may have the locale information (zh-cn).
// Fall back to locale-less in that case (zh).
var langPart = editor.langCode.replace( /-.*/, '' );
if ( langPart != editor.langCode && CKEDITOR.tools.indexOf( pluginLangs, langPart ) >= 0 )
lang = langPart;
// Try the only "generic" option we have: English.
else if ( CKEDITOR.tools.indexOf( pluginLangs, 'en' ) >= 0 )
lang = 'en';
else
lang = pluginLangs[ 0 ];
}

if ( !plugin.langEntries || !plugin.langEntries[ lang ] ) {
// Put the language file URL into the list of files to
@@ -23,7 +23,10 @@
editor.addCommand( commandName, {
exec: function() {
var langCode = editor.langCode;
langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
langCode =
plugin.availableLangs[ langCode ] ? langCode :
plugin.availableLangs[ langCode.replace( /-.*/, '' ) ] ? langCode.replace( /-.*/, '' ) :
'en';

CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( plugin.path + 'dialogs/lang/' + langCode + '.js' ), function() {
editor.lang.a11yhelp = plugin.langEntries[ langCode ];
@@ -23,7 +23,10 @@ CKEDITOR.plugins.add( 'specialchar', {
editor.addCommand( pluginName, {
exec: function() {
var langCode = editor.langCode;
langCode = plugin.availableLangs[ langCode ] ? langCode : 'en';
langCode =
plugin.availableLangs[ langCode ] ? langCode :
plugin.availableLangs[ langCode.replace( /-.*/, '' ) ] ? langCode.replace( /-.*/, '' ) :
'en';

CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( plugin.path + 'dialogs/lang/' + langCode + '.js' ), function() {
CKEDITOR.tools.extend( editor.lang.specialchar, plugin.langEntries[ langCode ] );

0 comments on commit e096626

Please sign in to comment.
You can’t perform that action at this time.