Changeset 4144 in josm
- Timestamp:
- 2011-06-19T12:11:45+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r4100 r4144 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 import static org.openstreetmap.josm.tools.I18n.trc; 6 import static org.openstreetmap.josm.tools.I18n.trc_lazy; 6 7 import static org.openstreetmap.josm.tools.I18n.trn; 7 8 … … 372 373 return null; 373 374 } else 374 return relation.get(nameTag);375 return trc_lazy(nameTag, relation.get(nameTag)); 375 376 } 376 377 -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r4081 r4144 160 160 } 161 161 162 public static final String trc_lazy(String context, String text) { 163 if (context == null) 164 return tr(text); 165 if (text == null) 166 return null; 167 return MessageFormat.format(gettext_lazy(text, context), (Object)null); 168 } 169 162 170 /** 163 171 * Marks a string for translation (such that a script can harvest … … 218 226 } 219 227 return text; 228 } 229 230 /* try without context, when context try fails */ 231 private static final String gettext_lazy(String text, String ctx) 232 { 233 int i; 234 if(ctx == null && text.startsWith("_:") && (i = text.indexOf("\n")) >= 0) 235 { 236 ctx = text.substring(2,i-1); 237 text = text.substring(i+1); 238 } 239 if(strings != null) 240 { 241 String trans = strings.get(ctx == null ? text : "_:"+ctx+"\n"+text); 242 if(trans != null) 243 return trans; 244 } 245 if(pstrings != null) { 246 String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+"\n"+text); 247 if(trans != null) 248 return trans[0]; 249 } 250 return gettext(text, null); 220 251 } 221 252
Note:
See TracChangeset
for help on using the changeset viewer.