Search in sources :

Example 21 with CoreLocale

use of io.github.ihongs.CoreLocale in project HongsCORE by ihongs.

the class DBAction method getRspMsg.

/**
 * 获取返回消息
 * @param helper
 * @param ett
 * @param opr
 * @param num
 * @return
 * @throws HongsException
 */
protected String getRspMsg(ActionHelper helper, Model ett, String opr, int num) throws HongsException {
    ActionRunner runner = (ActionRunner) helper.getAttribute(ActionRunner.class.getName());
    String mod = runner.getModule();
    String ent = runner.getEntity();
    String cnt = Integer.toString(num);
    CoreLocale locale = CoreLocale.getInstance().clone();
    locale.fill(mod);
    String key = "fore." + opr + "." + ent + ".success";
    if (!locale.containsKey(key)) {
        key = "fore." + opr + /**/
        ".success";
    }
    return locale.translate(key, null, cnt);
}
Also used : ActionRunner(io.github.ihongs.action.ActionRunner) CoreLocale(io.github.ihongs.CoreLocale)

Aggregations

CoreLocale (io.github.ihongs.CoreLocale)21 Map (java.util.Map)15 Action (io.github.ihongs.action.anno.Action)12 HashMap (java.util.HashMap)11 CommitSuccess (io.github.ihongs.action.anno.CommitSuccess)7 NaviMap (io.github.ihongs.action.NaviMap)5 IAction (io.github.ihongs.dh.IAction)4 File (java.io.File)4 LinkedHashMap (java.util.LinkedHashMap)4 HongsException (io.github.ihongs.HongsException)2 ActionRunner (io.github.ihongs.action.ActionRunner)2 Verify (io.github.ihongs.action.anno.Verify)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 Wrong (io.github.ihongs.util.verify.Wrong)1 Wrongs (io.github.ihongs.util.verify.Wrongs)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Comparator (java.util.Comparator)1