Changeset 6821 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2014-02-07T00:18:58+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r6629 r6821 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.data.osm; 3 4 import org.openstreetmap.josm.tools.Utils; 3 5 4 6 import static org.openstreetmap.josm.tools.I18n.tr; … … 701 703 @Override 702 704 public String getLocalName() { 703 String key = "name:" + Locale.getDefault().toString(); 704 if (get(key) != null) 705 return get(key); 706 key = "name:" + Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry(); 707 if (get(key) != null) 708 return get(key); 709 key = "name:" + Locale.getDefault().getLanguage(); 710 if (get(key) != null) 711 return get(key); 705 final Locale locale = Locale.getDefault(); 706 String key = "name:" + locale.toString(); 707 String val = get(key); 708 if (val != null) 709 return val; 710 711 final String language = locale.getLanguage(); 712 key = "name:" + language + "_" + locale.getCountry(); 713 val = get(key); 714 if (val != null) 715 return val; 716 717 key = "name:" + language; 718 val = get(key); 719 if (val != null) 720 return val; 721 712 722 return getName(); 723 } 724 725 /** 726 * Tests whether this primitive contains a tag consisting of {@code key} and {@code values}. 727 * @param key the key forming the tag. 728 * @param value value forming the tag. 729 * @return true iff primitive contains a tag consisting of {@code key} and {@code value}. 730 */ 731 public boolean hasTag(String key, String value) { 732 return Utils.equal(value, get(key)); 713 733 } 714 734
Note:
See TracChangeset
for help on using the changeset viewer.