THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
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(String myLabel = UtilProperties.getMessage(MyUiLabelsCommonUiLabels, "RiskyErrorMessageCommonAddNew", locale)); } ... } |