I'd suggest using the
json_encode function inside the template, and keeping the same translation key right through from XML to JS rather than introducing another set of symbolic names -- that way you can just do something like this in the PHP...
$templateMgr->assign('translationStrings', array_combine($keys = array(
...other keys here...
...then move the JSON encoding into the template file, similar to this example, but using instead...
$.pkp.cons object rather than creating a fresh one.
Off the top of my head, you might have one or two places where escaping is needed or should be moved closer to the area it's needed. This is tricky to get right, and keeping the escaping nearest the place where it has to be applied (e.g. keeping the
Public Knowledge Project Team