diff -u b/core/lib/Drupal/Core/Language/Language.php b/core/lib/Drupal/Core/Language/Language.php
--- b/core/lib/Drupal/Core/Language/Language.php
+++ b/core/lib/Drupal/Core/Language/Language.php
@@ -21,13 +21,13 @@
*
* @var array
*/
- public static $defaultValues = [
+ public static $defaultValues = array(
'id' => 'en',
'name' => 'English',
'direction' => self::DIRECTION_LTR,
'weight' => 0,
'locked' => FALSE,
- ];
+ );
// Properties within the Language are set up as the default language.
diff -u b/core/lib/Drupal/Core/Language/LanguageManager.php b/core/lib/Drupal/Core/Language/LanguageManager.php
--- b/core/lib/Drupal/Core/Language/LanguageManager.php
+++ b/core/lib/Drupal/Core/Language/LanguageManager.php
@@ -335,23 +335,23 @@
/**
* The 6 official languages used at the United Nations.
*
- * This list is based on
- * http://www.un.org/en/aboutun/languages.shtml/ and it
+ * This list is based on http://www.un.org/en/aboutun/languages.shtml/ and it
* uses the same format as getStandardLanguageList().
*
* @return array
- * An array of language code to language name information.
- * Language name information is an array of English and native names.
+ * An array with language codes as keys, and English and native language
+ * names as values. Language name information is an array of English and
+ * native names.
*/
public static function getUnitedNationsLanguageList() {
- return array(
- 'ar' => array('Arabic', /* Left-to-right marker "" */ 'العربية', LanguageInterface::DIRECTION_RTL),
- 'zh-hans' => array('Chinese, Simplified', '简体中文'),
- 'en' => array('English', 'English'),
- 'fr' => array('French', 'Français'),
- 'ru' => array('Russian', 'Русский'),
- 'es' => array('Spanish', 'Español'),
- );
+ return [
+ 'ar' => ['Arabic', /* Left-to-right marker "" */ 'العربية', LanguageInterface::DIRECTION_RTL],
+ 'zh-hans' => ['Chinese, Simplified', '简体中文'],
+ 'en' => ['English', 'English'],
+ 'fr' => ['French', 'Français'],
+ 'ru' => ['Russian', 'Русский'],
+ 'es' => ['Spanish', 'Español'],
+ ];
}
/**
diff -u b/core/modules/ckeditor/config/schema/ckeditor.schema.yml b/core/modules/ckeditor/config/schema/ckeditor.schema.yml
--- b/core/modules/ckeditor/config/schema/ckeditor.schema.yml
+++ b/core/modules/ckeditor/config/schema/ckeditor.schema.yml
@@ -38,9 +38,9 @@
type: mapping
label: 'Language'
mapping:
- language_list_type:
+ language_list:
type: string
- label: 'Language list type ID'
+ label: 'Language list ID'
# Plugin \Drupal\ckeditor\Plugin\ckeditor\plugin\StylesCombo
ckeditor.plugin.stylescombo:
diff -u b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php
--- b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php
+++ b/core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php
@@ -44,9 +44,7 @@
* {@inheritdoc}
*/
public function getLibraries(Editor $editor) {
- return array(
- 'ckeditor/drupal.ckeditor.plugins.language',
- );
+ return ['ckeditor/drupal.ckeditor.plugins.language'];
}
/**
@@ -54,13 +52,13 @@
*/
public function getConfig(Editor $editor) {
$language_list = [];
- $config = ['language_list_type' => 'un'];
+ $config = ['language_list' => 'un'];
$settings = $editor->getSettings();
if (isset($settings['plugins']['language'])) {
$config = $settings['plugins']['language'];
}
- $predefined_languages = ($config['language_list_type'] === 'all') ?
+ $predefined_languages = ($config['language_list'] === 'all') ?
LanguageManager::getStandardLanguageList() :
LanguageManager::getUnitedNationsLanguageList();
@@ -88,15 +86,15 @@
* {@inheritdoc}
*/
public function getButtons() {
- return array(
- 'Language' => array(
+ return [
+ 'Language' => [
'label' => $this->t('Language'),
'image_alternative' => [
'#type' => 'inline_template',
'#template' => '' . $this->t('Language') . '',
],
- ),
- );
+ ],
+ ];
}
/**
@@ -104,22 +102,22 @@
*/
public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor) {
// Defaults.
- $config = ['language_list_type' => 'un'];
+ $config = ['language_list' => 'un'];
$settings = $editor->getSettings();
if (isset($settings['plugins']['language'])) {
$config = $settings['plugins']['language'];
}
$predefined_languages = LanguageManager::getStandardLanguageList();
- $form['language_list_type'] = array(
- '#title' => $this->t('Language list type'),
+ $form['language_list'] = array(
+ '#title' => $this->t('Language list'),
'#title_display' => 'invisible',
'#type' => 'select',
'#options' => [
'un' => $this->t("United Nations' official languages"),
'all' => $this->t('All @count languages', ['@count' => count($predefined_languages)]),
],
- '#default_value' => $config['language_list_type'],
+ '#default_value' => $config['language_list'],
'#description' => $this->t('The list of languages to show in the language dropdown. The basic list will only show the six official languages of the UN. The extended list will show all @count languages that are available in Drupal.', [
':url' => Url::fromUri('http://www.un.org/en/aboutun/languages.shtml/')->toString(),
'@count' => count($predefined_languages),
diff -u b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
--- b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
+++ b/core/modules/ckeditor/src/Plugin/Editor/CKEditor.php
@@ -135,7 +135,7 @@
),
),
),
- 'plugins' => ['language' => ['language_list_type' => 'un']],
+ 'plugins' => ['language' => ['language_list' => 'un']],
);
}
diff -u b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php
--- b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php
+++ b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php
@@ -109,7 +109,7 @@
),
),
),
- 'plugins' => ['language' => ['language_list_type' => 'un']],
+ 'plugins' => ['language' => ['language_list' => 'un']],
);
$this->assertIdentical($this->castSafeStrings($ckeditor->getDefaultSettings()), $expected_default_settings);
@@ -148,7 +148,7 @@
$expected_settings['plugins']['stylescombo']['styles'] = '';
$editor = entity_load('editor', 'filtered_html');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists now.');
- $this->assertEqual($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
+ $this->assertIdentical($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
// Configure the Styles plugin, and ensure the updated settings are saved.
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
@@ -159,7 +159,7 @@
$expected_settings['plugins']['stylescombo']['styles'] = "h1.title|Title\np.callout|Callout\n\n";
$editor = entity_load('editor', 'filtered_html');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.');
- $this->assertEqual($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
+ $this->assertIdentical($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
// Change the buttons that appear on the toolbar (in JavaScript, this is
// done via drag and drop, but here we can only emulate the end result of
@@ -175,7 +175,7 @@
$this->drupalPostForm(NULL, $edit, t('Save configuration'));
$editor = entity_load('editor', 'filtered_html');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.');
- $this->assertEqual($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
+ $this->assertIdentical($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
// Check that the markup we're setting for the toolbar buttons (actually in
// JavaScript's drupalSettings, and Unicode-escaped) is correctly rendered.
@@ -203,7 +203,7 @@
$this->assertTrue(count($ultra_llama_mode_checkbox) === 1, 'The "Ultra llama mode" checkbox exists and is not checked.');
$editor = entity_load('editor', 'filtered_html');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.');
- $this->assertEqual($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
+ $this->assertIdentical($expected_settings, $editor->getSettings(), 'The Editor config entity has the correct settings.');
// Finally, check the "Ultra llama mode" checkbox.
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
@@ -217,7 +217,7 @@
$expected_settings['plugins']['llama_contextual_and_button']['ultra_llama_mode'] = TRUE;
$editor = entity_load('editor', 'filtered_html');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists.');
- $this->assertEqual($expected_settings, $editor->getSettings());
+ $this->assertIdentical($expected_settings, $editor->getSettings());
}
/**
@@ -282,7 +282,7 @@
$expected_settings['plugins']['stylescombo']['styles'] = '';
$editor = entity_load('editor', 'amazing_format');
$this->assertTrue($editor instanceof Editor, 'An Editor config entity exists now.');
- $this->assertEqual($this->castSafeStrings($expected_settings), $this->castSafeStrings($editor->getSettings()), 'The Editor config entity has the correct settings.');
+ $this->assertIdentical($this->castSafeStrings($expected_settings), $this->castSafeStrings($editor->getSettings()), 'The Editor config entity has the correct settings.');
}
}
diff -u b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php
--- b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php
+++ b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php
@@ -41,13 +41,13 @@
*
* @dataProvider providerGetConfig
*/
- public function testGetConfig($language_list_type, $expected_number) {
+ public function testGetConfig($language_list, $expected_number) {
$editor = $this->getMockBuilder('Drupal\editor\Entity\Editor')
->disableOriginalConstructor()
->getMock();
$editor->expects($this->once())
->method('getSettings')
- ->willReturn(['plugins' => ['language' => ['language_list_type' => $language_list_type]]]);
+ ->willReturn(['plugins' => ['language' => ['language_list' => $language_list]]]);
$config = $this->plugin->getConfig($editor);
diff -u b/core/themes/stable/css/ckeditor/plugins/language/ckeditor.language.css b/core/themes/stable/css/ckeditor/plugins/language/ckeditor.language.css
--- b/core/themes/stable/css/ckeditor/plugins/language/ckeditor.language.css
+++ b/core/themes/stable/css/ckeditor/plugins/language/ckeditor.language.css
@@ -8,21 +8,12 @@
- * border. We also append the value of the tag between brackets, eg: '(en)'.
+ * border. We also append the value of the tag between brackets, for example:
+ * '(en)'. Since the html element has a 'lang' attribute too we only target
+ * elements within the html scope.
*/
-[lang] {
+html [lang] {
outline: 1px dotted gray;
}
-[lang]:after {
+html [lang]:after {
content: " ("attr(lang)")";
font-size: 10px;
color: #666;
}
-
-/**
- * The HTML element has a default 'lang' attribute.
- * We don't want styling there.
- */
-html[lang] {
- outline: none;
-}
-html[lang]:after {
- content: none;
-}