Unverified Commit 9719c35a authored by Lee Rowlands's avatar Lee Rowlands Committed by Alex Pott
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

(cherry picked from commit d598f541)
parent 090a1cf0
Loading
Loading
Loading
Loading
+1 −1
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
Original line number Diff line number Diff line
@@ -81,10 +81,13 @@ public function testStringTranslation() {
    $this->assertText($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',
    ];