• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Velocity with localization

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone help me out for using velocity with localization ?
I dont know the proper usage of velocity with localization


Requirement : Based on my locale (en or fr)i want to access the template (.vm file)
I am able to get the file using following

Velocity.mergeTemplate("./src/velocity_sample_en.properties", context, w);
StringWriter w2 = new StringWriter();
Velocity.evaluate(context, w2, "mystring", s);

velocity_sample_en.properties file contains
ENG_STRING = We are using $project $name to render this >> ENGLISH.

and Output is
We are using Jakarta Velocity to render this >> ENGLISH.

So $project and $name i have added in VelocityContext.

Please suggest the appropriate solution for it.

Thanks
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic