Commit e4ae1523 authored by webchick's avatar webchick

Issue #2240463 by robertdbailey, balagan, holly.ross.drupal: Fix text:...

Issue #2240463 by robertdbailey, balagan, holly.ross.drupal: Fix text: languages are not "enabled/disabled" anymore, they are added/removed.
parent ace08794
......@@ -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;
......
......@@ -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();
......
......@@ -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.
......
......@@ -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');
......
......@@ -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.');
}
}
}
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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');
......
......@@ -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
......
......@@ -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(
......
......@@ -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',
));
......
......@@ -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);
......
......@@ -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());
}
......
......@@ -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.
......
......@@ -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(
......
......@@ -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',
);
}
......
......@@ -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
......
......@@ -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
*/
......
......@@ -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."));
......
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment