From b594d516dac69eebcccdc743933880b00fb6d44c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 12 Feb 2020 17:02:16 +0000 Subject: [PATCH] JAL-1354 JAL-3528 report missing keys for MessageManager.format calls --- src/jalview/util/MessageManager.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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); } /** -- 1.7.10.2