Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT I18N on the server side

What is the best way to implement GWT Server Side Internationalization?

  1. Use native Java properties files (not sure how to read and how to locate the right language file) (unicode string need to be ASCII encoded)

  2. Use GWTI18N.java - GWT module which gives you seamless use of GWT I18N on both the client and the server and uses "java.lang.reflect.Proxy method"

  3. Use Kotori I18N - ...

  4. Other ideas?

How can I find and pass localization from client to sever?

On the server side I have an Servlet which still doesn't use any GWT dependant source, is it better not to do so?

like image 815
Julian Popov Avatar asked Aug 17 '10 14:08

Julian Popov


1 Answers

I found this solution and it looks very good

gwt-i18n-server - Provides a simple support of gwt i18n feature on the server side

The aim is to permit to the GWT developer to use their Constants and Messages interfaces on the server side (See internationzation). The implementation is based on java reflect api. It loads the properties files from the classpath (same folder than the interface). It supports Constants, ConstantsWithLookup, Messages (plural too). The licence is LGPL.

Client current locale can be found this way:

LocaleInfo.getCurrentLocale().getLocaleName()
like image 155
Julian Popov Avatar answered Nov 06 '22 14:11

Julian Popov