Bug 1288406 - Part 6: Don't use OS() for platform-specific key shortcuts for now. r=Pike
Using L20n's OS() function doesn't currently work with XUL's "key" attributes.
The key shortcuts become inactive even though the "key" attributes are
localized and set correctly. I filed
bug 1291915 to track this issue.
MozReview-Commit-ID: IsUtFexMUac
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -82,20 +82,28 @@
command="cmd_print"/>
<menuseparator/>
<menuitem id="goOfflineMenuitem"
data-l10n-id="go-offline-menuitem"
type="checkbox"
observes="workOfflineMenuitemState"
oncommand="BrowserOffline.toggleOfflineStatus();"/>
<menuitem id="menu_FileQuitItem"
+#ifdef XP_WIN
+ data-l10n-id="quit-application-menuitem-win"
+#else
+#ifdef XP_MACOSX
+ data-l10n-id="quit-application-menuitem-mac"
+#else
data-l10n-id="quit-application-menuitem"
+#endif
#ifdef XP_UNIX
key="key_quitApplication"
#endif
+#endif
command="cmd_quitApplication"/>
</menupopup>
</menu>
<menu id="edit-menu" data-l10n-id="edit-menu">
<menupopup id="menu_EditPopup"
onpopupshowing="updateEditUIVisibility()"
onpopuphidden="updateEditUIVisibility()">
@@ -144,17 +152,17 @@
data-l10n-id="bidi-switch-text-direction-menuitem"
command="cmd_switchTextDirection"
key="key_switchTextDirection"
hidden="true"/>
#ifdef XP_UNIX
#ifndef XP_MACOSX
<menuseparator/>
<menuitem id="menu_preferences"
- data-l10n-id="preferences-menuitem"
+ data-l10n-id="preferences-menuitem-unix"
oncommand="openPreferences();"/>
#endif
#endif
</menupopup>
</menu>
<menu id="view-menu" data-l10n-id="view-menu">
<menupopup id="menu_viewPopup"
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -221,17 +221,17 @@
#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" data-l10n-id="downloads-key" command="Tools:Downloads" modifiers="accel,shift"/>
+ <key id="key_openDownloads" data-l10n-id="downloads-key-unix" command="Tools:Downloads" modifiers="accel,shift"/>
#else
<key id="key_openDownloads" data-l10n-id="downloads-key" command="Tools:Downloads" modifiers="accel"/>
#endif
<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"/>
@@ -287,18 +287,20 @@
#endif
<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" 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" data-l10n-id="bookmark-this-page-key" oncommand="PlacesCommandHook.bookmarkCurrentPages();" modifiers="accel,shift"/>
+ <key id="manBookmarkKb" data-l10n-id="show-all-bookmarks-key" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
+#else
+ <key id="manBookmarkKb" data-l10n-id="show-all-bookmarks-key-gtk" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
#endif
- <key id="manBookmarkKb" data-l10n-id="show-all-bookmarks-key" command="Browser:ShowAllBookmarks" modifiers="accel,shift"/>
<key id="viewBookmarksSidebarKb" data-l10n-id="view-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" data-l10n-id="view-bookmarks-key-win" command="viewBookmarksSidebar" modifiers="accel"/>
#endif
<!--<key id="markPage" key="&markPageCmd.commandkey;" command="Social:TogglePageMark" modifiers="accel,shift"/>-->
@@ -338,19 +340,19 @@
<key id="key_showAllTabs" command="Browser:ShowAllTabs" keycode="VK_TAB" modifiers="control,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" data-l10n-id="quit-application-key" modifiers="accel" reserved="true"/>
+ <key id="key_quitApplication" data-l10n-id="quit-application-key-unix" modifiers="accel" reserved="true"/>
#elifdef XP_UNIX
- <key id="key_quitApplication" data-l10n-id="quit-application-key" command="cmd_quitApplication" modifiers="accel"/>
+ <key id="key_quitApplication" data-l10n-id="quit-application-key-unix" command="cmd_quitApplication" modifiers="accel"/>
#endif
#ifdef FULL_BROWSER_WINDOW
<key id="key_undoCloseTab" command="History:UndoCloseTab" data-l10n-id="tab-key" modifiers="accel,shift"/>
#endif
<key id="key_undoCloseWindow" command="History:UndoCloseWindow" data-l10n-id="new-navigator-key" modifiers="accel,shift"/>
#ifdef XP_GNOME
--- a/browser/locales/en-US/browser/menubar.ftl
+++ b/browser/locales/en-US/browser/menubar.ftl
@@ -69,28 +69,25 @@ print-menuitem =
print-key =
[xul/key] p
go-offline-menuitem =
[xul/label] Work Offline
[xul/accesskey] k
quit-application-menuitem =
- [xul/label] { OS() ->
- [win] Exit
- [mac] Quit { brand-shorter-name }
- *[lin] Quit
- }
- [xul/accesskey] { OS() ->
- [win] x
- [mac] Q
- *[lin] Q
- }
-# [xul/key] is used by both Linux and OSX builds
-quit-application-key =
+ [xul/label] Quit
+ [xul/accesskey] Q
+quit-application-menuitem-win =
+ [xul/label] Exit
+ [xul/accesskey] x
+quit-application-menuitem-mac =
+ [xul/label] Quit { brand-shorter-name }
+# Used by both Linux and OSX builds
+quit-application-key-unix =
[xul/key] Q
[[ Edit menu ]]
edit-menu =
[xul/label] Edit
[xul/accesskey] E
undo-menuitem =
@@ -146,24 +143,21 @@ find-selection-key =
bidi-switch-text-direction-menuitem =
[xul/label] Switch Text Direction
[xul/accesskey] w
bidi-switch-text-direction-key =
[xul/key] X
preferences-menuitem =
- [xul/label] { OS() ->
- [win] Options
- *[other] Preferences
- }
- [xul/accesskey] { OS() ->
- [win] O
- *[other] n
- }
+ [xul/label] Options
+ [xul/accesskey] O
+preferences-menuitem-unix =
+ [xul/label] Preferences
+ [xul/accesskey] n
[[ View menu ]]
view-menu =
[xul/label] View
[xul/accesskey] V
view-toolbars-menu =
@@ -262,23 +256,22 @@ history-undo-window-menu =
[[ Bookmarks menu ]]
bookmarks-menu =
[xul/label] Bookmarks
[xul/accesskey] B
show-all-bookmarks-menuitem =
[xul/label] Show All Bookmarks
-# The command key for [lin] should not contain the letters A-F since they
-# are reserved shortcut keys on Linux.
show-all-bookmarks-key =
- [xul/key] { OS() ->
- [lin] o
- *[other] b
- }
+ [xul/key] b
+# [xul/key] should not contain the letters A-F since the are reserved shortcut
+# keys on Linux.
+show-all-bookmarks-key-gtk =
+ [xul/key] o
bookmark-this-page-broadcaster =
[xul/label] Bookmark This Page
edit-this-page-broadcaster =
[xul/label] Edit This Page
bookmark-this-page-key =
[xul/key] d
subscribe-to-page-menuitem =
[xul/label] Subscribe to This Page…
@@ -300,20 +293,19 @@ personalbar-menu =
tools-menu =
[xul/label] Tools
[xul/accesskey] T
downloads-menuitem =
[xul/label] Downloads
[xul/accesskey] D
downloads-key =
- [xul/key] { OS() ->
- [lin] y
- *[other] j
- }
+ [xul/key] j
+downloads-key-unix =
+ [xul/key] y
addons-menuitem =
[xul/label] Add-ons
[xul/accesskey] A
addons-key =
[xul/key] A
sync-sign-in-menuitem =
[xul/label] Sign In To { sync-brand-short-name }…