A Little Backstory
Our application, RezTrip, is in the process of being internationalized. Since it is a GWT based application, we chose to use the GWT static string internationalization features. Unfortunately, these features only work on the GWT client-side and we have lots of other client-facing strings that need to be internationalized (client emails, legacy HTML pages, etc.).
The gwt-i18n-server Library
A quick Google search on the subject of "server-side GWT i18n" found a library called gwt-i18n-server. This library gives the server-side support for the GWT static string i18n interfaces and properties files. We quickly incorporated the library into RezTrip and found it was pretty buggy. Worse yet, development on the library had stagnated and hadn't been updated in over a year. This is where I come in. Not satisfied with admitting defeat and implementing a separate i18n system just for server-side content, I decided to fork the gwt-i18n-server library and fix the bugs.
Enter Hermes

- GWT Constants, ConstantsWithLookup, and Messages interface support
- Plural forms support
- Date and number sub-formatting
- UTF-8 properties file support
ExampleMessages messages = Hermes.get(ExampleMessages.class, "en-us");Hermes also has a complete suite of unit tests to make sure the library is functioning as intended. The best part of Hermes it is completely free and open source, licensed under the same LGPL license as the gwt-i18n-server library. I encourage anyone using GWT to check out the library. To grab a copy or download/view the source, visit the Hermes page on GitHub. If you do use Hermes, feel free to let us know how it goes.
messages.sampleString();
Thanks for this post. I'm trying to use hermes in my application. It works in dev mode but not when deployed to the server.
ReplyDeleteIn dev mode I get this message:
"[WARN] Server class 'com.ibm.icu.util.ULocale' could not be found in the web app, but was found on the system classpath"
and then it loads ULocale from gwt-dev.jar.
In production, however, it won't work because gwt-dev.jar is not being deployed.
gwt-dev.jar is not supposed to be deployed as all what server side needs is in gwt-server.jar.
So, how do you get this working in your application?
Peter
Is it threadsafe?
ReplyDeleteHi,
ReplyDeleteYour code isn't thread safe. I think You should mention it somewhere in docs...especially since it's meant to be used in server(e.g. cache and createProxy in Hermes.java)
Anyway thanks for the project. We are using it too. :)