- Timestamp:
- 2015-09-24T21:19:57+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java
r8510 r8792 108 108 */ 109 109 public ImageryMenu(JMenu subMenu) { 110 super(tr ("Imagery"));110 super(trc("menu", "Imagery")); 111 111 setupMenuScroller(); 112 112 MapView.addLayerChangeListener(this); -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r8748 r8792 3 3 4 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 5 import static org.openstreetmap.josm.tools.I18n.marktrc;6 5 import static org.openstreetmap.josm.tools.I18n.tr; 7 6 import static org.openstreetmap.josm.tools.I18n.trc; … … 330 329 * fileMenu contains I/O actions 331 330 */ 332 public final JMenu fileMenu = addMenu( /* I18N: mnemonic: F */ marktrc("menu", "File"), KeyEvent.VK_F, 0, ht("/Menu/File"));331 public final JMenu fileMenu = addMenu("File", /* I18N: mnemonic: F */ trc("menu", "File"), KeyEvent.VK_F, 0, ht("/Menu/File")); 333 332 /** 334 333 * sessionMenu is a submenu of File menu containing all session actions … … 338 337 * editMenu contains editing actions 339 338 */ 340 public final JMenu editMenu = addMenu( /* I18N: mnemonic: E */ marktrc("menu", "Edit"), KeyEvent.VK_E, 1, ht("/Menu/Edit"));339 public final JMenu editMenu = addMenu("Edit", /* I18N: mnemonic: E */ trc("menu", "Edit"), KeyEvent.VK_E, 1, ht("/Menu/Edit")); 341 340 /** 342 341 * viewMenu contains display actions (zoom, map styles, etc.) 343 342 */ 344 public final JMenu viewMenu = addMenu( /* I18N: mnemonic: V */ marktrc("menu", "View"), KeyEvent.VK_V, 2, ht("/Menu/View"));343 public final JMenu viewMenu = addMenu("View", /* I18N: mnemonic: V */ trc("menu", "View"), KeyEvent.VK_V, 2, ht("/Menu/View")); 345 344 /** 346 345 * toolsMenu contains different geometry manipulation actions from JOSM core (most used) 347 346 * The plugins should use other menus 348 347 */ 349 public final JMenu toolsMenu = addMenu( /* I18N: mnemonic: T */ marktrc("menu", "Tools"), KeyEvent.VK_T, 3, ht("/Menu/Tools"));348 public final JMenu toolsMenu = addMenu("Tools", /* I18N: mnemonic: T */ trc("menu", "Tools"), KeyEvent.VK_T, 3, ht("/Menu/Tools")); 350 349 /** 351 350 * moreToolsMenu contains geometry-related actions from all the plugins 352 351 * @since 6082 (moved from Utilsplugin2) 353 352 */ 354 public final JMenu moreToolsMenu = addMenu( /* I18N: mnemonic: M */ marktrc("menu", "More tools"), KeyEvent.VK_M, 4, ht("/Menu/MoreTools"));353 public final JMenu moreToolsMenu = addMenu("More tools", /* I18N: mnemonic: M */ trc("menu", "More tools"), KeyEvent.VK_M, 4, ht("/Menu/MoreTools")); 355 354 /** 356 355 * dataMenu contains plugin actions that are related to certain tagging schemes (addressing opening hours), … … 358 357 * @since 6082 359 358 */ 360 public final JMenu dataMenu = addMenu( /* I18N: mnemonic: D */ marktrc("menu", "Data"), KeyEvent.VK_D, 5, ht("/Menu/Data"));359 public final JMenu dataMenu = addMenu("Data", /* I18N: mnemonic: D */ trc("menu", "Data"), KeyEvent.VK_D, 5, ht("/Menu/Data")); 361 360 /** 362 361 * selectionMenu contains all actions related to selecting different objects 363 362 * @since 6082 (moved from Utilsplugin2) 364 363 */ 365 public final JMenu selectionMenu = addMenu( /* I18N: mnemonic: N */ marktrc("menu", "Selection"), KeyEvent.VK_N, 6, ht("/Menu/Selection"));364 public final JMenu selectionMenu = addMenu("Selection", /* I18N: mnemonic: N */ trc("menu", "Selection"), KeyEvent.VK_N, 6, ht("/Menu/Selection")); 366 365 /** 367 366 * presetsMenu contains presets actions (search, presets tree) 368 367 */ 369 public final JMenu presetsMenu = addMenu( /* I18N: mnemonic: P */ marktrc("menu", "Presets"), KeyEvent.VK_P, 7, ht("/Menu/Presets"));368 public final JMenu presetsMenu = addMenu("Presets", /* I18N: mnemonic: P */ trc("menu", "Presets"), KeyEvent.VK_P, 7, ht("/Menu/Presets")); 370 369 /** 371 370 * submenu in Imagery menu that contains plugin-managed additional imagery layers … … 377 376 */ 378 377 // CHECKSTYLE.OFF: LineLength 379 public final ImageryMenu imageryMenu = addMenu(new ImageryMenu(imagerySubMenu), /* I18N: mnemonic: I */ marktrc("menu", "Imagery"), KeyEvent.VK_I, 8, ht("/Menu/Imagery"));378 public final ImageryMenu imageryMenu = addMenu(new ImageryMenu(imagerySubMenu), /* I18N: mnemonic: I */ "Imagery", KeyEvent.VK_I, 8, ht("/Menu/Imagery")); 380 379 // CHECKSTYLE.ON: LineLength 381 380 /** … … 384 383 * @since 6082 385 384 */ 386 public final JMenu gpsMenu = addMenu( /* I18N: mnemonic: G */ marktrc("menu", "GPS"), KeyEvent.VK_G, 9, ht("/Menu/GPS"));385 public final JMenu gpsMenu = addMenu("GPS", /* I18N: mnemonic: G */ trc("menu", "GPS"), KeyEvent.VK_G, 9, ht("/Menu/GPS")); 387 386 /** the window menu is split into several groups. The first is for windows that can be opened from 388 387 * this menu any time, e.g. the changeset editor. The second group is for toggle dialogs and the third … … 390 389 * to use WINDOW_MENU_GROUP to determine the group integer. 391 390 */ 392 public final JMenu windowMenu = addMenu( /* I18N: mnemonic: W */ marktrc("menu", "Windows"), KeyEvent.VK_W, 10, ht("/Menu/Windows"));391 public final JMenu windowMenu = addMenu("Windows", /* I18N: mnemonic: W */ trc("menu", "Windows"), KeyEvent.VK_W, 10, ht("/Menu/Windows")); 393 392 394 393 /** … … 399 398 * helpMenu contains JOSM general actions (Help, About, etc.) 400 399 */ 401 public final JMenu helpMenu = addMenu( /* I18N: mnemonic: H */ marktrc("menu", "Help"), KeyEvent.VK_H, 11, ht("/Menu/Help"));400 public final JMenu helpMenu = addMenu("Help", /* I18N: mnemonic: H */ trc("menu", "Help"), KeyEvent.VK_H, 11, ht("/Menu/Help")); 402 401 403 402 private static final int defaultMenuPos = 11; … … 606 605 } 607 606 607 /** 608 * @deprecated Use {@link #addMenu(String, String, int, int, String)} instead. 609 */ 610 // Kept for compatibility with plugins 611 @Deprecated 608 612 public JMenu addMenu(String name, int mnemonicKey, int position, String relativeHelpTopic) { 609 final JMenu menu = new JMenu(tr(name)); 613 return addMenu(name, tr(name), mnemonicKey, position, relativeHelpTopic); 614 } 615 616 /** 617 * Creates a menu and adds it on the given position to the main menu. 618 * 619 * @param name the untranslated name (used as identifier for shortcut registration) 620 * @param translatedName the translated menu name (use {@code I18n.trc("menu", name)} to allow better internationalization 621 * @param mnemonicKey the mnemonic key to register 622 * @param position the position in the main menu 623 * @param relativeHelpTopic the relative help topic 624 * @return the newly created menu 625 */ 626 public JMenu addMenu(String name, String translatedName, int mnemonicKey, int position, String relativeHelpTopic) { 627 final JMenu menu = new JMenu(translatedName); 610 628 if (!GraphicsEnvironment.isHeadless()) { 611 629 MenuScroller.setScrollerFor(menu); … … 614 632 } 615 633 634 /** 635 * Adds the given menu on the given position to the main menu. 636 * 637 * @param menu the menu to add 638 * @param name the untranslated name (used as identifier for shortcut registration) 639 * @param mnemonicKey the mnemonic key to register 640 * @param position the position in the main menu 641 * @param relativeHelpTopic the relative help topic 642 * @return the given {@code }menu} 643 */ 616 644 public <T extends JMenu> T addMenu(T menu, String name, int mnemonicKey, int position, String relativeHelpTopic) { 617 Shortcut.registerShortcut("menu:" + name, tr("Menu: {0}", trc("menu", name)), mnemonicKey,645 Shortcut.registerShortcut("menu:" + name, tr("Menu: {0}", getName()), mnemonicKey, 618 646 Shortcut.MNEMONIC).setMnemonic(menu); 619 647 add(menu, position); … … 914 942 protected void showAudioMenu(boolean showMenu) { 915 943 if (showMenu && audioMenu == null) { 916 audioMenu = addMenu( /* I18N: mnemonic: U */ marktrc("menu", "Audio"), KeyEvent.VK_U, defaultMenuPos, ht("/Menu/Audio"));944 audioMenu = addMenu("Audio", /* I18N: mnemonic: U */ trc("menu", "Audio"), KeyEvent.VK_U, defaultMenuPos, ht("/Menu/Audio")); 917 945 add(audioMenu, audioPlayPause); 918 946 add(audioMenu, audioNext);
Note:
See TracChangeset
for help on using the changeset viewer.