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
|
b
|
import java.util.LinkedList;
|
| 20 | 20 | import java.util.List; |
| 21 | 21 | import java.util.Locale; |
| 22 | 22 | import java.util.Map; |
| | 23 | import java.util.MissingResourceException; |
| 23 | 24 | |
| 24 | 25 | import javax.swing.JFrame; |
| 25 | 26 | import javax.swing.JOptionPane; |
| … |
… |
public class MainApplication extends Main {
|
| 178 | 179 | Locale.setDefault(new Locale(localeName)); |
| 179 | 180 | } |
| 180 | 181 | |
| 181 | | i18n = I18nFactory.getI18n(MainApplication.class); |
| | 182 | try { |
| | 183 | i18n = I18nFactory.getI18n(MainApplication.class); |
| | 184 | } catch (MissingResourceException mre) { |
| | 185 | System.err.println("Notice: No translation available for your locale ("+Locale.getDefault()+")."); |
| | 186 | i18n = I18nFactory.getI18n(MainApplication.class, Locale.getDefault(), I18nFactory.FALLBACK); |
| | 187 | } |
| 182 | 188 | |
| 183 | 189 | SplashScreen splash = new SplashScreen(Main.pref.getBoolean("draw.splashscreen", true)); |
| 184 | 190 | |