Ignore:
Timestamp:
2009-07-17T20:53:35+02:00 (16 years ago)
Author:
stoecker
Message:

cleanup license and contributions a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r1677 r1802  
    33package org.openstreetmap.josm.gui;
    44
    5 import static org.openstreetmap.josm.tools.I18n.i18n;
    65import static org.openstreetmap.josm.tools.I18n.tr;
    76
     
    1514import java.util.LinkedList;
    1615import java.util.List;
    17 import java.util.Locale;
    1816import java.util.Map;
    19 import java.util.MissingResourceException;
    2017
    2118import javax.swing.JFrame;
     
    2522import org.openstreetmap.josm.tools.BugReportExceptionHandler;
    2623import org.openstreetmap.josm.tools.ImageProvider;
    27 import org.xnap.commons.i18n.I18nFactory;
     24import org.openstreetmap.josm.tools.I18n;
    2825
    2926/**
     
    6360     */
    6461    public static void main(final String[] argArray) {
    65         /* try initial language settings, may be changed later again */
    66         try { i18n = I18nFactory.getI18n(MainApplication.class); }
    67         catch (MissingResourceException ex) { Locale.setDefault(Locale.ENGLISH);}
     62        I18n.init();
    6863
    6964        Thread.setDefaultUncaughtExceptionHandler(new BugReportExceptionHandler());
     
    9287        Main.pref.init(args.containsKey("reset-preferences"));
    9388
    94         String localeName = null; // The locale to use
    95 
    9689        // Check if passed as parameter
    9790        if (args.containsKey("language"))
    98             localeName = (String)(args.get("language").toArray()[0]);
    99 
    100         if (localeName == null)
    101             localeName = Main.pref.get("language", null);
    102 
    103         if (localeName != null) {
    104             Locale l;
    105             Locale d = Locale.getDefault();
    106             if (localeName.equals("he")) localeName = "iw_IL";
    107             int i = localeName.indexOf('_');
    108             if (i > 0) {
    109                 l = new Locale(localeName.substring(0, i), localeName.substring(i + 1));
    110             } else {
    111                 l = new Locale(localeName);
    112             }
    113             try {
    114                 Locale.setDefault(l);
    115                 i18n = I18nFactory.getI18n(MainApplication.class);
    116             } catch (MissingResourceException ex) {
    117                 if (!l.getLanguage().equals("en")) {
    118                     System.out.println(tr("Unable to find translation for the locale {0}. Reverting to {1}.",
    119                     l.getDisplayName(), d.getDisplayName()));
    120                     Locale.setDefault(d);
    121                 } else {
    122                     i18n = null;
    123                 }
    124             }
    125         }
     91            I18n.set((String)(args.get("language").toArray()[0]));
     92        else
     93            I18n.set(Main.pref.get("language", null));
    12694
    12795        if (argList.contains("--help") || argList.contains("-?") || argList.contains("-h")) {
Note: See TracChangeset for help on using the changeset viewer.