diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php index bdd651d..c51c95b 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php @@ -309,6 +309,27 @@ function testStylesComboGetConfig() { $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); } + /** + * Tests language list availability in CKEditor. + */ + function testLanguages() { + // Get CKEditor supported language codes and spot-check. + $this->enableModules(array('language')); + config_install_default_config('module', 'language'); + $langcodes = $this->ckeditor->getLangcodes(); + + // Language codes transformed with browser mappings. + $this->assertTrue($langcodes['pt-pt'] == 'pt', '"pt" properly resolved'); + $this->assertTrue($langcodes['zh-hans'] == 'zh-cn', '"zh-hans" properly resolved'); + + // Language code both in Drupal and CKEditor. + $this->assertTrue($langcodes['gl'] == 'gl', '"gl" properly resolved'); + + // Language codes only in CKEditor. + $this->assertTrue($langcodes['en-au'] == 'en-au', '"en-au" properly resolved'); + $this->assertTrue($langcodes['sr-latn'] == 'sr-latn', '"sr-latn" properly resolved'); + } + protected function getDefaultInternalConfig() { return array( 'customConfig' => '', diff --git a/core/modules/language/config/language.mappings.yml b/core/modules/language/config/language.mappings.yml index ede8c9e..f7fc321 100644 --- a/core/modules/language/config/language.mappings.yml +++ b/core/modules/language/config/language.mappings.yml @@ -1,8 +1,8 @@ # Browsers use different language codes to refer to the same languages, # these defaults handles the most common cases. no: 'nb' # Norwegian -pt-pt: 'pt' # Portuguese -zh: 'zh-hans' +pt: 'pt-pt' # Portuguese +zh: 'zh-hans' # Default Chinese to simplified script zh-tw: 'zh-hant' # Taiwan Chinese in traditional script zh-hk: 'zh-hant' # Hong Kong Chinese in traditional script zh-mo: 'zh-hant' # Macao Chinese in traditional script