Changeset 1755 in josm for trunk/src/org
- Timestamp:
- 2009-07-09T10:53:33+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r1750 r1755 472 472 } 473 473 474 static public String getLanguageCodeU()475 {476 String languageCode = getLanguageCode();477 if(languageCode.equals("en"))478 return "";479 return languageCode.substring(0,1).toUpperCase() + languageCode.substring(1) + ":";480 }481 static public String getLanguageCode()482 {483 String full = Locale.getDefault().toString();484 if (full.equals("iw_IL"))485 return "he";486 /* list of non-single codes supported by josm */487 else if (full.equals("en_GB"))488 return full;489 return Locale.getDefault().getLanguage();490 }491 492 474 static public void saveGuiGeometry() { 493 475 // save the current window geometry -
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r1598 r1755 31 31 import org.openstreetmap.josm.tools.GBC; 32 32 import org.openstreetmap.josm.tools.ImageProvider; 33 import org.openstreetmap.josm.tools.LanguageInfo; 33 34 import org.openstreetmap.josm.tools.UrlLabel; 34 35 import org.openstreetmap.josm.tools.Shortcut; … … 91 92 static public void setUserAgent() { 92 93 Properties sysProp = System.getProperties(); 93 sysProp.put("http.agent", "JOSM/1.5 ("+(version.equals(tr("UNKNOWN"))?"UNKNOWN":version)+" "+ Main.getLanguageCode()+")");94 sysProp.put("http.agent", "JOSM/1.5 ("+(version.equals(tr("UNKNOWN"))?"UNKNOWN":version)+" "+LanguageInfo.getLanguageCode()+")"); 94 95 System.setProperties(sysProp); 95 96 } -
trunk/src/org/openstreetmap/josm/actions/HelpAction.java
r1676 r1755 32 32 import org.openstreetmap.josm.Main; 33 33 import org.openstreetmap.josm.tools.ImageProvider; 34 import org.openstreetmap.josm.tools.LanguageInfo; 34 35 import org.openstreetmap.josm.tools.OpenBrowser; 35 36 import org.openstreetmap.josm.tools.WikiReader; … … 46 47 } 47 48 48 private String languageCode = Main.getLanguageCodeU();49 private String languageCode = LanguageInfo.getLanguageCodeWiki(); 49 50 private JFrame helpBrowser = new JFrame(tr("JOSM Online Help")); 50 51 private String baseurl = Main.pref.get("help.baseurl", "http://josm.openstreetmap.de"); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1728 r1755 40 40 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 41 41 import org.openstreetmap.josm.tools.ImageProvider; 42 import org.openstreetmap.josm.tools.LanguageInfo; 42 43 43 44 public class MapPaintVisitor extends SimplePaintVisitor { … … 1276 1277 leftHandTraffic = Main.pref.getBoolean("mappaint.lefthandtraffic",false); 1277 1278 orderFont = new Font(Main.pref.get("mappaint.font","Helvetica"), Font.PLAIN, Main.pref.getInteger("mappaint.fontsize", 8)); 1278 String[] names = {"name:"+ Main.getLanguageCode(), "name", "int_name", "ref", "operator", "brand","addr:housenumber"};1279 String[] names = {"name:"+LanguageInfo.getLanguageCode(), "name", "int_name", "ref", "operator", "brand","addr:housenumber"}; 1279 1280 regionalNameOrder = Main.pref.getCollection("mappaint.nameOrder", Arrays.asList(names)); 1280 1281 minEN = nc.getEastNorth(0,nc.getHeight()-1); -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r1746 r1755 26 26 import org.openstreetmap.josm.Main; 27 27 import org.openstreetmap.josm.io.CacheCustomContent; 28 import org.openstreetmap.josm.tools.LanguageInfo; 28 29 import org.openstreetmap.josm.tools.OpenBrowser; 29 30 import org.openstreetmap.josm.tools.WikiReader; … … 61 62 62 63 final private int myVersion = AboutAction.getVersionNumber(); 63 final private String myLang = Main.getLanguageCodeU();64 final private String myLang = LanguageInfo.getLanguageCodeWiki(); 64 65 65 66 /** -
trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java
r1687 r1755 259 259 260 260 public void toggleMapSource(int mapSource) { 261 this.tileC ache = new MemoryTileCache();261 this.tileController.setTileCache(new MemoryTileCache()); 262 262 if (mapSource == SourceButton.MAPNIK) { 263 263 this.setTileSource(sources[0]); -
trunk/src/org/openstreetmap/josm/gui/preferences/StyleSources.java
r1747 r1755 32 32 import org.openstreetmap.josm.io.MirroredInputStream; 33 33 import org.openstreetmap.josm.tools.GBC; 34 import org.openstreetmap.josm.tools.LanguageInfo; 34 35 35 36 public class StyleSources extends JPanel { … … 282 283 { 283 284 ((DefaultListModel)sourcesDefaults.getModel()).removeAllElements(); 284 String lang = Main.getLanguageCode()+"_";285 String lang = LanguageInfo.getLanguageCodeManifest(); 285 286 try 286 287 { -
trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
r1647 r1755 21 21 22 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.tools.LanguageInfo; 23 24 24 25 /** … … 90 91 private void scanManifest(Manifest manifest) 91 92 { 92 String lang = Main.getLanguageCode()+"_";93 String lang = LanguageInfo.getLanguageCodeManifest(); 93 94 Attributes attr = manifest.getMainAttributes(); 94 95 className = attr.getValue("Plugin-Class"); -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r1512 r1755 8 8 9 9 import org.openstreetmap.josm.Main; 10 import org.openstreetmap.josm.tools.LanguageInfo; 10 11 11 12 /** … … 43 44 44 45 public String readLang(String text) { 45 String languageCode = Main.getLanguageCodeU();46 String languageCode = LanguageInfo.getLanguageCodeWiki(); 46 47 String url = baseurl + "/wiki/"+languageCode+text; 47 48 String res = ""; -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r1440 r1755 21 21 import org.xml.sax.helpers.DefaultHandler; 22 22 23 import org.openstreetmap.josm. Main;23 import org.openstreetmap.josm.tools.LanguageInfo; 24 24 25 25 /** … … 30 30 public class XmlObjectParser implements Iterable<Object> { 31 31 32 public static final String lang = Main.getLanguageCode()+".";32 public static final String lang = LanguageInfo.getLanguageCodeXML(); 33 33 public static class Uniform<T> implements Iterable<T>{ 34 34 private Iterator<Object> iterator;
Note:
See TracChangeset
for help on using the changeset viewer.