I'm Python Django devel
I want to try a little Java.
In django, I used my translation as follows:
from django.utils.translation import ugettext_lazy as _
and then, if the translation is specified in the .po file in the locale / en / django.po file
_("hello world")
Question 1: Is there a similar thing in Java?
I found those:
but not one of them is what I'm looking for
I did as in the example
import java.util.ResourceBundle;
import java.util.MissingResourceException;
public class i18n {
private static ResourceBundle myResources = ResourceBundle.getBundle("messages");
public static String _ (String originalStr) {
try {
return myResources.getString(originalStr);
} catch (MissingResourceException e) {
return originalStr;
}
}
}
And later
import static i18n._;
Question 2: But where to put the messages.properties file?
Question 3: This exception catching part seems to be down, do you know why?
4: JavaEE i18n?
, java EE , i18 , , java, . , , . Google Wave Protocol, .
5: JavaEE ?
-, , , . , . . , sql- , WTF...