use of io.github.ihongs.CoreLocale in project HongsCORE by ihongs.
the class NaviMap method getMenuTranslated.
public List<Map> getMenuTranslated(String name, int d, Set<String> rolez) {
CoreLocale lang = getCurrTranslator();
Map menu = getMenu(name);
if (menu == null) {
throw new NullPointerException("Menu for href '" + name + "' is not in " + this.name);
}
return getMenuTranslated((Map) menu.get("menus"), rolez, lang, d, 0);
}
use of io.github.ihongs.CoreLocale in project HongsCORE by ihongs.
the class NaviMap method getRoleTranslated.
public List<Map> getRoleTranslated(String name, int d, Set<String> rolez) {
CoreLocale lang = getCurrTranslator();
Map menu = getMenu(name);
if (menu == null) {
throw new NullPointerException("Menu for href '" + name + "' is not in " + this.name);
}
return getRoleTranslated((Map) menu.get("menus"), rolez, lang, d, 0);
}
use of io.github.ihongs.CoreLocale in project HongsCORE by ihongs.
the class AuthKit method getWrong.
/**
* 快速输出登录的错误
* @param k 字段
* @param w 错误
* @return
*/
public static Map getWrong(String k, String w) {
CoreLocale l = CoreLocale.getInstance("master");
Map e = new HashMap();
if (k != null && !"".equals(k)) {
Map m = new HashMap();
m.put(k, new Wrong(w));
e.put("errs", new Wrongs(m).setLocalizedContext(l).getErrors());
e.put("msg", l.translate(w));
} else {
e.put("msg", l.translate(w));
}
e.put("ok", false);
return e;
}
use of io.github.ihongs.CoreLocale in project HongsCORE by ihongs.
the class DeptAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
int rn = model.delete(rd);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.delete.dept.success", null, Integer.toString(rn));
helper.reply(ms, rn);
}
use of io.github.ihongs.CoreLocale in project HongsCORE by ihongs.
the class FormAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
int rn = model.delete(rd);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("matrix");
String ms = ln.translate("core.delete.form.success", null, Integer.toString(rn));
helper.reply(ms, rn);
}
Aggregations