use of app.hongs.CoreLocale in project HongsCORE by ihongs.
the class JointGate method getRspMsg.
/**
* 获取返回消息
* @param helper
* @param ett
* @param opr
* @param num
* @return
* @throws HongsException
*/
protected String getRspMsg(ActionHelper helper, IEntity ett, String opr, int num) throws HongsException {
ActionRunner runner = (ActionRunner) helper.getAttribute(ActionRunner.class.getName());
CoreLocale locale = CoreLocale.getInstance().clone();
String mod = runner.getModule();
String ent = runner.getEntity();
String cnt = Integer.toString(num);
String key = "fore." + opr + "." + ent + ".success";
locale.fill(mod);
if (!locale.containsKey(key)) {
key = "fore." + opr + ".success";
String tit = getName(locale, mod, ent);
return locale.translate(key, tit, cnt);
} else {
return locale.translate(key, /**/
cnt);
}
}
use of app.hongs.CoreLocale in project HongsCORE by ihongs.
the class FormSet method getEnumTranslated.
public Map getEnumTranslated(String namc) {
Map items = enums.get(namc);
Map itemz = new LinkedHashMap();
if (items == null)
return itemz;
CoreLocale lang = getCurrTranslator();
itemz.putAll(items);
for (Object o : itemz.entrySet()) {
Map.Entry e = (Map.Entry) o;
String k = (String) e.getKey();
String n = (String) e.getValue();
if (n == null || "".equals(n)) {
n = "fore.enum." + name + "." + namc + "." + k;
}
e.setValue(lang.translate(n));
}
return itemz;
}
Aggregations