IDEMPIERE-865 log.saveError: problem with translation

This commit is contained in:
Carlos Ruiz 2013-05-01 09:49:20 -05:00
parent e18d9ed666
commit b7e29b1675
1 changed files with 11 additions and 2 deletions

View File

@ -1286,9 +1286,11 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
StringBuilder sb = new StringBuilder();
String msg = e.getMessage();
StringBuilder adMessage = new StringBuilder();
String origmsg = null;
if (msg != null && msg.length() > 0)
{
adMessage.append(Msg.getMsg(Env.getCtx(), e.getAD_Message()));
origmsg = Msg.getMsg(Env.getCtx(), e.getAD_Message());
adMessage.append(origmsg);
}
String info = e.getInfo();
if (info != null && info.length() > 0)
@ -1320,7 +1322,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
}
adMessage.append(tail);
}
sb.append(MessageFormat.format(adMessage.toString(), arguments));
String adMessageQuot = Util.replace(adMessage.toString(), "'", "''");
if ( arguments.length == 1
&& origmsg != null
&& origmsg.equals(arguments[0])) { // check dup message
sb.append(origmsg);
} else {
sb.append(MessageFormat.format(adMessageQuot, arguments));
}
}
else
{