Ignore:
Timestamp:
2009-05-07T20:00:43+02:00 (15 years ago)
Author:
stoecker
Message:

close #2535 - patch by podolsir - NPE for missing icon, update translations, added et, nb, gl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r1169 r1583  
    66import java.util.Comparator;
    77import java.util.Locale;
     8import java.util.LinkedList;
    89import java.util.Vector;
    910
     
    5859    public static final Locale[] getAvailableTranslations() {
    5960        Vector<Locale> v = new Vector<Locale>();
     61        LinkedList<String>str = new LinkedList<String>();
    6062        Locale[] l = Locale.getAvailableLocales();
    6163        for (int i = 0; i < l.length; i++) {
    62             String cn = TR_BASE + l[i];
     64            String loc = l[i].toString();
     65            String cn = TR_BASE + loc;
    6366            try {
    6467                Class.forName(cn);
    6568                v.add(l[i]);
     69                str.add(loc);
    6670            } catch (ClassNotFoundException e) {
    6771            }
    6872        }
     73        /* hmm, don't know why this is necessary */
     74        try {
     75          if(!str.contains("nb"))
     76            v.add(new Locale("nb"));
     77        } catch (Exception e) {}
     78        try {
     79          if(!str.contains("gl"))
     80            v.add(new Locale("gl"));
     81        } catch (Exception e) {}
    6982        l = new Locale[v.size()];
    7083        l = v.toArray(l);
Note: See TracChangeset for help on using the changeset viewer.