Internationalization is important for us. So in choosing a template system for emails and other non-web (we use spring webmvc/JSP for web) templating needs, I need to know which handles translating phrases and formatting numbers, currency, dates, etc best. I also read StringTemplate has a focus on internationalization and localizat开发者_如何学Pythonion. But I haven't heard much about StringTemplate.
Is Velocity or FreeMarker better? I know FreeMarker boasts about its internationalization capabilities, but is Velocity really just as good?
Freemarker has more i18n support built into the core engine. However, Velocity with the addition of the VelocityTools project offers more i18n functionality, i believe. Spring, too, provides some i18n support that can be used in Velocity.
Personally, my preference for i18n in templating is to use the VelocityTools support, but i'm biased because i wrote most of that. In particular, i'm fond of the ResourceTool ($text) and the DateTool ($date) for their power and flexibility.
I've never looked into StringTemplate's i18n abilities, but they usually make very solid stuff, if a bit more restrictive than i prefer. If they said they focus on i18n and whatnot, i'd believe them.
精彩评论