- Timestamp:
- 2009-10-03T13:56:26+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r2193 r2230 4 4 import static org.openstreetmap.josm.tools.I18n.marktr; 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 import static org.openstreetmap.josm.tools.I18n.trc; 6 7 import static org.openstreetmap.josm.tools.I18n.trn; 7 8 … … 68 69 public TaggingPresetMenu group = null; 69 70 public String name; 71 public String name_context; 70 72 public String locale_name; 71 73 … … 141 143 public String text; 142 144 public String locale_text; 145 public String text_context; 143 146 public String default_; 144 147 public String originalValue; … … 178 181 } 179 182 if(locale_text == null) { 180 locale_text = tr(text); 183 if(text_context != null) 184 locale_text = trc(text_context, text); 185 else 186 locale_text = tr(text); 181 187 } 182 188 p.add(new JLabel(locale_text+":"), GBC.std().insets(0,0,10,0)); … … 209 215 public String key; 210 216 public String text; 217 public String text_context; 211 218 public String locale_text; 212 219 public boolean default_ = false; // only used for tagless objects … … 224 231 225 232 if(locale_text == null) { 226 locale_text = tr(text); 233 if(text_context != null) 234 locale_text = trc(text_context, text); 235 else 236 locale_text = tr(text); 227 237 } 228 238 … … 287 297 public String key; 288 298 public String text; 299 public String text_context; 289 300 public String locale_text; 290 301 public String values; 302 public String values_context; 291 303 public String display_values; 292 304 public String locale_display_values; … … 321 333 } 322 334 for (int i=0; i<value_array.length; i++) { 323 lhm.put(value_array[i], 324 (locale_display_values == null) ?325 tr(display_array[i]) : display_array[i]);335 lhm.put(value_array[i], (locale_display_values == null) 336 ? (values_context == null ? tr(display_array[i]) 337 : tr(values_context, display_array[i])) : display_array[i]); 326 338 } 327 339 if(!usage.unused()){ … … 365 377 366 378 if(locale_text == null) { 367 locale_text = tr(text); 379 if(text_context != null) 380 locale_text = trc(text_context, text); 381 else 382 locale_text = tr(text); 368 383 } 369 384 p.add(new JLabel(locale_text+":"), GBC.std().insets(0,0,10,0)); … … 407 422 public static class Label extends Item { 408 423 public String text; 424 public String text_context; 409 425 public String locale_text; 410 426 411 427 @Override public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel) { 412 428 if(locale_text == null) { 413 locale_text = tr(text); 429 if(text_context != null) 430 locale_text = trc(text_context, text); 431 else 432 locale_text = tr(text); 414 433 } 415 434 p.add(new JLabel(locale_text), GBC.eol()); … … 422 441 public String href; 423 442 public String text; 443 public String text_context; 424 444 public String locale_text; 425 445 public String locale_href; … … 427 447 @Override public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel) { 428 448 if(locale_text == null) { 429 locale_text = text == null ? tr("More information about this feature") : tr(text); 449 if(text == null) 450 locale_text = tr("More information about this feature"); 451 if(text_context != null) 452 locale_text = trc(text_context, text); 453 else 454 locale_text = tr(text); 430 455 } 431 456 String url = locale_href; … … 500 525 public String getLocaleName() { 501 526 if(locale_name == null) { 502 locale_name = tr(name); 527 if(name_context != null) 528 locale_name = trc(name_context, name); 529 else 530 locale_name = tr(name); 503 531 } 504 532 return locale_name;
Note:
See TracChangeset
for help on using the changeset viewer.