Index: /trunk/src/org/openstreetmap/josm/tools/I18n.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 2535)
+++ /trunk/src/org/openstreetmap/josm/tools/I18n.java	(revision 2536)
@@ -9,6 +9,8 @@
 import java.util.MissingResourceException;
 import java.util.Vector;
+import java.util.logging.Logger;
 
 import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.xnap.commons.i18n.I18nFactory;
 
@@ -19,4 +21,5 @@
  */
 public class I18n {
+    static private final Logger logger = Logger.getLogger(I18n.class.getName());
 
     /* Base name for translation data. Used for detecting available translations */
@@ -59,5 +62,5 @@
         if (i18n == null)
             return n == 1 ? tr(text, objects) : tr(pluralText, objects);
-        return filter(i18n.trn(text, pluralText, n, objects));
+            return filter(i18n.trn(text, pluralText, n, objects));
     }
 
@@ -65,5 +68,5 @@
         if (i18n == null)
             return n == 1 ? tr(text) : tr(pluralText);
-        return filter(i18n.trn(text, pluralText, n));
+            return filter(i18n.trn(text, pluralText, n));
     }
 
@@ -71,5 +74,5 @@
         if (i18n == null)
             return n == 1 ? tr(text, objects) : tr(pluralText, objects);
-        return i18n.trnc(ctx, text, pluralText, n, objects);
+            return i18n.trnc(ctx, text, pluralText, n, objects);
     }
 
@@ -77,5 +80,5 @@
         if (i18n == null)
             return n == 1 ? tr(text) : tr(pluralText);
-        return i18n.trnc(ctx, text, pluralText, n);
+            return i18n.trnc(ctx, text, pluralText, n);
     }
 
@@ -92,9 +95,13 @@
      * @return an array of locale objects.
      */
-    public static final Locale[] getAvailableTranslations() {
+    public static final Locale[] getAvailableTranslations(ProgressMonitor monitor) {
+        monitor.indeterminateSubTask(tr("Loading available locales..."));
         Vector<Locale> v = new Vector<Locale>();
         LinkedList<String>str = new LinkedList<String>();
         Locale[] l = Locale.getAvailableLocales();
+        monitor.subTask(tr("Checking locales..."));
+        monitor.setTicksCount(l.length);
         for (int i = 0; i < l.length; i++) {
+            monitor.setCustomText(tr("Checking translation for locale ''{0}''", l[i].getDisplayName()));
             String loc = l[i].toString();
             String cn = TR_BASE + loc;
@@ -105,13 +112,16 @@
             } catch (ClassNotFoundException e) {
             }
+            monitor.worked(1);
         }
         /* hmm, don't know why this is necessary */
         try {
-          if(!str.contains("nb"))
-            v.add(new Locale("nb"));
+            if(!str.contains("nb")) {
+                v.add(new Locale("nb"));
+            }
         } catch (Exception e) {}
         try {
-          if(!str.contains("gl"))
-            v.add(new Locale("gl"));
+            if(!str.contains("gl")) {
+                v.add(new Locale("gl"));
+            }
         } catch (Exception e) {}
         l = new Locale[v.size()];
@@ -145,5 +155,7 @@
             Locale l;
             Locale d = Locale.getDefault();
-            if (localeName.equals("he")) localeName = "iw_IL";
+            if (localeName.equals("he")) {
+                localeName = "iw_IL";
+            }
             int i = localeName.indexOf('_');
             if (i > 0) {
@@ -158,5 +170,5 @@
                 if (!l.getLanguage().equals("en")) {
                     System.out.println(tr("Unable to find translation for the locale {0}. Reverting to {1}.",
-                    l.getDisplayName(), d.getDisplayName()));
+                            l.getDisplayName(), d.getDisplayName()));
                     Locale.setDefault(d);
                 } else {
