Bug 1288406 - Part 3: Port browser's menubar to L20n. r=gandalf r=Pike
MozReview-Commit-ID: Dsp0ZXfSl6o
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -4,533 +4,469 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
<menubar id="main-menubar"
onpopupshowing="if (event.target.parentNode.parentNode == this &&
!('@mozilla.org/widget/nativemenuservice;1' in Cc))
this.setAttribute('openedwithkey',
event.target.parentNode.openedWithKey);"
style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
- <menu id="file-menu" label="&fileMenu.label;"
- accesskey="&fileMenu.accesskey;">
+ <menu id="file-menu" data-l10n-id="file-menu">
<menupopup id="menu_FilePopup"
onpopupshowing="updateUserContextUIVisibility();">
<menuitem id="menu_newNavigatorTab"
- label="&tabCmd.label;"
+ data-l10n-id="tab-menuitem"
command="cmd_newNavigatorTab"
- key="key_newNavigatorTab"
- accesskey="&tabCmd.accesskey;"/>
+ key="key_newNavigatorTab"/>
<menu id="menu_newUserContext"
- label="&newUserContext.label;"
- accesskey="&newUserContext.accesskey;"
+ data-l10n-id="new-user-context-menu"
hidden="true">
<menupopup onpopupshowing="return createUserContextMenu(event);" />
</menu>
<menuitem id="menu_newNavigator"
- label="&newNavigatorCmd.label;"
- accesskey="&newNavigatorCmd.accesskey;"
+ data-l10n-id="new-navigator-menuitem"
key="key_newNavigator"
command="cmd_newNavigator"/>
<menuitem id="menu_newPrivateWindow"
- label="&newPrivateWindow.label;"
- accesskey="&newPrivateWindow.accesskey;"
+ data-l10n-id="new-private-window-menuitem"
command="Tools:PrivateBrowsing"
key="key_privatebrowsing"/>
#ifdef E10S_TESTING_ONLY
<menuitem id="menu_newNonRemoteWindow"
- label="&newNonRemoteWindow.label;"
+ data-l10n-id="new-non-remote-window-menuitem"
hidden="true"
command="Tools:NonRemoteWindow"/>
#endif
#ifdef MAC_NON_BROWSER_WINDOW
<menuitem id="menu_openLocation"
- label="&openLocationCmd.label;"
+ data-l10n-id="open-location-menuitem"
command="Browser:OpenLocation"
key="focusURLBar"/>
#endif
<menuitem id="menu_openFile"
- label="&openFileCmd.label;"
+ data-l10n-id="open-file-menuitem"
command="Browser:OpenFile"
key="openFileKb"
accesskey="&openFileCmd.accesskey;"/>
<menuitem id="menu_close"
+ data-l10n-id="close-menuitem"
class="show-only-for-keyboard"
- label="&closeCmd.label;"
key="key_close"
- accesskey="&closeCmd.accesskey;"
command="cmd_close"/>
<menuitem id="menu_closeWindow"
+ data-l10n-id="close-window-menuitem"
class="show-only-for-keyboard"
hidden="true"
command="cmd_closeWindow"
- key="key_closeWindow"
- label="&closeWindow.label;"
- accesskey="&closeWindow.accesskey;"/>
+ key="key_closeWindow"/>
<menuseparator/>
<menuitem id="menu_savePage"
- label="&savePageCmd.label;"
- accesskey="&savePageCmd.accesskey;"
+ data-l10n-id="save-page-menuitem"
key="key_savePage"
command="Browser:SavePage"/>
<menuitem id="menu_sendLink"
- label="&emailPageCmd.label;"
- accesskey="&emailPageCmd.accesskey;"
+ data-l10n-id="email-page-menuitem"
command="Browser:SendLink"/>
<menuseparator/>
#if !defined(MOZ_WIDGET_GTK) && !defined(MOZ_WIDGET_QT)
<menuitem id="menu_printSetup"
- label="&printSetupCmd.label;"
- accesskey="&printSetupCmd.accesskey;"
+ data-l10n-id="print-setup-menuitem"
command="cmd_pageSetup"/>
#endif
#ifndef XP_MACOSX
<menuitem id="menu_printPreview"
- label="&printPreviewCmd.label;"
- accesskey="&printPreviewCmd.accesskey;"
+ data-l10n-id="print-preview-menuitem"
command="cmd_printPreview"/>
#endif
<menuitem id="menu_print"
- label="&printCmd.label;"
- accesskey="&printCmd.accesskey;"
+ data-l10n-id="print-menuitem"
key="printKb"
command="cmd_print"/>
<menuseparator/>
<menuitem id="goOfflineMenuitem"
- label="&goOfflineCmd.label;"
- accesskey="&goOfflineCmd.accesskey;"
+ data-l10n-id="go-offline-menuitem"
type="checkbox"
observes="workOfflineMenuitemState"
oncommand="BrowserOffline.toggleOfflineStatus();"/>
<menuitem id="menu_FileQuitItem"
-#ifdef XP_WIN
- label="&quitApplicationCmdWin2.label;"
- accesskey="&quitApplicationCmdWin2.accesskey;"
-#else
-#ifdef XP_MACOSX
- label="&quitApplicationCmdMac2.label;"
-#else
- label="&quitApplicationCmd.label;"
- accesskey="&quitApplicationCmd.accesskey;"
-#endif
+ data-l10n-id="quit-application-menuitem"
#ifdef XP_UNIX
key="key_quitApplication"
#endif
-#endif
command="cmd_quitApplication"/>
</menupopup>
</menu>
- <menu id="edit-menu" label="&editMenu.label;"
- accesskey="&editMenu.accesskey;">
+ <menu id="edit-menu" data-l10n-id="edit-menu">
<menupopup id="menu_EditPopup"
onpopupshowing="updateEditUIVisibility()"
onpopuphidden="updateEditUIVisibility()">
<menuitem id="menu_undo"
- label="&undoCmd.label;"
+ data-l10n-id="undo-menuitem"
key="key_undo"
- accesskey="&undoCmd.accesskey;"
command="cmd_undo"/>
<menuitem id="menu_redo"
- label="&redoCmd.label;"
+ data-l10n-id="redo-menuitem"
key="key_redo"
- accesskey="&redoCmd.accesskey;"
command="cmd_redo"/>
<menuseparator/>
<menuitem id="menu_cut"
- label="&cutCmd.label;"
+ data-l10n-id="redo-menuitem"
key="key_cut"
- accesskey="&cutCmd.accesskey;"
command="cmd_cut"/>
<menuitem id="menu_copy"
- label="©Cmd.label;"
+ data-l10n-id="redo-menuitem"
key="key_copy"
- accesskey="©Cmd.accesskey;"
command="cmd_copy"/>
<menuitem id="menu_paste"
- label="&pasteCmd.label;"
+ data-l10n-id="redo-menuitem"
key="key_paste"
- accesskey="&pasteCmd.accesskey;"
command="cmd_paste"/>
<menuitem id="menu_delete"
- label="&deleteCmd.label;"
+ data-l10n-id="redo-menuitem"
key="key_delete"
- accesskey="&deleteCmd.accesskey;"
command="cmd_delete"/>
<menuseparator/>
<menuitem id="menu_selectAll"
- label="&selectAllCmd.label;"
+ data-l10n-id="redo-menuitem"
key="key_selectAll"
- accesskey="&selectAllCmd.accesskey;"
command="cmd_selectAll"/>
<menuseparator/>
<menuitem id="menu_find"
- label="&findOnCmd.label;"
- accesskey="&findOnCmd.accesskey;"
+ data-l10n-id="find-on-menuitem"
key="key_find"
command="cmd_find"/>
<menuitem id="menu_findAgain"
+ data-l10n-id="find-again-menuitem"
class="show-only-for-keyboard"
- label="&findAgainCmd.label;"
- accesskey="&findAgainCmd.accesskey;"
key="key_findAgain"
command="cmd_findAgain"/>
<menuseparator hidden="true" id="textfieldDirection-separator"/>
<menuitem id="textfieldDirection-swap"
+ data-l10n-id="bidi-switch-text-direction-menuitem"
command="cmd_switchTextDirection"
key="key_switchTextDirection"
- label="&bidiSwitchTextDirectionItem.label;"
- accesskey="&bidiSwitchTextDirectionItem.accesskey;"
hidden="true"/>
#ifdef XP_UNIX
#ifndef XP_MACOSX
<menuseparator/>
<menuitem id="menu_preferences"
- label="&preferencesCmdUnix.label;"
- accesskey="&preferencesCmdUnix.accesskey;"
+ data-l10n-id="preferences-menuitem"
oncommand="openPreferences();"/>
#endif
#endif
</menupopup>
</menu>
- <menu id="view-menu" label="&viewMenu.label;"
- accesskey="&viewMenu.accesskey;">
+ <menu id="view-menu" data-l10n-id="view-menu">
<menupopup id="menu_viewPopup"
onpopupshowing="updateCharacterEncodingMenuState();">
<menu id="viewToolbarsMenu"
- label="&viewToolbarsMenu.label;"
- accesskey="&viewToolbarsMenu.accesskey;">
+ data-l10n-id="view-toolbars-menu">
<menupopup onpopupshowing="onViewToolbarsPopupShowing(event);">
<menuseparator/>
<menuitem id="menu_customizeToolbars"
- label="&viewCustomizeToolbar.label;"
- accesskey="&viewCustomizeToolbar.accesskey;"
+ data-l10n-id="view-customize-toolbar-menuitem"
command="cmd_CustomizeToolbars"/>
</menupopup>
</menu>
<menu id="viewSidebarMenuMenu"
- label="&viewSidebarMenu.label;"
- accesskey="&viewSidebarMenu.accesskey;">
+ data-l10n-id="view-sidebar-menu">
<menupopup id="viewSidebarMenu">
<menuitem id="menu_bookmarksSidebar"
key="viewBookmarksSidebarKb"
observes="viewBookmarksSidebar"/>
<menuitem id="menu_historySidebar"
+ data-l10n-id="view-history-menuitem"
key="key_gotoHistory"
- observes="viewHistorySidebar"
- label="&historyButton.label;"/>
+ observes="viewHistorySidebar"/>
<menuitem id="menu_tabsSidebar"
- observes="viewTabsSidebar"
- label="&syncedTabs.sidebar.label;"/>
+ data-l10n-id="view-synced-tabs-menuitem"
+ observes="viewTabsSidebar"/>
<!-- Service providers with sidebars are inserted between these two menuseperators -->
<menuseparator hidden="true"/>
<menuseparator class="social-provider-menu" hidden="true"/>
</menupopup>
</menu>
<menuseparator/>
- <menu id="viewFullZoomMenu" label="&fullZoom.label;"
- accesskey="&fullZoom.accesskey;"
+ <menu id="viewFullZoomMenu" data-l10n-id="full-zoom-menu"
onpopupshowing="FullZoom.updateMenu();">
<menupopup>
<menuitem id="menu_zoomEnlarge"
+ data-l10n-id="full-zoom-enlarge-menuitem"
key="key_fullZoomEnlarge"
- label="&fullZoomEnlargeCmd.label;"
- accesskey="&fullZoomEnlargeCmd.accesskey;"
command="cmd_fullZoomEnlarge"/>
<menuitem id="menu_zoomReduce"
+ data-l10n-id="full-zoom-reduce-menuitem"
key="key_fullZoomReduce"
- label="&fullZoomReduceCmd.label;"
- accesskey="&fullZoomReduceCmd.accesskey;"
command="cmd_fullZoomReduce"/>
<menuseparator/>
<menuitem id="menu_zoomReset"
+ data-l10n-id="full-zoom-reset-menuitem"
key="key_fullZoomReset"
- label="&fullZoomResetCmd.label;"
- accesskey="&fullZoomResetCmd.accesskey;"
command="cmd_fullZoomReset"/>
<menuseparator/>
<menuitem id="toggle_zoom"
- label="&fullZoomToggleCmd.label;"
- accesskey="&fullZoomToggleCmd.accesskey;"
+ data-l10n-id="full-zoom-toggle-menuitem"
type="checkbox"
command="cmd_fullZoomToggle"
checked="false"/>
</menupopup>
</menu>
- <menu id="pageStyleMenu" label="&pageStyleMenu.label;"
- accesskey="&pageStyleMenu.accesskey;" observes="isImage">
+ <menu id="pageStyleMenu" data-l10n-id="page-style-menu"
+ observes="isImage">
<menupopup onpopupshowing="gPageStyleMenu.fillPopup(this);">
<menuitem id="menu_pageStyleNoStyle"
- label="&pageStyleNoStyle.label;"
- accesskey="&pageStyleNoStyle.accesskey;"
+ data-l10n-id="page-style-no-style-menuitem"
oncommand="gPageStyleMenu.disableStyle();"
type="radio"/>
<menuitem id="menu_pageStylePersistentOnly"
- label="&pageStylePersistentOnly.label;"
- accesskey="&pageStylePersistentOnly.accesskey;"
+ data-l10n-id="page-style-persistent-only-menuitem"
oncommand="gPageStyleMenu.switchStyleSheet('');"
type="radio"
checked="true"/>
<menuseparator/>
</menupopup>
</menu>
#include browser-charsetmenu.inc
<menuseparator/>
#ifdef XP_MACOSX
<menuitem id="enterFullScreenItem"
- accesskey="&enterFullScreenCmd.accesskey;"
- label="&enterFullScreenCmd.label;"
+ data-l10n-id="enter-full-screen-menuitem"
key="key_fullScreen">
<observes element="View:FullScreen" attribute="oncommand"/>
<observes element="View:FullScreen" attribute="disabled"/>
</menuitem>
<menuitem id="exitFullScreenItem"
- accesskey="&exitFullScreenCmd.accesskey;"
- label="&exitFullScreenCmd.label;"
+ data-l10n-id="exit-full-screen-menuitem"
key="key_fullScreen"
hidden="true">
<observes element="View:FullScreen" attribute="oncommand"/>
<observes element="View:FullScreen" attribute="disabled"/>
</menuitem>
#else
<menuitem id="fullScreenItem"
- accesskey="&fullScreenCmd.accesskey;"
- label="&fullScreenCmd.label;"
+ data-l10n-id="full-screen-menuitem"
key="key_fullScreen"
type="checkbox"
observes="View:FullScreen"/>
#endif
<menuitem id="menu_readerModeItem"
observes="View:ReaderView"
hidden="true"/>
<menuitem id="menu_showAllTabs"
+ data-l10n-id="show-all-tabs-menuitem"
hidden="true"
- accesskey="&showAllTabsCmd.accesskey;"
- label="&showAllTabsCmd.label;"
command="Browser:ShowAllTabs"
key="key_showAllTabs"/>
<menuseparator hidden="true" id="documentDirection-separator"/>
<menuitem id="documentDirection-swap"
+ data-l10n-id="bidi-switch-page-direction-menuitem"
hidden="true"
- label="&bidiSwitchPageDirectionItem.label;"
- accesskey="&bidiSwitchPageDirectionItem.accesskey;"
oncommand="gBrowser.selectedBrowser
.messageManager
.sendAsyncMessage('SwitchDocumentDirection');"/>
</menupopup>
</menu>
- <menu id="history-menu"
- label="&historyMenu.label;"
- accesskey="&historyMenu.accesskey;">
+ <menu id="history-menu" data-l10n-id="history-menu">
<menupopup id="goPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
oncommand="this.parentNode._placesView._onCommand(event);"
onclick="checkForMiddleClick(this, event);"
onpopupshowing="if (!this.parentNode._placesView)
new HistoryMenu(event);"
tooltip="bhTooltip"
popupsinherittooltip="true">
<menuitem id="menu_showAllHistory"
- label="&showAllHistoryCmd2.label;"
+ data-l10n-id="show-all-history-menuitem"
#ifndef XP_MACOSX
key="showAllHistoryKb"
#endif
command="Browser:ShowAllHistory"/>
<menuitem id="sanitizeItem"
- label="&clearRecentHistory.label;"
+ data-l10n-id="clear-recent-history-menuitem"
key="key_sanitize"
command="Tools:Sanitize"/>
<menuseparator id="sanitizeSeparator"/>
<menuitem id="sync-tabs-menuitem"
+ data-l10n-id="history-synced-tabs-menuitem"
class="syncTabsMenuItem"
- label="&syncTabsMenu3.label;"
oncommand="BrowserOpenSyncTabs();"
hidden="true"/>
<menuitem id="historyRestoreLastSession"
- label="&historyRestoreLastSession.label;"
+ data-l10n-id="history-restore-last-session-menuitem"
command="Browser:RestoreLastSession"/>
<menu id="historyUndoMenu"
+ data-l10n-id="history-undo-menu"
class="recentlyClosedTabsMenu"
- label="&historyUndoMenu.label;"
disabled="true">
<menupopup id="historyUndoPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
onpopupshowing="document.getElementById('history-menu')._placesView.populateUndoSubmenu();"/>
</menu>
<menu id="historyUndoWindowMenu"
+ data-l10n-id="history-undo-window-menu"
class="recentlyClosedWindowsMenu"
- label="&historyUndoWindowMenu.label;"
disabled="true">
<menupopup id="historyUndoWindowPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
onpopupshowing="document.getElementById('history-menu')._placesView.populateUndoWindowSubmenu();"/>
</menu>
<menuseparator id="startHistorySeparator"
class="hide-if-empty-places-result"/>
</menupopup>
</menu>
<menu id="bookmarksMenu"
- label="&bookmarksMenu.label;"
- accesskey="&bookmarksMenu.accesskey;"
+ data-l10n-id="bookmarks-menu"
ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
ondragover="PlacesMenuDNDHandler.onDragOver(event);"
ondrop="PlacesMenuDNDHandler.onDrop(event);">
<menupopup id="bookmarksMenuPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
context="placesContext"
openInTabs="children"
oncommand="BookmarksEventHandler.onCommand(event, this.parentNode._placesView);"
onclick="BookmarksEventHandler.onClick(event, this.parentNode._placesView);"
onpopupshowing="BookmarkingUI.onMainMenuPopupShowing(event);
if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
tooltip="bhTooltip" popupsinherittooltip="true">
<menuitem id="bookmarksShowAll"
- label="&showAllBookmarks2.label;"
+ data-l10n-id="show-all-bookmarks-menuitem"
command="Browser:ShowAllBookmarks"
key="manBookmarkKb"/>
<menuseparator id="organizeBookmarksSeparator"/>
<menuitem id="menu_bookmarkThisPage"
command="Browser:AddBookmarkAs"
observes="bookmarkThisPageBroadcaster"
key="addBookmarkAsKb"/>
<menuitem id="subscribeToPageMenuitem"
+ data-l10n-id="subscribe-to-page-menuitem"
#ifndef XP_MACOSX
class="menuitem-iconic"
#endif
- label="&subscribeToPageMenuitem.label;"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"
observes="singleFeedMenuitemState"/>
<menu id="subscribeToPageMenupopup"
+ data-l10n-id="subscribe-to-page-menupopup"
#ifndef XP_MACOSX
class="menu-iconic"
#endif
- label="&subscribeToPageMenupopup.label;"
observes="multipleFeedsMenuState">
<menupopup id="subscribeToPageSubmenuMenupopup"
onpopupshowing="return FeedHandler.buildFeedList(event.target);"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"/>
</menu>
<menuitem id="menu_bookmarkAllTabs"
- label="&addCurPagesCmd.label;"
+ data-l10n-id="add-cur-pages-menuitem"
class="show-only-for-keyboard"
command="Browser:BookmarkAllTabs"
key="bookmarkAllTabsKb"/>
<menuseparator/>
- <menuitem label="&recentBookmarks.label;"
- id="menu_recentBookmarks"
+ <menuitem id="menu_recentBookmarks"
+ data-l10n-id="recent-bookmarks-menuitem"
disabled="true"/>
<menuseparator id="bookmarksToolbarSeparator"/>
<menu id="bookmarksToolbarFolderMenu"
+ data-l10n-id="personalbar-menu"
class="menu-iconic bookmark-item"
- label="&personalbarCmd.label;"
container="true">
<menupopup id="bookmarksToolbarFolderPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
context="placesContext"
onpopupshowing="if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
</menu>
<menu id="menu_unsortedBookmarks"
+ data-l10n-id="other-bookmarks-menu"
class="menu-iconic bookmark-item"
- label="&otherBookmarksCmd.label;"
container="true">
<menupopup id="otherBookmarksFolderPopup"
#ifndef XP_MACOSX
placespopup="true"
#endif
context="placesContext"
onpopupshowing="if (!this.parentNode._placesView)
new PlacesMenu(event, 'place:folder=UNFILED_BOOKMARKS');"/>
</menu>
<menuseparator id="bookmarksMenuItemsSeparator"/>
<!-- Bookmarks menu items -->
</menupopup>
</menu>
<menu id="tools-menu"
- label="&toolsMenu.label;"
- accesskey="&toolsMenu.accesskey;"
+ data-l10n-id="tools-menu"
onpopupshowing="mirrorShow(this)">
<menupopup id="menu_ToolsPopup"
# We have to use setTimeout() here to avoid a flickering menu bar when opening
# the Tools menu, see bug 970769. This can be removed once we got rid of the
# event loop spinning in Weave.Status._authManager.
onpopupshowing="setTimeout(() => gSyncUI.updateUI());"
>
<menuitem id="menu_openDownloads"
- label="&downloads.label;"
- accesskey="&downloads.accesskey;"
+ data-l10n-id="downloads-menuitem"
key="key_openDownloads"
command="Tools:Downloads"/>
<menuitem id="menu_openAddons"
- label="&addons.label;"
- accesskey="&addons.accesskey;"
+ data-l10n-id="addons-menuitem"
key="key_openAddons"
command="Tools:Addons"/>
<!-- only one of sync-setup, sync-syncnowitem or sync-reauthitem will be showing at once -->
<menuitem id="sync-setup"
- label="&syncSignIn.label;"
- accesskey="&syncSignIn.accesskey;"
+ data-l10n-id="sync-sign-in-menuitem"
observes="sync-setup-state"
oncommand="gSyncUI.openSetup(null, 'menubar')"/>
<menuitem id="sync-syncnowitem"
- label="&syncSyncNowItem.label;"
- accesskey="&syncSyncNowItem.accesskey;"
+ data-l10n-id="sync-sync-now-menuitem"
observes="sync-syncnow-state"
oncommand="gSyncUI.doSync(event);"/>
<menuitem id="sync-reauthitem"
- label="&syncReAuthItem.label;"
- accesskey="&syncReAuthItem.accesskey;"
+ data-l10n-id="sync-re-auth-menuitem"
observes="sync-reauth-state"
oncommand="gSyncUI.openSignInAgainPage('menubar');"/>
<menuseparator id="devToolsSeparator"/>
<menu id="webDeveloperMenu"
- label="&webDeveloperMenu.label;"
- accesskey="&webDeveloperMenu.accesskey;">
+ data-l10n-id="web-developer-menu">
<menupopup id="menuWebDeveloperPopup">
<menuitem id="menu_pageSource"
- observes="devtoolsMenuBroadcaster_PageSource"
- accesskey="&pageSourceCmd.accesskey;"/>
+ data-l10n-id="page-source-menuitem"
+ observes="devtoolsMenuBroadcaster_PageSource"/>
</menupopup>
</menu>
<menuitem id="menu_pageInfo"
- accesskey="&pageInfoCmd.accesskey;"
- label="&pageInfoCmd.label;"
+ data-l10n-id="page-info-menuitem"
#ifndef XP_WIN
key="key_viewInfo"
#endif
command="View:PageInfo"/>
<menu id="menu_mirrorTabCmd"
- hidden="true"
- accesskey="&mirrorTabCmd.accesskey;"
- label="&mirrorTabCmd.label;">
+ data-l10n-id="mirror-tab-menu"
+ hidden="true">
<menupopup id="menu_mirrorTab-popup"
onpopupshowing="populateMirrorTabMenu(this)"/>
</menu>
#ifndef XP_UNIX
<menuseparator id="prefSep"/>
<menuitem id="menu_preferences"
- label="&preferencesCmd2.label;"
- accesskey="&preferencesCmd2.accesskey;"
+ data-l10n-id="preferences-menuitem"
oncommand="openPreferences();"/>
#endif
</menupopup>
</menu>
#ifdef XP_MACOSX
<menu id="windowMenu" />
#endif
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1660,19 +1660,20 @@ var BookmarkingUI = {
},
/**
* forceReset is passed when we're destroyed and the label should go back
* to the default (Bookmark This Page) for OS X.
*/
_updateBookmarkPageMenuItem: function BUI__updateBookmarkPageMenuItem(forceReset) {
let isStarred = !forceReset && this._itemIds.length > 0;
- let label = isStarred ? "editlabel" : "bookmarklabel";
+ let l10nId = isStarred ?
+ "edit-this-page-menuitem" : "bookmark-this-page-menuitem";
if (this.broadcaster) {
- this.broadcaster.setAttribute("label", this.broadcaster.getAttribute(label));
+ this.broadcaster.setAttribute("data-l10n-id", l10nId);
}
},
onMainMenuPopupShowing: function BUI_onMainMenuPopupShowing(event) {
// Don't handle events for submenus.
if (event.target != event.currentTarget)
return;
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -117,36 +117,34 @@
<command id="Browser:ShowAllBookmarks"
oncommand="PlacesCommandHook.showPlacesOrganizer('UnfiledBookmarks');"/>
<command id="Browser:ShowAllHistory"
oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
</commandset>
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="Social:PageShareOrMark" disabled="true"/>
- <broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"
+ <broadcaster id="viewBookmarksSidebar" autoCheck="false" data-l10n-id="bookmarks-button"
type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
oncommand="SidebarUI.toggle('viewBookmarksSidebar');"/>
<!-- for both places and non-places, the sidebar lives at
chrome://browser/content/history/history-panel.xul so there are no
problems when switching between versions -->
- <broadcaster id="viewHistorySidebar" autoCheck="false" sidebartitle="&historyButton.label;"
+ <broadcaster id="viewHistorySidebar" autoCheck="false" data-l10n-id="view-history-menuitem"
type="checkbox" group="sidebar"
sidebarurl="chrome://browser/content/history/history-panel.xul"
oncommand="SidebarUI.toggle('viewHistorySidebar');"/>
<broadcaster id="viewWebPanelsSidebar" autoCheck="false"
type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/web-panels.xul"
oncommand="SidebarUI.toggle('viewWebPanelsSidebar');"/>
<broadcaster id="bookmarkThisPageBroadcaster"
- label="&bookmarkThisPageCmd.label;"
- bookmarklabel="&bookmarkThisPageCmd.label;"
- editlabel="&editThisBookmarkCmd.label;"/>
+ data-l10n-id="bookmark-this-page-menuitem"/>
<!-- popup blocking menu items -->
<broadcaster id="blockedPopupAllowSite"
accesskey="&allowPopups.accesskey;"
oncommand="gPopupBlockerObserver.toggleAllowPopupsForSite(event);"/>
<broadcaster id="blockedPopupEditSettings"
#ifdef XP_WIN
label="&editPopupSettings.label;"
@@ -171,42 +169,37 @@
A 'syncstatus' attribute is set while actively syncing, and the label
attribute which changes from "sync now" to "syncing" etc. -->
<broadcaster id="sync-status"/>
<!-- broadcasters of the "hidden" attribute to reflect setup state for
menus -->
<broadcaster id="sync-setup-state"/>
<broadcaster id="sync-syncnow-state" hidden="true"/>
<broadcaster id="sync-reauth-state" hidden="true"/>
- <broadcaster id="viewTabsSidebar" autoCheck="false" sidebartitle="&syncedTabs.sidebar.label;"
+ <broadcaster id="viewTabsSidebar" autoCheck="false" data-l10n-id="view-synced-tabs-menuitem"
type="checkbox" group="sidebar"
sidebarurl="chrome://browser/content/syncedtabs/sidebar.xhtml"
oncommand="SidebarUI.toggle('viewTabsSidebar');"/>
<broadcaster id="workOfflineMenuitemState"/>
<broadcaster id="socialSidebarBroadcaster" hidden="true"/>
<broadcaster id="devtoolsMenuBroadcaster_PageSource"
- label="&pageSourceCmd.label;"
+ data-l10n-id="page-source-menuitem"
key="key_viewSource"
command="View:PageSource">
<observes element="canViewSource" attribute="disabled"/>
</broadcaster>
</broadcasterset>
<keyset id="mainKeyset">
- <key id="key_newNavigator"
- key="&newNavigatorCmd.key;"
- command="cmd_newNavigator"
- modifiers="accel"/>
- <key id="key_newNavigatorTab" key="&tabCmd.commandkey;" modifiers="accel" command="cmd_newNavigatorTab"/>
- <key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation"
- modifiers="accel"/>
+ <key id="key_newNavigator" data-l10n-id="new-navigator-key" command="cmd_newNavigator" modifiers="accel"/>
+ <key id="key_newNavigatorTab" data-l10n-id="tab-key" modifiers="accel" command="cmd_newNavigatorTab"/>
+ <key id="focusURLBar" key="&openCmd.commandkey;" command="Browser:OpenLocation" modifiers="accel"/>
#ifndef XP_MACOSX
- <key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation"
- modifiers="alt"/>
+ <key id="focusURLBar2" key="&urlbar.accesskey;" command="Browser:OpenLocation" modifiers="alt"/>
#endif
#
# Search Command Key Logic works like this:
#
# Unix: Ctrl+K (cross platform binding)
# Ctrl+J (in case of emacs Ctrl-K conflict)
# Mac: Cmd+K (cross platform binding)
@@ -225,46 +218,38 @@
#ifdef XP_MACOSX
<key id="key_search2" key="&findOnCmd.commandkey;" command="Tools:Search" modifiers="accel,alt"/>
#endif
#ifdef XP_WIN
<key id="key_search2" key="&searchFocus.commandkey2;" command="Tools:Search" modifiers="accel"/>
#endif
#ifdef XP_GNOME
<key id="key_search2" key="&searchFocusUnix.commandkey;" command="Tools:Search" modifiers="accel"/>
- <key id="key_openDownloads" key="&downloadsUnix.commandkey;" command="Tools:Downloads" modifiers="accel,shift"/>
+ <key id="key_openDownloads" data-l10n-id="downloads-key" command="Tools:Downloads" modifiers="accel,shift"/>
#else
- <key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
+ <key id="key_openDownloads" data-l10n-id="downloads-key" command="Tools:Downloads" modifiers="accel"/>
#endif
- <key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
- <key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
- <key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
- <key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>
- <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/>
- <key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift"/>
+ <key id="key_openAddons" data-l10n-id="addons-key" command="Tools:Addons" modifiers="accel,shift"/>
+ <key id="openFileKb" data-l10n-id="open-file-key" command="Browser:OpenFile" modifiers="accel"/>
+ <key id="key_savePage" data-l10n-id="save-page-key" command="Browser:SavePage" modifiers="accel"/>
+ <key id="printKb" data-l10n-id="print-key" command="cmd_print" modifiers="accel"/>
+ <key id="key_close" data-l10n-id="close-key" command="cmd_close" modifiers="accel"/>
+ <key id="key_closeWindow" data-l10n-id="close-key" command="cmd_closeWindow" modifiers="accel,shift"/>
<key id="key_toggleMute" key="&toggleMuteCmd.key;" command="cmd_toggleMute" modifiers="control"/>
- <key id="key_undo"
- key="&undoCmd.key;"
- modifiers="accel"/>
+ <key id="key_undo" data-l10n-id="undo-key" modifiers="accel"/>
#ifdef XP_UNIX
- <key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
+ <key id="key_redo" data-l10n-id="undo-key" modifiers="accel,shift"/>
#else
- <key id="key_redo" key="&redoCmd.key;" modifiers="accel"/>
+ <key id="key_redo" data-l10n-id="redo-key" modifiers="accel"/>
#endif
- <key id="key_cut"
- key="&cutCmd.key;"
- modifiers="accel"/>
- <key id="key_copy"
- key="©Cmd.key;"
- modifiers="accel"/>
- <key id="key_paste"
- key="&pasteCmd.key;"
- modifiers="accel"/>
+ <key id="key_cut" data-l10n-id="cut-key" modifiers="accel"/>
+ <key id="key_copy" data-l10n-id="cut-key" modifiers="accel"/>
+ <key id="key_paste" data-l10n-id="cut-key" modifiers="accel"/>
<key id="key_delete" keycode="VK_DELETE" command="cmd_delete"/>
- <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
+ <key id="key_selectAll" data-l10n-id="select-all-key" modifiers="accel"/>
<key keycode="VK_BACK" command="cmd_handleBackspace"/>
<key keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift"/>
#ifndef XP_MACOSX
<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
<key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
#else
<key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="accel" />
@@ -272,52 +257,52 @@
#endif
#ifdef XP_UNIX
<key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
<key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
#endif
<key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="alt"/>
<key keycode="VK_F5" command="Browser:Reload"/>
#ifndef XP_MACOSX
- <key id="showAllHistoryKb" key="&showAllHistoryCmd.commandkey;" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
+ <key id="showAllHistoryKb" data-l10n-id="show-all-history-key" command="Browser:ShowAllHistory" modifiers="accel,shift"/>
<key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/>
<key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
#else
- <key id="key_fullScreen" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,control"/>
- <key id="key_fullScreen_old" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,shift"/>
+ <key id="key_fullScreen" data-l10n-id="full-screen-key" command="View:FullScreen" modifiers="accel,control"/>
+ <key id="key_fullScreen_old" data-l10n-id="full-screen-key" command="View:FullScreen" modifiers="accel,shift"/>
<key keycode="VK_F11" command="View:FullScreen"/>
#endif
<key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
- <key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
+ <key id="key_viewSource" data-l10n-id="page-source-key" command="View:PageSource" modifiers="accel"/>
#ifndef XP_WIN
- <key id="key_viewInfo" key="&pageInfoCmd.commandkey;" command="View:PageInfo" modifiers="accel"/>
+ <key id="key_viewInfo" data-l10n-id="page-info-key" command="View:PageInfo" modifiers="accel"/>
#endif
- <key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
- <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
- <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
+ <key id="key_find" data-l10n-id="find-on-key" command="cmd_find" modifiers="accel"/>
+ <key id="key_findAgain" data-l10n-id="find-again-key1" command="cmd_findAgain" modifiers="accel"/>
+ <key id="key_findPrevious" data-l10n-id="find-again-key1" command="cmd_findPrevious" modifiers="accel,shift"/>
#ifdef XP_MACOSX
- <key id="key_findSelection" key="&findSelectionCmd.commandkey;" command="cmd_findSelection" modifiers="accel"/>
+ <key id="key_findSelection" data-l10n-id="find-selection-key" command="cmd_findSelection" modifiers="accel"/>
#endif
- <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
- <key keycode="&findAgainCmd.commandkey2;" command="cmd_findPrevious" modifiers="shift"/>
+ <key data-l10n-id="find-again-key2" command="cmd_findAgain"/>
+ <key data-l10n-id="find-again-key2" command="cmd_findPrevious" modifiers="shift"/>
- <key id="addBookmarkAsKb" key="&bookmarkThisPageCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
+ <key id="addBookmarkAsKb" data-l10n-id="bookmark-this-page-key" command="Browser:AddBookmarkAs" modifiers="accel"/>
# Accel+Shift+A-F are reserved on GTK
#ifndef MOZ_WIDGET_GTK
- <key id="bookmarkAllTabsKb" key="&bookmarkThisPageCmd.commandkey;" oncommand="PlacesCommandHook.bookmarkCurrentPages();" modifiers="accel,shift"/>
- <key id="manBookmarkKb" key="&bookmarksCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
+ <key id="bookmarkAllTabsKb" data-l10n-id="bookmark-this-page-key" oncommand="PlacesCommandHook.bookmarkCurrentPages();" modifiers="accel,shift"/>
+ <key id="manBookmarkKb" data-l10n-id="bookmarks-key" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
#else
- <key id="manBookmarkKb" key="&bookmarksGtkCmd.commandkey;" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
+ <key id="manBookmarkKb" data-l10n-id="bookmarks-key" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
#endif
- <key id="viewBookmarksSidebarKb" key="&bookmarksCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
+ <key id="viewBookmarksSidebarKb" data-l10n-id="bookmarks-key" command="viewBookmarksSidebar" modifiers="accel"/>
#ifdef XP_WIN
# Cmd+I is conventially mapped to Info on MacOS X, thus it should not be
# overridden for other purposes there.
- <key id="viewBookmarksSidebarWinKb" key="&bookmarksWinCmd.commandkey;" command="viewBookmarksSidebar" modifiers="accel"/>
+ <key id="viewBookmarksSidebarWinKb" data-l10n-id="bookmarks-key" command="viewBookmarksSidebar" modifiers="accel"/>
#endif
<!--<key id="markPage" key="&markPageCmd.commandkey;" command="Social:TogglePageMark" modifiers="accel,shift"/>-->
<key id="focusChatBar" key="&social.chatBar.commandkey;" command="Chat:Focus"
#ifdef XP_MACOSX
# Sadly the devtools uses shift-accel-c on non-mac and alt-accel-c everywhere else
# So we just use the other
modifiers="accel,shift"
@@ -328,49 +313,49 @@
<key id="key_stop" keycode="VK_ESCAPE" command="Browser:Stop"/>
#ifdef XP_MACOSX
<key id="key_stop_mac" modifiers="accel" key="&stopCmd.macCommandKey;" command="Browser:Stop"/>
#endif
<key id="key_gotoHistory"
- key="&historySidebarCmd.commandKey;"
+ data-l10n-id="history-key"
#ifdef XP_MACOSX
modifiers="accel,shift"
#else
modifiers="accel"
#endif
command="viewHistorySidebar"/>
- <key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;" command="cmd_fullZoomReduce" modifiers="accel"/>
- <key key="&fullZoomReduceCmd.commandkey2;" command="cmd_fullZoomReduce" modifiers="accel"/>
- <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
- <key key="&fullZoomEnlargeCmd.commandkey2;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
- <key key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
- <key id="key_fullZoomReset" key="&fullZoomResetCmd.commandkey;" command="cmd_fullZoomReset" modifiers="accel"/>
- <key key="&fullZoomResetCmd.commandkey2;" command="cmd_fullZoomReset" modifiers="accel"/>
+ <key id="key_fullZoomReduce" data-l10n-id="full-zoom-reduce-key1" command="cmd_fullZoomReduce" modifiers="accel"/>
+ <key data-l10n-id="full-zoom-reduce-key2" command="cmd_fullZoomReduce" modifiers="accel"/>
+ <key id="key_fullZoomEnlarge" data-l10n-id="full-zoom-enlarge-key1" command="cmd_fullZoomEnlarge" modifiers="accel"/>
+ <key data-l10n-id="full-zoom-enlarge-key2" command="cmd_fullZoomEnlarge" modifiers="accel"/>
+ <key data-l10n-id="full-zoom-enlarge-key3" command="cmd_fullZoomEnlarge" modifiers="accel"/>
+ <key id="key_fullZoomReset" data-l10n-id="full-zoom-reset-key1" command="cmd_fullZoomReset" modifiers="accel"/>
+ <key data-l10n-id="full-zoom-reset-key2" command="cmd_fullZoomReset" modifiers="accel"/>
<key id="key_showAllTabs" command="Browser:ShowAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
- <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
+ <key id="key_switchTextDirection" data-l10n-id="bidi-switch-text-direction-key" command="cmd_switchTextDirection" modifiers="accel,shift" />
<key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;" modifiers="accel,shift"/>
<key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
#ifdef XP_MACOSX
<key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
- <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" modifiers="accel" reserved="true"/>
+ <key id="key_quitApplication" data-l10n-id="quit-application-key" modifiers="accel" reserved="true"/>
#elifdef XP_UNIX
- <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" command="cmd_quitApplication" modifiers="accel"/>
+ <key id="key_quitApplication" data-l10n-id="quit-application-key" command="cmd_quitApplication" modifiers="accel"/>
#endif
#ifdef FULL_BROWSER_WINDOW
- <key id="key_undoCloseTab" command="History:UndoCloseTab" key="&tabCmd.commandkey;" modifiers="accel,shift"/>
+ <key id="key_undoCloseTab" command="History:UndoCloseTab" data-l10n-id="tab-key" modifiers="accel,shift"/>
#endif
- <key id="key_undoCloseWindow" command="History:UndoCloseWindow" key="&newNavigatorCmd.key;" modifiers="accel,shift"/>
+ <key id="key_undoCloseWindow" command="History:UndoCloseWindow" data-l10n-id="new-navigator-key" modifiers="accel,shift"/>
#ifdef XP_GNOME
#define NUM_SELECT_TAB_MODIFIER alt
#else
#define NUM_SELECT_TAB_MODIFIER accel
#endif
#expand <key id="key_selectTab1" oncommand="gBrowser.selectTabAtIndex(0, event);" key="1" modifiers="__NUM_SELECT_TAB_MODIFIER__"/>
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -69,16 +69,20 @@
<script type="application/javascript" src="chrome://browser/content/nsContextMenu.js"/>
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
<script type="application/javascript" src="chrome://browser/content/downloads/downloads.js"/>
<script type="application/javascript" src="chrome://browser/content/downloads/indicator.js"/>
<script type="application/javascript" src="chrome://browser/content/places/editBookmarkOverlay.js"/>
+<link rel="localization" href="/browser/menubar.ftl"/>
+<link rel="localization" href="/browser/toolbar.ftl"/>
+<script type="application/javascript" src="chrome://global/content/l20n-chrome-xul.js"/>
+
# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the
# browser-sets.inc file for sharing with hiddenWindow.xul.
#define FULL_BROWSER_WINDOW
#include browser-sets.inc
#undef FULL_BROWSER_WINDOW
<popupset id="mainPopupSet">
<menupopup id="tabContextMenu"
@@ -691,17 +695,17 @@
<hbox id="urlbar-wrapper" flex="1">
<toolbarbutton id="forward-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
label="&forwardCmd.label;"
command="Browser:ForwardOrForwardDuplicate"
onclick="checkForMiddleClick(this, event);"
tooltip="forward-button-tooltip"
context="backForwardMenu"/>
<textbox id="urlbar" flex="1"
- placeholder="&urlbar.placeholder2;"
+ data-l10n-id="urlbar-textbox"
type="autocomplete"
autocompletesearch="unifiedcomplete"
autocompletesearchparam="enable-actions"
autocompletepopup="PopupAutoCompleteRichResult"
completeselectedindex="true"
shrinkdelay="250"
tabscrolling="true"
showcommentcolumn="true"