Output all translation strings to javascript object How can I output all translation strings to a javascript object?

Of course I could do it one by one like this:

&lt;script&gt;
translations.string = {{ "string" | t }};

...
&lt;/script&gt;


But I want to just loop through all translation strings. Is there some kind of twig object containing all these strings?
Not that I'm aware of. You would have to create a plugin that scrapes all of your template files for translatable strings, that then also makes those strings available to twig templates.