Is there a way for me to include flask jinja enclosed babel translations inside of my javascript file and load it in as if it was a static file? Or is the only way for me to do this to include this part of my code in the .html template file? I'm asking because I want to abstract this part of my code out so it can be reused in other areas, but if I do this, I lose the translations and am not able to obtain necessary information.
Please advice. I want to import javascript file but also be able to use
var x = {{_('translation here')}}
inside of my javascript file and also be able to pull out the translations via babel to be later internationalized via .po file.
Thanks! Cheers