Changeset 15661 in josm for trunk/src/org
- Timestamp:
- 2020-01-08T23:03:36+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
r15427 r15661 16 16 import org.openstreetmap.josm.data.preferences.StringProperty; 17 17 import org.openstreetmap.josm.spi.preferences.Config; 18 import org.openstreetmap.josm.tools.LanguageInfo; 18 19 19 20 /** … … 289 290 */ 290 291 public static SystemOfMeasurement getDefault() { 291 switch (Locale.getDefault().getCountry()) { 292 final String country = Optional.ofNullable(System.getenv("LC_MEASUREMENT")) 293 .map(LanguageInfo::getLocale) 294 .orElse(Locale.getDefault()) 295 .getCountry(); 296 switch (country) { 292 297 case "US": 293 298 // https://en.wikipedia.org/wiki/Metrication_in_the_United_States#Current_use -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r15547 r15661 203 203 * Replies the locale used by Java for a given language code. 204 204 * 205 * Accepts JOSM and Javacodes as input.205 * Accepts JOSM, Java and POSIX codes as input. 206 206 * 207 207 * @param localeName the locale code. … … 211 211 */ 212 212 public static Locale getLocale(String localeName, boolean useDefaultCountry) { 213 final int encoding = localeName.indexOf('.'); 214 if (encoding > 0) { 215 localeName = localeName.substring(0, encoding); 216 } 213 217 int country = localeName.indexOf('_'); 214 218 int variant = localeName.indexOf('@');
Note:
See TracChangeset
for help on using the changeset viewer.