Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

93
Views
How to add gettext.js to existing website?

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.

gettext.js

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!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!