Skip to content
Snippets Groups Projects
Commit 0e73f6a3 authored by Jiří Kozlovský's avatar Jiří Kozlovský
Browse files

Fixed JS translations injection

There was thrown an error when we've added translation using key having reserved chars because it rendered like { 0/BOOKS : "Books" } instead of { "0/BOOKS" : "Books" }
parent 2f356d67
No related merge requests found
......@@ -98,7 +98,7 @@ class JsTranslations extends AbstractHelper
$translation = is_array($v)
? call_user_func_array([$this->transEsc, '__invoke'], $v)
: $this->transEsc->__invoke($v);
$parts[] = $k . ': "' . addslashes($translation) . '"';
$parts[] = '"' . $k . '": "' . addslashes($translation) . '"';
}
return '{' . implode(',', $parts) . '}';
}
......
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