From 7738dda49566de9b5db10fb253b7d0a5f34ed856 Mon Sep 17 00:00:00 2001
From: Michel Marti <mcdmx@users.sf.net>
Date: Wed, 29 Oct 2008 12:41:11 +0100
Subject: [PATCH] I18n: Don't abort if translation resource bundle is missing.

Instead of aborting with a MissingResourceException, we should fall back
to a default resource bundle that returns the passed text.
---
 .../openstreetmap/josm/gui/MainApplication.java    |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/org/openstreetmap/josm/gui/MainApplication.java b/src/org/openstreetmap/josm/gui/MainApplication.java
index d2e53c6..da88927 100644
--- a/src/org/openstreetmap/josm/gui/MainApplication.java
+++ b/src/org/openstreetmap/josm/gui/MainApplication.java
@@ -20,6 +20,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.MissingResourceException;
 
 import javax.swing.JFrame;
 import javax.swing.JOptionPane;
@@ -178,7 +179,12 @@ public class MainApplication extends Main {
             Locale.setDefault(new Locale(localeName));
         }
         
-        i18n = I18nFactory.getI18n(MainApplication.class);
+        try {
+            i18n = I18nFactory.getI18n(MainApplication.class);
+        } catch (MissingResourceException mre) {
+            System.err.println("Notice: No translation available for your locale ("+Locale.getDefault()+").");
+            i18n = I18nFactory.getI18n(MainApplication.class, Locale.getDefault(), I18nFactory.FALLBACK);
+        }
 		
 		SplashScreen splash = new SplashScreen(Main.pref.getBoolean("draw.splashscreen", true));
 
-- 
1.5.6.5

