From: Jim Procter Date: Wed, 12 Feb 2020 17:02:16 +0000 (+0000) Subject: JAL-1354 JAL-3528 report missing keys for MessageManager.format calls X-Git-Tag: Develop-2_11_2_0-d20201215~101^2~20 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b594d516dac69eebcccdc743933880b00fb6d44c;p=jalview.git JAL-1354 JAL-3528 report missing keys for MessageManager.format calls --- diff --git a/src/jalview/util/MessageManager.java b/src/jalview/util/MessageManager.java index 3494181..2efaeb6 100644 --- a/src/jalview/util/MessageManager.java +++ b/src/jalview/util/MessageManager.java @@ -92,12 +92,25 @@ public class MessageManager public static String formatMessage(String key, Object... params) { - return MessageFormat.format(rb.getString(key), params); + try + { + return MessageFormat.format(rb.getString(key), params); + } catch (Exception e) + { + log.warning("I18N missing: " + loc + "\t" + key); + + } + String value = "[missing key] " + key + ""; + for (Object p : params) + { + value += " '" + p.toString() + "'"; + } + return value; } public static String formatMessage(String key, String[] params) { - return MessageFormat.format(rb.getString(key), (Object[]) params); + return formatMessage(rb.getString(key), (Object[]) params); } /**