Changeset 8091 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2015-02-21T15:27:40+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r7509 r8091 123 123 } 124 124 125 /** 126 * Check if a new language is better than a previous existing. Can be used in classes where 127 * multiple user supplied language marked strings appear and the best one is searched. Following 128 * priorities: current language, english, any other 129 * 130 * @param oldLanguage the language code of the existing string 131 * @param newLanguage the language code of the new string 132 * @return true if new one is better 133 * @since 8091 134 */ 135 public static boolean isBetterLanguage(String oldLanguage, String newLanguage) { 136 if (oldLanguage == null) 137 return true; 138 String want = getJOSMLocaleCode(); 139 return want.equals(newLanguage) || (!want.equals(oldLanguage) && newLanguage.startsWith("en")); 140 } 141 142 /** 143 * Replies the language prefix for use in XML elements (with a dot appended). 144 * 145 * @return the XML language prefix 146 * @see #getJOSMLocaleCode() 147 */ 125 148 public static String getLanguageCodeXML() { 126 149 return getJOSMLocaleCode()+"."; 127 150 } 128 151 152 /** 153 * Replies the language prefix for use in manifests (with an underscore appended). 154 * 155 * @return the manifest language prefix 156 * @see #getJOSMLocaleCode() 157 */ 129 158 public static String getLanguageCodeManifest() { 130 159 return getJOSMLocaleCode()+"_";
Note:
See TracChangeset
for help on using the changeset viewer.
