From e4ae1523e70e4e7426f73407a6d4c1dafe0d4460 Mon Sep 17 00:00:00 2001 From: webchick <webchick@24967.no-reply.drupal.org> Date: Sun, 4 May 2014 10:19:57 -0700 Subject: [PATCH] Issue #2240463 by robertdbailey, balagan, holly.ross.drupal: Fix text: languages are not "enabled/disabled" anymore, they are added/removed. --- core/lib/Drupal/Component/Utility/UserAgent.php | 2 +- .../Drupal/Core/Language/LanguageManagerInterface.php | 4 ++-- .../content_translation/content_translation.install | 4 ++-- .../Tests/ContentTranslationTestBase.php | 4 ++-- .../Tests/ContentTranslationUITest.php | 10 +++++----- core/modules/language/language.module | 2 +- .../LanguageNegotiation/LanguageNegotiationUrl.php | 6 +++--- .../lib/Drupal/language/Tests/LanguageListTest.php | 2 +- .../Tests/LanguageUILanguageNegotiationTest.php | 2 +- .../lib/Drupal/locale/Tests/LocaleExportTest.php | 2 +- .../lib/Drupal/locale/Tests/LocalePluralFormatTest.php | 4 ++-- .../lib/Drupal/locale/Tests/LocaleUpdateTest.php | 6 +++--- core/modules/locale/locale.bulk.inc | 2 +- core/modules/locale/locale.module | 2 +- core/modules/node/lib/Drupal/node/NodeListBuilder.php | 2 +- .../lib/Drupal/search/Tests/SearchLanguageTest.php | 2 +- core/modules/user/lib/Drupal/user/AccountForm.php | 8 ++++---- .../views/Tests/Entity/RowEntityRenderersTest.php | 2 +- .../lib/Drupal/views_ui/Tests/ViewEditTest.php | 2 +- sites/default/default.settings.php | 2 +- 20 files changed, 35 insertions(+), 35 deletions(-) diff --git a/core/lib/Drupal/Component/Utility/UserAgent.php b/core/lib/Drupal/Component/Utility/UserAgent.php index d91074b18bed..8b35c7599beb 100644 --- a/core/lib/Drupal/Component/Utility/UserAgent.php +++ b/core/lib/Drupal/Component/Utility/UserAgent.php @@ -106,7 +106,7 @@ public static function getBestMatchingLangcode($http_accept_language, $langcodes } } - // Find the enabled language with the greatest qvalue, following the rules + // Find the added language with the greatest qvalue, following the rules // of RFC 2616 (section 14.4). If several languages have the same qvalue, // prefer the one with the greatest weight. $best_match_langcode = FALSE; diff --git a/core/lib/Drupal/Core/Language/LanguageManagerInterface.php b/core/lib/Drupal/Core/Language/LanguageManagerInterface.php index da1a079ac54f..43b2f23fd51b 100644 --- a/core/lib/Drupal/Core/Language/LanguageManagerInterface.php +++ b/core/lib/Drupal/Core/Language/LanguageManagerInterface.php @@ -28,10 +28,10 @@ public function setTranslation(TranslationInterface $translation); public function init(); /** - * Returns whether or not the site has more than one language enabled. + * Returns whether or not the site has more than one language added. * * @return bool - * TRUE if more than one language is enabled, FALSE otherwise. + * TRUE if more than one language is added, FALSE otherwise. */ public function isMultilingual(); diff --git a/core/modules/content_translation/content_translation.install b/core/modules/content_translation/content_translation.install index b814f2dc428b..f6dda75656ba 100644 --- a/core/modules/content_translation/content_translation.install +++ b/core/modules/content_translation/content_translation.install @@ -107,10 +107,10 @@ function content_translation_install() { * Implements hook_enable(). */ function content_translation_enable() { - // Translation works when at least two languages are enabled. + // Translation works when at least two languages are added. if (count(\Drupal::languageManager()->getLanguages()) < 2) { $t_args = array('!language_url' => url('admin/config/regional/language')); - $message = t('Be sure to <a href="!language_url">enable at least two languages</a> to translate content.', $t_args); + $message = t('Be sure to <a href="!language_url">add at least two languages</a> to translate content.', $t_args); drupal_set_message($message, 'warning'); } // Point the user to the content translation settings. diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php index 415b116e5d98..cec940431db2 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php @@ -38,7 +38,7 @@ abstract class ContentTranslationTestBase extends WebTestBase { protected $bundle; /** - * The enabled languages. + * The added languages. * * @var array */ @@ -96,7 +96,7 @@ function setUp() { } /** - * Enables additional languages. + * Adds additional languages. */ protected function setupLanguages() { $this->langcodes = array('it', 'fr'); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php index 96bf8b29ba3d..4454176e028e 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php @@ -130,21 +130,21 @@ protected function doTestOutdatedStatus() { $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); // Check that every translation has the correct "outdated" status. - foreach ($this->langcodes as $enabled_langcode) { - $prefix = $enabled_langcode != $default_langcode ? $enabled_langcode . '/' : ''; + foreach ($this->langcodes as $added_langcode) { + $prefix = $added_langcode != $default_langcode ? $added_langcode . '/' : ''; $path = $prefix . $edit_path; $this->drupalGet($path); - if ($enabled_langcode == $langcode) { + if ($added_langcode == $langcode) { $this->assertFieldByXPath('//input[@name="content_translation[retranslate]"]', FALSE, 'The retranslate flag is not checked by default.'); } else { $this->assertFieldByXPath('//input[@name="content_translation[outdated]"]', TRUE, 'The translate flag is checked by default.'); $edit = array('content_translation[outdated]' => FALSE); - $this->drupalPostForm($path, $edit, $this->getFormSubmitAction($entity, $enabled_langcode)); + $this->drupalPostForm($path, $edit, $this->getFormSubmitAction($entity, $added_langcode)); $this->drupalGet($path); $this->assertFieldByXPath('//input[@name="content_translation[retranslate]"]', FALSE, 'The retranslate flag is now shown.'); $entity = entity_load($this->entityTypeId, $this->entityId, TRUE); - $this->assertFalse($entity->translation[$enabled_langcode]['outdated'], 'The "outdated" status has been correctly stored.'); + $this->assertFalse($entity->translation[$added_langcode]['outdated'], 'The "outdated" status has been correctly stored.'); } } } diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 845407d4d1b1..08cd8e05eb28 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -60,7 +60,7 @@ function language_help($path, $arg) { case 'admin/structure/block/manage/%': case 'admin/structure/block/add/%/%': if ($arg[4] == 'language' && $arg[5] == 'language_interface') { - return '<p>' . t('With multiple languages enabled, registered users can select their preferred language and authors can assign a specific language to content.') . '</p>'; + return '<p>' . t('With multiple languages added, registered users can select their preferred language and authors can assign a specific language to content.') . '</p>'; } break; diff --git a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php index eacb5c409c3c..42a093304f0e 100644 --- a/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php +++ b/core/modules/language/lib/Drupal/language/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php @@ -59,7 +59,7 @@ public function getLangcode(Request $request = NULL) { $path_args = explode('/', $request_path); $prefix = array_shift($path_args); - // Search prefix within enabled languages. + // Search prefix within added languages. $negotiated_language = FALSE; foreach ($languages as $language) { if (isset($config['prefixes'][$language->id]) && $config['prefixes'][$language->id] == $prefix) { @@ -104,7 +104,7 @@ public function processInbound($path, Request $request) { $parts = explode('/', $path); $prefix = array_shift($parts); - // Search prefix within enabled languages. + // Search prefix within added languages. foreach ($this->languageManager->getLanguages() as $language) { if (isset($config['prefixes'][$language->id]) && $config['prefixes'][$language->id] == $prefix) { // Rebuild $path with the language removed. @@ -132,7 +132,7 @@ public function processOutbound($path, &$options = array(), Request $request = N $language_url = $this->languageManager->getCurrentLanguage(Language::TYPE_URL); $options['language'] = $language_url; } - // We allow only enabled languages here. + // We allow only added languages here. elseif (!is_object($options['language']) || !isset($languages[$options['language']->id])) { return $path; } diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php index 273850b5a4ab..d5abded8ea1d 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageListTest.php @@ -126,7 +126,7 @@ function testLanguageList() { $languages = $this->container->get('language_manager')->getLanguages(); // We need raw here because %language and %langcode will add HTML. $t_args = array('%language' => 'French', '%langcode' => 'fr'); - $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'Disabled language has been removed.'); + $this->assertRaw(t('The %language (%langcode) language has been removed.', $t_args), 'The French language has been removed.'); $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.'); // Verify that language is no longer found. $this->drupalGet('admin/config/regional/language/delete/fr'); diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php index 169bfcf0a209..1a2e5d612ea8 100644 --- a/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php +++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUILanguageNegotiationTest.php @@ -32,7 +32,7 @@ * 2. URL (PATH) > BROWSER > DEFAULT * admin/config * UI in user's browser language preference if the site has that - * language enabled, if not, the default language + * language added, if not, the default language * zh-hans/admin/config * UI in Chinese * blah-blah/admin/config diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php index c0ceb052fd66..cf69ddbb11d0 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleExportTest.php @@ -50,7 +50,7 @@ function setUp() { */ function testExportTranslation() { // First import some known translations. - // This will also automatically enable the 'fr' language. + // This will also automatically add the 'fr' language. $name = tempnam('temporary://', "po_") . '.po'; file_put_contents($name, $this->getPoFile()); $this->drupalPostForm('admin/config/regional/translate/import', array( diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php index b1982f65dee8..c8adf970c29f 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocalePluralFormatTest.php @@ -41,7 +41,7 @@ function setUp() { */ function testGetPluralFormat() { // Import some .po files with formulas to set up the environment. - // These will also add the languages to the system and enable them. + // These will also add the languages to the system. $this->importPoFile($this->getPoFileWithSimplePlural(), array( 'langcode' => 'fr', )); @@ -142,7 +142,7 @@ function testGetPluralFormat() { */ function testPluralEditExport() { // Import some .po files with formulas to set up the environment. - // These will also add the languages to the system and enable them. + // These will also add the languages to the system. $this->importPoFile($this->getPoFileWithSimplePlural(), array( 'langcode' => 'fr', )); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php index 81a1ac655d10..268f72fa6bd8 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUpdateTest.php @@ -342,7 +342,7 @@ function testEnableUninstallModule() { } /** - * Tests automatic translation import when a langauge is enabled. + * Tests automatic translation import when a langauge is added. * * When a language is added, the system will check for translations files of * enabled modules and will import them. When a language is removed the system @@ -390,7 +390,7 @@ function testEnableLanguage() { } /** - * Tests automatic translation import when a custom langauge is enabled. + * Tests automatic translation import when a custom langauge is added. */ function testEnableCustomLanguage() { // Make the hidden test modules look like a normal custom module. @@ -402,7 +402,7 @@ function testEnableCustomLanguage() { ); $this->drupalPostForm('admin/modules', $edit, t('Save configuration')); - // Create and enable a custom language with language code 'xx' and a random + // Create a custom language with language code 'xx' and a random // name. $langcode = 'xx'; $name = $this->randomName(16); diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index f75a23e69a7f..06c08874f7c9 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -45,7 +45,7 @@ function locale_translate_batch_import_files($options, $force = FALSE) { } else { // If langcode was not provided, make sure to only import files for the - // languages we have enabled. + // languages we have added. $langcodes = array_keys(\Drupal::languageManager()->getLanguages()); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index afb4047df228..039d51a797dc 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -4,7 +4,7 @@ * @file * Enables the translation of the user interface to languages other than English. * - * When enabled, multiple languages can be set up. The site interface can be + * When enabled, multiple languages can be added. The site interface can be * displayed in different languages, and nodes can have languages assigned. The * setup of languages and translations is completely web based. Gettext portable * object files are supported. diff --git a/core/modules/node/lib/Drupal/node/NodeListBuilder.php b/core/modules/node/lib/Drupal/node/NodeListBuilder.php index 51b24855a037..fc9c0ba7f350 100644 --- a/core/modules/node/lib/Drupal/node/NodeListBuilder.php +++ b/core/modules/node/lib/Drupal/node/NodeListBuilder.php @@ -61,7 +61,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI * {@inheritdoc} */ public function buildHeader() { - // Enable language column and filter if multiple languages are enabled. + // Enable language column and filter if multiple languages are added. $header = array( 'title' => $this->t('Title'), 'type' => array( diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php index c7b51c842177..7cdf0bd652a3 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchLanguageTest.php @@ -25,7 +25,7 @@ class SearchLanguageTest extends SearchTestBase { public static function getInfo() { return array( 'name' => 'Search language selection', - 'description' => 'Tests advanced search with different languages enabled.', + 'description' => 'Tests advanced search with different languages added.', 'group' => 'Search', ); } diff --git a/core/modules/user/lib/Drupal/user/AccountForm.php b/core/modules/user/lib/Drupal/user/AccountForm.php index f85fca27904f..f650c0727535 100644 --- a/core/modules/user/lib/Drupal/user/AccountForm.php +++ b/core/modules/user/lib/Drupal/user/AccountForm.php @@ -237,11 +237,11 @@ public function form(array $form, array &$form_state) { $user_preferred_admin_langcode = $register ? $language_interface->id : $account->getPreferredAdminLangcode(); - // Is the user preferred language enabled? - $user_language_enabled = FALSE; + // Is the user preferred language added? + $user_language_added = FALSE; if ($this->languageManager instanceof ConfigurableLanguageManagerInterface) { $negotiator = $this->languageManager->getNegotiator(); - $user_language_enabled = $negotiator && $negotiator->isNegotiationMethodEnabled(LanguageNegotiationUser::METHOD_ID, Language::TYPE_INTERFACE); + $user_language_added = $negotiator && $negotiator->isNegotiationMethodEnabled(LanguageNegotiationUser::METHOD_ID, Language::TYPE_INTERFACE); } $form['language'] = array( '#type' => $this->languageManager->isMultilingual() ? 'details' : 'container', @@ -257,7 +257,7 @@ public function form(array $form, array &$form_state) { '#title' => $this->t('Site language'), '#languages' => Language::STATE_CONFIGURABLE, '#default_value' => $user_preferred_langcode, - '#description' => $user_language_enabled ? $this->t("This account's preferred language for e-mails and site presentation.") : $this->t("This account's preferred language for e-mails."), + '#description' => $user_language_added ? $this->t("This account's preferred language for e-mails and site presentation.") : $this->t("This account's preferred language for e-mails."), ); // Only show the account setting for Administration pages language to users diff --git a/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php b/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php index becbeaf6c928..869ad8835bf4 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Entity/RowEntityRenderersTest.php @@ -33,7 +33,7 @@ class RowEntityRenderersTest extends ViewUnitTestBase { public static $testViews = array('test_entity_row_renderers'); /** - * An array of enabled languages. + * An array of added languages. * * @var array */ diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php index 1693888d3a4f..8e35fbc8f721 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/ViewEditTest.php @@ -101,7 +101,7 @@ public function testEditFormOtherOptions() { $langcode_url = 'admin/structure/views/nojs/display/test_view/default/field_langcode'; $this->assertLinkByHref($langcode_url); $this->assertLink(t("Current user's language")); - // Click the link and check the form before language is enabled. + // Click the link and check the form before language is added. $this->drupalGet($langcode_url); $this->assertResponse(200); $this->assertText(t("You don't have translatable entity types.")); diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php index b2ce930eff03..9fa9dde5fe5a 100644 --- a/sites/default/default.settings.php +++ b/sites/default/default.settings.php @@ -491,7 +491,7 @@ * Remove the leading hash signs to enable. * * The "en" part of the variable name, is dynamic and can be any langcode of - * any enabled language. (eg locale_custom_strings_de for german). + * any added language. (eg locale_custom_strings_de for german). */ # $settings['locale_custom_strings_en'][''] = array( # 'forum' => 'Discussion board', -- GitLab