I am not strong in java, so this may be an easy answer. I am trying to incorporate a seemingly straigtforward i18n function to an existing site.
I have copied the gettext.js file from node-modules/gettext.js into my /js directory and it is loading correctly in the header of my page. (I can see it under sources, and a tried renaming it to provoke an error and that happens, so I know the script is loading.)
<script src="{{{uiRootPath}}}/js/vendor/gettext.js"></script>
<script>
var i18n = window.i18n();
</script>
But if i try to run this as suggested above (or directly in the console), I get a message: (index):40 Uncaught TypeError: window.i18n is not a function. I haven't even gotten around to loading the json messages.
Should this be loaded somewhere or somehow else? Is this an npm issue? Thank you!