Commit e4ae1523 authored by Angie Byron's avatar Angie Byron
Browse files

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
Loading
Loading
Loading
Loading
+1 −1
Changes for core/lib/Drupal/Component/Utility/UserAgent.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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;
+2 −2
Changes for core/lib/Drupal/Core/Language/LanguageManagerInterface.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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();

+2 −2
Changes for core/modules/content_translation/content_translation.install: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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.
+2 −2
Changes for core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationTestBase.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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');
+5 −5
Changes for core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -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.');
      }
    }
  }
Loading