Changeset 7894 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-12-27T00:08:31+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 3 edited
-
I18n.java (modified) (4 diffs)
-
PlatformHookOsx.java (modified) (2 diffs)
-
Utils.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/I18n.java
r7893 r7894 39 39 } 40 40 41 /** 42 * Enumeration of possible plural modes. 43 * See <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html">CLDR</a> 44 * for a complete list. 45 * @see #pluralEval 46 */ 41 47 private enum PluralMode { 42 MODE_NOTONE, MODE_NONE, MODE_GREATERONE, 43 MODE_CS/*, MODE_AR*/, MODE_PL/*, MODE_RO*/, MODE_RU, MODE_SK/*, MODE_SL*/} 48 /** Plural = Not 1. This is the default for many languages, including English: 1 day, but 0 days or 2 days. */ 49 MODE_NOTONE, 50 /** No plural. Mainly for Asian languages (Indonesian, Chinese, Japanese, ...) */ 51 MODE_NONE, 52 /** Plural = Greater than 1. For some latin languages (French, Brazilian Portuguese) */ 53 MODE_GREATERONE, 54 /* Special mode for 55 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ar">Arabic</a>.* 56 MODE_AR,*/ 57 /** Special mode for 58 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#cs">Czech</a>. */ 59 MODE_CS, 60 /** Special mode for 61 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#pl">Polish</a>. */ 62 MODE_PL, 63 /* Special mode for 64 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ro">Romanian</a>.* 65 MODE_RO,*/ 66 /** Special mode for 67 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ru">Russian</a>. */ 68 MODE_RU, 69 /** Special mode for 70 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#sk">Slovak</a>. */ 71 MODE_SK, 72 /* Special mode for 73 * <a href="http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#sl">Slovenian</a>.* 74 MODE_SL,*/ 75 } 76 44 77 private static PluralMode pluralMode = PluralMode.MODE_NOTONE; /* english default */ 45 78 private static String loadedCode = "en"; … … 353 386 */ 354 387 public static void init() { 388 // Enable CLDR locale provider on Java 8 to get additional languages, such as Khmer. 389 // http://docs.oracle.com/javase/8/docs/technotes/guides/intl/enhancements.8.html#cldr 390 // This can be removed after we switch to a minimal version of Java that enables CLDR by default 391 // or includes all languages we need in the JRE. See http://openjdk.java.net/jeps/8043554 for Java 9 392 Utils.updateSystemProperty("java.locale.providers", "JRE,CLDR"); 393 355 394 //languages.put("ar", PluralMode.MODE_AR); 356 395 languages.put("bg", PluralMode.MODE_NOTONE); … … 374 413 languages.put("it", PluralMode.MODE_NOTONE); 375 414 languages.put("ja", PluralMode.MODE_NONE); 415 if (Main.isJava8orLater()) { 416 // Java 8 and later code 417 languages.put("km", PluralMode.MODE_NONE); 418 } 376 419 //languages.put("nb", PluralMode.MODE_NOTONE); 377 420 languages.put("nl", PluralMode.MODE_NOTONE); … … 649 692 case MODE_NOTONE: /* bg, da, de, el, en, en_GB, es, et, eu, fi, gl, is, it, iw_IL, nb, nl, sv */ 650 693 return ((n != 1) ? 1 : 0); 651 case MODE_NONE: /* ja, tr, zh_CN, zh_TW */694 case MODE_NONE: /* id, ja, km, tr, zh_CN, zh_TW */ 652 695 return 0; 653 696 case MODE_GREATERONE: /* fr, pt_BR */ -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r7846 r7894 19 19 import org.openstreetmap.josm.Main; 20 20 import org.openstreetmap.josm.actions.OpenFileAction.OpenFileTask; 21 import org.openstreetmap.josm.data.Preferences;22 21 import org.openstreetmap.josm.io.OsmTransferException; 23 22 import org.xml.sax.SAXException; … … 37 36 // And will not work when one of the system independent LAFs is used. 38 37 // They just insist on painting themselves... 39 Preferences.updateSystemProperty("apple.laf.useScreenMenuBar", "true");38 Utils.updateSystemProperty("apple.laf.useScreenMenuBar", "true"); 40 39 migrateOldDirectory(); 41 40 } -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r7869 r7894 1144 1144 return new Pair<>(noThreads, pool); 1145 1145 } 1146 1147 /** 1148 * Updates a given system property. 1149 * @param key The property key 1150 * @param value The property value 1151 * @return the previous value of the system property, or {@code null} if it did not have one. 1152 * @since 7894 1153 */ 1154 public static String updateSystemProperty(String key, String value) { 1155 if (value != null) { 1156 String old = System.setProperty(key, value); 1157 if (!key.toLowerCase().contains("password")) { 1158 Main.debug("System property '"+key+"' set to '"+value+"'. Old value was '"+old+"'"); 1159 } else { 1160 Main.debug("System property '"+key+"' changed."); 1161 } 1162 return old; 1163 } 1164 return null; 1165 } 1146 1166 }
Note:
See TracChangeset
for help on using the changeset viewer.
