I've got some static text that is dynamically being displayed on the frontend with JavaScript.
Now considering the site has 3 locales, how do I best translate those static texts?
I know I could put the JavaScript code in my twig files and use the translate filter, but that is what I'm trying to avoid as I like to keep the HTML & JavaScript separated.
Is there a way to pass on certain messages to a script?
From this answer, I learned there's such a thing as Craft.t
but I can't seem to access it from the frontend. Can it be included?
EDIT - To clarify what I'm looking for, it's something in the likes off this Wordpress concept, where you can pass some variables from the server to a javascript script. It would allow me to make some global fields to store the translations in, and make those translations editable from the backend. But I'm guessing that's not possible?