Ignore:
Timestamp:
2008-10-28T22:13:12+01:00 (15 years ago)
Author:
mfloryan
Message:

Changed infrastructure of JOSM translations. lang-* plugins are now
obsolete. Translations are integrated into core via lang-translation.jar
in /lib directory. Ant scripts are updated automated build may require
an update. Source translation files are still kept in JOSM SVN repo.

File:
1 edited

Legend:

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

    r1048 r1058  
    33package org.openstreetmap.josm.gui;
    44
     5import org.xnap.commons.i18n.I18nFactory;
     6import static org.openstreetmap.josm.tools.I18n.i18n;
    57import static org.openstreetmap.josm.tools.I18n.tr;
     8
    69
    710import java.awt.EventQueue;
     
    1619import java.util.LinkedList;
    1720import java.util.List;
     21import java.util.Locale;
    1822import java.util.Map;
    1923
     
    2529import org.openstreetmap.josm.tools.BugReportExceptionHandler;
    2630import org.openstreetmap.josm.tools.ImageProvider;
     31
    2732/**
    2833 * Main window class application.
     
    159164                        Main.pref.save();
    160165                }
     166               
     167
     168                String localeName = null; //The locale to use
     169       
     170                //Check if passed as parameter
     171                if(args.containsKey("language"))
     172                    localeName = (String)(args.get("language").toArray()[0]);
     173               
     174                //TODO: Check preferences for language
     175       
     176                //If override then set new default locale - otherwise, override
     177        if (localeName != null) {
     178            Locale.setDefault(new Locale(localeName));
     179        }
     180       
     181        i18n = I18nFactory.getI18n(MainApplication.class);
     182               
    161183                SplashScreen splash = new SplashScreen(Main.pref.getBoolean("draw.splashscreen", true));
    162 
    163                 String language = null;
    164                 if(args.containsKey("language"))
    165                         language = (String)(args.get("language").toArray()[0]);
    166184
    167185                splash.setStatus(tr("Activating updated plugins"));
     
    174192                // load the early plugins
    175193                splash.setStatus(tr("Loading early plugins"));
    176                 Main.loadPlugins(true, language);
     194                Main.loadPlugins(true);
    177195
    178196                splash.setStatus(tr("Setting defaults"));
     
    183201                final Main main = new MainApplication(mainFrame);
    184202                splash.setStatus(tr("Loading plugins"));
    185                 Main.loadPlugins(false, null);
     203                Main.loadPlugins(false);
    186204                toolbar.refreshToolbarControl();
    187205
Note: See TracChangeset for help on using the changeset viewer.