THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The text will be translated into the user's localelanguage.
Translating Text In Mini-Language
...
Translating text in Java is accomplished by using the org.ofbiz.base.util.UtilProperties
class. Here is an example:
Code Block | ||||
---|---|---|---|---|
| ||||
public static Map<String, Object> myJavaService(DispatchContext ctx, Map<String, ?> context) {
Locale locale = (Locale) context.get("locale");
try {
// Do something risky
...
} catch (Exception e) {
return ServiceUtil.returnError(UtilProperties.getMessage(MyUiLabels, "RiskyErrorMessage", locale));
}
...
}
|
...