Changeset 1058 in josm
- Timestamp:
- 2008-10-28T22:13:12+01:00 (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/build.xml
r1023 r1058 19 19 <fileset refid="josm_required_libs" /> 20 20 </unjar> 21 22 <!-- translation --> 23 <unjar dest="build"> 24 <fileset dir="lib"> 25 <include name="josm-translation.jar" /> 26 </fileset> 27 </unjar> 21 28 22 29 <!-- images --> -
trunk/src/org/openstreetmap/josm/Main.java
r1047 r1058 219 219 * early plugins are loaded (before constructor). 220 220 */ 221 public static void loadPlugins(boolean early , String lang) {221 public static void loadPlugins(boolean early) { 222 222 List<String> plugins = new LinkedList<String>(); 223 223 if (Main.pref.hasKey("plugins")) … … 226 226 plugins.addAll(Arrays.asList(System.getProperty("josm.plugins").split(","))); 227 227 228 String [] oldplugins = new String[] {"mappaint", "unglueplugin"};228 String [] oldplugins = new String[] {"mappaint", "unglueplugin", "lang-de","lang-en_GB","lang-fr","lang-it","lang-pl","lang-ro","lang-ru"}; 229 229 for(String p : oldplugins) 230 230 { … … 235 235 } 236 236 } 237 if(lang != null)238 {239 for(String p : plugins)240 {241 if(p.startsWith("lang-"))242 {243 plugins.remove(p);244 break;245 }246 }247 if(!lang.equals("en"))248 plugins.add("lang-"+lang);249 }250 237 251 238 if (plugins.isEmpty()) 252 239 return; 240 253 241 SortedMap<Integer, Collection<PluginInformation>> p = new TreeMap<Integer, Collection<PluginInformation>>(); 254 242 for (String pluginName : plugins) { -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r1048 r1058 3 3 package org.openstreetmap.josm.gui; 4 4 5 import org.xnap.commons.i18n.I18nFactory; 6 import static org.openstreetmap.josm.tools.I18n.i18n; 5 7 import static org.openstreetmap.josm.tools.I18n.tr; 8 6 9 7 10 import java.awt.EventQueue; … … 16 19 import java.util.LinkedList; 17 20 import java.util.List; 21 import java.util.Locale; 18 22 import java.util.Map; 19 23 … … 25 29 import org.openstreetmap.josm.tools.BugReportExceptionHandler; 26 30 import org.openstreetmap.josm.tools.ImageProvider; 31 27 32 /** 28 33 * Main window class application. … … 159 164 Main.pref.save(); 160 165 } 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 161 183 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]);166 184 167 185 splash.setStatus(tr("Activating updated plugins")); … … 174 192 // load the early plugins 175 193 splash.setStatus(tr("Loading early plugins")); 176 Main.loadPlugins(true , language);194 Main.loadPlugins(true); 177 195 178 196 splash.setStatus(tr("Setting defaults")); … … 183 201 final Main main = new MainApplication(mainFrame); 184 202 splash.setStatus(tr("Loading plugins")); 185 Main.loadPlugins(false , null);203 Main.loadPlugins(false); 186 204 toolbar.refreshToolbarControl(); 187 205 -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r758 r1058 35 35 if (i18n == null) 36 36 return n == 1 ? tr(text, objects) : tr(pluralText, objects); 37 37 return i18n.trn(text, pluralText, n, objects); 38 38 } 39 39 … … 41 41 if (i18n == null) 42 42 return n == 1 ? tr(text) : tr(pluralText); 43 43 return i18n.trn(text, pluralText, n); 44 44 } 45 45 }
Note:
See TracChangeset
for help on using the changeset viewer.