From a28c9b38cbbe6fd2a207c01000356c82dd709dea Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Sun, 19 Jun 2022 18:08:38 +0100
Subject: [PATCH] Issue #3164699 by jungle, ravi.shankar, andregp,
 kishor_kolekar, sulfikar_s, ankithashetty, paulocs, Abhijith S, WagnerMelo,
 quietone: Fix or ignore 15 words used in Help Topics

---
 core/misc/cspell/dictionary.txt               | 14 ---------
 .../help_topics_test.test.html.twig           |  2 +-
 .../Plugin/HelpSection/TestHelpSection.php    | 10 ++++---
 .../src/Functional/HelpTopicSearchTest.php    | 29 ++++++++++---------
 .../HelpTopicTranslatedTestBase.php           |  6 ++--
 .../Functional/HelpTopicTranslationTest.php   |  2 ++
 6 files changed, 29 insertions(+), 34 deletions(-)

diff --git a/core/misc/cspell/dictionary.txt b/core/misc/cspell/dictionary.txt
index 293abe80e74b..73100397aeff 100644
--- a/core/misc/cspell/dictionary.txt
+++ b/core/misc/cspell/dictionary.txt
@@ -31,8 +31,6 @@ andif
 annot
 anonyme
 anothermodule
-anotherwordenglish
-anotherwordgerman
 antilop
 anyall
 applix
@@ -49,7 +47,6 @@ arrowstop
 arrowthick
 arrowthickstop
 arrr
-asdrsad
 assertable
 asterix
 atsign
@@ -94,7 +91,6 @@ bangpow
 barbar
 barchart
 barfoo
-barmm
 barqux
 bartik
 bartik's
@@ -504,7 +500,6 @@ foobarbaz
 foobargorilla
 foobars
 foofoo
-foomm
 foos
 formatless
 formattable
@@ -575,7 +570,6 @@ heure
 heures
 hexcode
 hidpi
-hilfetestmodul
 hilited
 hinode
 hippopotamidae
@@ -899,15 +893,11 @@ nonconfigurable
 nonexistingfilename
 nonoptional
 nonspacing
-nonwordgerman
-nonworditem
 noquotes
 noschema
 nosniff
 nostart
 notag
-notawordenglish
-notawordgerman
 notexisting
 nothere
 notnull
@@ -1176,7 +1166,6 @@ scorewords
 screenreaders
 scriptable
 scrollbars
-sdeeeee
 searchdirs
 searchfield
 sebe
@@ -1233,7 +1222,6 @@ splitbuttons
 spreadsheetml
 sqlpassword
 sqlusername
-sqruct
 squaresmall
 squiz
 squizlabs
@@ -1582,7 +1570,6 @@ vxezb
 vxfbk
 waitfor
 wcprops
-wcsrefsdf
 webassert
 webcal
 webdriver
@@ -1664,5 +1651,4 @@ zzgroup
 åwesome
 èxample
 über
-übersetzung
 ȅchȏ
diff --git a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test.html.twig b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test.html.twig
index 1b3d12dcdef7..baa28f2c77c9 100644
--- a/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test.html.twig
+++ b/core/modules/help_topics/tests/modules/help_topics_test/help_topics/help_topics_test.test.html.twig
@@ -7,5 +7,5 @@ related:
 ---
 {% set help_topic_link = render_var(help_topic_link('help_topics_test.test_urls')) %}
 <p>{% trans %}This is a test. It should link to the URL test topic {{ help_topic_link }}. Also there should be a related topic link below to the Help module topic page and the linked topic.{% endtrans %}</p>
-<p>{% trans %}Nonworditem totranslate.{% endtrans %}</p>
+<p>{% trans %}Non-word-item to translate.{% endtrans %}</p>
 <p>{% trans %}Test translation.{% endtrans %}</p>
diff --git a/core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php b/core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php
index f4d2a741e0ee..2dc366bc9e98 100644
--- a/core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php
+++ b/core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php
@@ -8,6 +8,8 @@
 use Drupal\Core\Link;
 use Drupal\help\Plugin\HelpSection\HelpSectionPluginBase;
 
+// cspell:ignore asdrsad barmm foomm sqruct wcsrefsdf sdeeeee
+
 /**
  * Provides a searchable help section for testing.
  *
@@ -47,13 +49,13 @@ public function renderTopicForSearch($topic_id, LanguageInterface $language) {
         if ($language->getId() == 'en') {
           return [
             'title' => 'Foo in English title wcsrefsdf',
-            'text' => 'Something about foo body notawordenglish sqruct',
+            'text' => 'Something about foo body not-a-word-english sqruct',
             'url' => Url::fromUri('https://foo.com'),
           ];
         }
         return [
           'title' => 'Foomm Foreign heading',
-          'text' => 'Fake foreign foo text notawordgerman asdrsad',
+          'text' => 'Fake foreign foo text not-a-word-german asdrsad',
           'url' => Url::fromUri('https://mm.foo.com'),
         ];
 
@@ -61,13 +63,13 @@ public function renderTopicForSearch($topic_id, LanguageInterface $language) {
         if ($language->getId() == 'en') {
           return [
             'title' => 'Bar in English',
-            'text' => 'Something about bar anotherwordenglish asdrsad',
+            'text' => 'Something about bar another-word-english asdrsad',
             'url' => Url::fromUri('https://bar.com'),
           ];
         }
         return [
           'title' => \Drupal::state()->get('help_topics_test:translated_title', 'Barmm Foreign sdeeeee'),
-          'text' => 'Fake foreign barmm anotherwordgerman sqruct',
+          'text' => 'Fake foreign barmm another-word-german sqruct',
           'url' => Url::fromUri('https://mm.bar.com'),
         ];
 
diff --git a/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php b/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
index 83a0c875c51d..013841aa10d2 100644
--- a/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
+++ b/core/modules/help_topics/tests/src/Functional/HelpTopicSearchTest.php
@@ -5,6 +5,9 @@
 use Drupal\Tests\Traits\Core\CronRunTrait;
 use Drupal\help_topics\Plugin\Search\HelpSearch;
 
+// cspell:ignore asdrsad barmm foomm hilfetestmodul sdeeeee sqruct
+// cspell:ignore wcsrefsdf übersetzung
+
 /**
  * Verifies help topic search.
  *
@@ -63,7 +66,7 @@ protected function setUp(): void {
     // Before running cron, verify that a search returns no results and shows
     // warning.
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
+    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
     $this->assertSearchResultsCount(0);
     $this->assertSession()->statusMessageContains('Help search is not fully indexed', 'warning');
 
@@ -83,7 +86,7 @@ protected function setUp(): void {
     $this->assertSession()->pageTextContains('100% of the site has been indexed');
     // Search and verify there is no warning.
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
+    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
     $this->assertSearchResultsCount(1);
     $this->assertSession()->statusMessageNotContains('Help search is not fully indexed');
   }
@@ -100,26 +103,26 @@ public function testHelpSearch() {
     // by the topics that come from
     // \Drupal\help_topics_test\Plugin\HelpSection\TestHelpSection.
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
+    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
     $this->assertSearchResultsCount(1);
     $session->linkExists('Foo in English title wcsrefsdf');
 
     // Same for German.
     $this->drupalGet('search/help', ['language' => $german]);
-    $this->submitForm(['keys' => 'notawordgerman'], 'Search');
+    $this->submitForm(['keys' => 'not-a-word-german'], 'Search');
     $this->assertSearchResultsCount(1);
     $session->linkExists('Foomm Foreign heading');
 
     // Verify when we search in English for a word that only exists in German,
     // we get no results.
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'notawordgerman'], 'Search');
+    $this->submitForm(['keys' => 'not-a-word-german'], 'Search');
     $this->assertSearchResultsCount(0);
     $session->pageTextContains('no results');
 
     // Same for German.
     $this->drupalGet('search/help', ['language' => $german]);
-    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
+    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
     $this->assertSearchResultsCount(0);
     $session->pageTextContains('no results');
 
@@ -141,7 +144,7 @@ public function testHelpSearch() {
     // that we can search for translated regular help topics, in both English
     // and German.
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'nonworditem'], 'Search');
+    $this->submitForm(['keys' => 'non-word-item'], 'Search');
     $this->assertSearchResultsCount(1);
     $session->linkExists('ABC Help Test module');
     // Click the link and verify we ended up on the topic page.
@@ -149,7 +152,7 @@ public function testHelpSearch() {
     $session->pageTextContains('This is a test');
 
     $this->drupalGet('search/help', ['language' => $german]);
-    $this->submitForm(['keys' => 'nonwordgerman'], 'Search');
+    $this->submitForm(['keys' => 'non-word-german'], 'Search');
     $this->assertSearchResultsCount(1);
     $session->linkExists('ABC-Hilfetestmodul');
     $this->clickLink('ABC-Hilfetestmodul');
@@ -158,13 +161,13 @@ public function testHelpSearch() {
     // Verify that we can search from the admin/help page.
     $this->drupalGet('admin/help');
     $session->pageTextContains('Search help');
-    $this->submitForm(['keys' => 'nonworditem'], 'Search');
+    $this->submitForm(['keys' => 'non-word-item'], 'Search');
     $this->assertSearchResultsCount(1);
     $session->linkExists('ABC Help Test module');
 
     // Same for German.
     $this->drupalGet('admin/help', ['language' => $german]);
-    $this->submitForm(['keys' => 'nonwordgerman'], 'Search');
+    $this->submitForm(['keys' => 'non-word-german'], 'Search');
     $this->assertSearchResultsCount(1);
     $session->linkExists('ABC-Hilfetestmodul');
 
@@ -228,12 +231,12 @@ public function testHelpSearch() {
     $session->pageTextContains('Search help');
 
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'nonworditem'], 'Search');
+    $this->submitForm(['keys' => 'non-word-item'], 'Search');
     $this->assertSearchResultsCount(1);
     $session->linkExists('ABC Help Test module');
 
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'notawordenglish'], 'Search');
+    $this->submitForm(['keys' => 'not-a-word-english'], 'Search');
     $this->assertSearchResultsCount(0);
     $session->pageTextContains('no results');
 
@@ -241,7 +244,7 @@ public function testHelpSearch() {
     // searchable.
     \Drupal::service('module_installer')->uninstall(['help_topics_test']);
     $this->drupalGet('search/help');
-    $this->submitForm(['keys' => 'nonworditem'], 'Search');
+    $this->submitForm(['keys' => 'non-word-item'], 'Search');
     $this->assertSearchResultsCount(0);
   }
 
diff --git a/core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php b/core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
index 8ddc65373ab4..b2182c439fb7 100644
--- a/core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
+++ b/core/modules/help_topics/tests/src/Functional/HelpTopicTranslatedTestBase.php
@@ -4,6 +4,8 @@
 
 use Drupal\Tests\BrowserTestBase;
 
+// cspell:ignore hilfetestmodul übersetzung
+
 /**
  * Provides a base class for functional help topic tests that use translation.
  *
@@ -73,8 +75,8 @@ protected function installParameters() {
 msgid "Test translation."
 msgstr "Ãœbersetzung testen."
 
-msgid "Nonworditem totranslate."
-msgstr "Nonwordgerman sdfwedrsdf."
+msgid "Non-word-item to translate."
+msgstr "Non-word-german sdfwedrsdf."
 
 ENDPO;
     include_once $this->root . '/core/includes/install.core.inc';
diff --git a/core/modules/help_topics/tests/src/Functional/HelpTopicTranslationTest.php b/core/modules/help_topics/tests/src/Functional/HelpTopicTranslationTest.php
index 86e45d7a3a44..261fcb0ba241 100644
--- a/core/modules/help_topics/tests/src/Functional/HelpTopicTranslationTest.php
+++ b/core/modules/help_topics/tests/src/Functional/HelpTopicTranslationTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\help_topics\Functional;
 
+// cspell:ignore hilfetestmodul übersetzung
+
 /**
  * Verifies help topic translations.
  *
-- 
GitLab