Hey,
might seem like an odd question, but is it possible somehow to encode all translations from Hugo into a JSON and rendering that within a script tag?
That way I could use them within Alpine js…
{{ .AllTranslations | jsonify }} seems to run out of memory. New to Hugo so not sure if there’s an alternative approach to this.
Basically I’d be happy with a json version of the language file for the currently active language (e.g. i18n/en.yaml)
Edit: What I’m not looking for would be a page translation. I just want some easy way to use the same translated strings in both js and hugo generated html.