Unverified Commit d598f541 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3179258 by julien, paulocs: Spaces before or after a string searched to...

Issue #3179258 by julien, paulocs: Spaces before or after a string searched to be translated returns nothing
parent b72fe50a
Loading
Loading
Loading
Loading
+1 −1
Changes for core/modules/locale/src/Form/TranslateFilterForm.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    $filters = $this->translateFilters();
    foreach ($filters as $name => $filter) {
      if ($form_state->hasValue($name)) {
        $_SESSION['locale_translate_filter'][$name] = $form_state->getValue($name);
        $_SESSION['locale_translate_filter'][$name] = trim($form_state->getValue($name));
      }
    }
    $form_state->setRedirect('locale.translate_page');
+4 −1
Changes for core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -81,10 +81,13 @@ public function testStringTranslation() {
    $this->assertText(t($name), 'Test language added.');
    $this->drupalLogout();

    // Add a whitespace at the end of string to ensure it is found.
    $name_ws = $name . " ";

    // Search for the name and translate it.
    $this->drupalLogin($translate_user);
    $search = [
      'string' => $name,
      'string' => $name_ws,
      'langcode' => $langcode,
      'translation' => 'untranslated',
    ];