Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Saving i18n strings in hidden fields

 
Ranch Hand
Posts: 42
Postgres Database Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
We are working on a project where we have to load i18nstrings using fmt tags for instance, on the server-side. We do not have client side i18n strings, and we import these keys in jsps. The issue arises when we have to use these keys in combination with javascript. The only possible way that comes to my mind to separate js from jsp code is to use hidden input fields holding the i18n string values and reading the inputs withing javascript, but i am thinking of the html content that is getting bigger with all these hidden inputs. Is this a good practice or is there other way to achieve this (javascript code separation from jsp)? I know a solution would be to internationalize the strings in javascript code, but that is not possible at this moment.

Thank you,
Alex G.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic