From a2d5b5dbe13f00538a80237568a5c22f1935428d Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 6 Apr 2008 12:55:55 +0000 Subject: [PATCH] emit warnings if translation is missing git-svn-id: http://trooper/svn/projects/jSite/trunk@619 c3eda9e8-030b-0410-8277-bc7414b0a119 --- src/net/pterodactylus/jsite/i18n/I18n.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/net/pterodactylus/jsite/i18n/I18n.java b/src/net/pterodactylus/jsite/i18n/I18n.java index 504dc88..e069fa5 100644 --- a/src/net/pterodactylus/jsite/i18n/I18n.java +++ b/src/net/pterodactylus/jsite/i18n/I18n.java @@ -87,7 +87,8 @@ public class I18n { String value = null; value = currentLanguage.getProperty(key); if (value == null) { - return key; + System.out.println("please fix “" + key + "”!"); + return null; } if ((parameters != null) && (parameters.length > 0)) { return MessageFormat.format(value, parameters); @@ -106,10 +107,7 @@ public class I18n { */ public static int getKey(String key) { String value = currentLanguage.getProperty(key); - if (value == null) { - return -1; - } - if (value.startsWith("VK_")) { + if ((value != null) && value.startsWith("VK_")) { try { Field field = KeyEvent.class.getField(value); return field.getInt(null); @@ -123,7 +121,8 @@ public class I18n { /* ignore. */ } } - return value.toUpperCase().charAt(0); + System.err.println("please fix “" + key + "”!"); + return KeyEvent.VK_UNDEFINED; } /** -- 2.7.4