posted 15 years ago
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