diff --git a/core/modules/node/content_types.js b/core/modules/node/content_types.js index 838aa09..eed93f0 100644 --- a/core/modules/node/content_types.js +++ b/core/modules/node/content_types.js @@ -54,26 +54,6 @@ if (!$editContext.find('#edit-display-submitted').is(':checked')) { vals.unshift(Drupal.t("Don't display post information")); } - - var singularLabel = $(context).find('#edit-label-singular').val(); - if (singularLabel) { - vals.push(Drupal.t("Singular '@label'", {'@label': singularLabel})); - } - var pluralLabel = $(context).find('#edit-label-plural').val(); - if (pluralLabel) { - vals.push(Drupal.t("Plural '@label'", {'@label': pluralLabel})); - } - var hasAllCountLabels = true; - $('#edit-label-count input[type="text"]', context).each(function () { - if (!$(this).val()) { - hasAllCountLabels = false; - return false; - } - }); - if (hasAllCountLabels) { - vals.push(Drupal.t("Count label variants defined")); - } - return vals.join(', '); }); } diff --git a/core/modules/node/src/Tests/NodeTypePluralLabelsTranslationTest.php b/core/modules/node/tests/src/Functional/NodeTypePluralLabelsTranslationTest.php similarity index 75% rename from core/modules/node/src/Tests/NodeTypePluralLabelsTranslationTest.php rename to core/modules/node/tests/src/Functional/NodeTypePluralLabelsTranslationTest.php index 4806c3c..ed091b4 100644 --- a/core/modules/node/src/Tests/NodeTypePluralLabelsTranslationTest.php +++ b/core/modules/node/tests/src/Functional/NodeTypePluralLabelsTranslationTest.php @@ -1,18 +1,18 @@ drupalGet('admin/structure/types/add'); // Romanian language has 3 plural variants - $this->assertFieldByName('label_count[0]'); - $this->assertFieldByName('label_count[1]'); - $this->assertFieldByName('label_count[2]'); - $this->assertNoFieldByName('label_count[3]'); + $this->assertSession()->fieldExists('label_count[0]'); + $this->assertSession()->fieldExists('label_count[1]'); + $this->assertSession()->fieldExists('label_count[2]'); + $this->assertSession()->fieldNotExists('label_count[3]'); $edit = [ 'name' => 'Copil', @@ -99,12 +99,12 @@ public function testNodeTypeTranslation() { $node_type = NodeType::load('child'); // Test the default language (Romanian) original labels. - $this->assertEqual($node_type->label(), 'Copil'); - $this->assertEqual($node_type->getSingularLabel(), 'copil'); - $this->assertEqual($node_type->getPluralLabel(), 'copii'); - $this->assertEqual($node_type->getCountLabel(1), '1 copil'); - $this->assertEqual($node_type->getCountLabel(5), '5 copii'); - $this->assertEqual($node_type->getCountLabel(20), '20 de copii'); + self::assertEquals($node_type->label(), 'Copil'); + self::assertEquals($node_type->getSingularLabel(), 'copil'); + self::assertEquals($node_type->getPluralLabel(), 'copii'); + self::assertEquals($node_type->getCountLabel(1), '1 copil'); + self::assertEquals($node_type->getCountLabel(5), '5 copii'); + self::assertEquals($node_type->getCountLabel(20), '20 de copii'); // Load the English version of the 'child' node-type. $original_language = $language_manager->getConfigOverrideLanguage(); @@ -114,12 +114,12 @@ public function testNodeTypeTranslation() { $language_manager->setConfigOverrideLanguage($original_language); // Test the additional language (English) translated labels. - $this->assertEqual($node_type->label(), 'Child'); - $this->assertEqual($node_type->getSingularLabel(), 'child'); - $this->assertEqual($node_type->getPluralLabel(), 'children'); - $this->assertEqual($node_type->getCountLabel(1), '1 child'); - $this->assertEqual($node_type->getCountLabel(5), '5 children'); - $this->assertEqual($node_type->getCountLabel(20), '20 children'); + self::assertEquals($node_type->label(), 'Child'); + self::assertEquals($node_type->getSingularLabel(), 'child'); + self::assertEquals($node_type->getPluralLabel(), 'children'); + self::assertEquals($node_type->getCountLabel(1), '1 child'); + self::assertEquals($node_type->getCountLabel(5), '5 children'); + self::assertEquals($node_type->getCountLabel(20), '20 children'); } }