Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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');
......
......@@ -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',
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment