Unverified Commit d598f541 authored by larowlan's avatar larowlan

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
......@@ -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',
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment