Bug 1605467 - Migrate text action keys to Fluent. r=fluent-reviewers,Gijs,flod

Differential Revision: https://phabricator.services.mozilla.com/D59272

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Zibi Braniecki 2020-01-17 11:43:39 +00:00
Родитель d97f243585
Коммит 79a10c61a3
7 изменённых файлов: 82 добавлений и 28 удалений

Просмотреть файл

@ -172,24 +172,28 @@
<key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift" reserved="true"/>
<key id="key_toggleMute" key="&toggleMuteCmd.key;" command="cmd_toggleMute" modifiers="control"/>
<key id="key_undo"
key="&undoCmd.key;"
data-l10n-id="text-action-undo-shortcut"
modifiers="accel"/>
<key id="key_redo"
#ifdef XP_UNIX
<key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
data-l10n-id="text-action-undo-shortcut"
modifiers="accel,shift"
#else
<key id="key_redo" key="&redoCmd.key;" modifiers="accel"/>
data-l10n-id="text-action-redo-shortcut"
modifiers="accel"
#endif
/>
<key id="key_cut"
key="&cutCmd.key;"
data-l10n-id="text-action-cut-shortcut"
modifiers="accel"/>
<key id="key_copy"
key="&copyCmd.key;"
data-l10n-id="text-action-copy-shortcut"
modifiers="accel"/>
<key id="key_paste"
key="&pasteCmd.key;"
data-l10n-id="text-action-paste-shortcut"
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="text-action-select-all-shortcut" modifiers="accel"/>
<key keycode="VK_BACK" command="cmd_handleBackspace" reserved="false"/>
<key keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift" reserved="false"/>

Просмотреть файл

@ -26,6 +26,10 @@
title="&downloads.title;"
csp="default-src chrome:; script-src chrome: 'sha512-4o5Uf4E4EG+90Mb820FH2YFDf4IuX4bfUwQC7reK1ZhgcXWJBKMK2330XIELaFJJ8HiPffS9mP60MPjuXMIrHA=='; img-src chrome: moz-icon:; object-src 'none'">
<linkset>
<html:link rel="localization" href="toolkit/global/textActions.ftl"/>
</linkset>
<script src="chrome://global/content/globalOverlay.js"/>
<script src="chrome://browser/content/downloads/contentAreaDownloadsView.js"/>
<script src="chrome://browser/content/downloads/allDownloadsView.js"/>

Просмотреть файл

@ -186,12 +186,6 @@ convenience of Safari and Chrome users on macOS. See bug 1398988. -->
<!ENTITY newPrivateWindow.label "New Private Window">
<!ENTITY editMenu.label "Edit">
<!ENTITY undoCmd.key "Z">
<!ENTITY redoCmd.key "Y">
<!ENTITY cutCmd.key "X">
<!ENTITY copyCmd.key "C">
<!ENTITY pasteCmd.key "V">
<!ENTITY selectAllCmd.key "A">
<!ENTITY preferencesCmd2.label "Options">
<!ENTITY preferencesCmdUnix.label "Preferences">
<!ENTITY logins.label "Logins and Passwords">

Просмотреть файл

@ -0,0 +1,39 @@
# coding=utf8
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
from __future__ import absolute_import
import fluent.syntax.ast as FTL
from fluent.migrate.helpers import transforms_from, TERM_REFERENCE, MESSAGE_REFERENCE
from fluent.migrate import COPY_PATTERN, REPLACE, COPY
def migrate(ctx):
"""Bug 1605467 - Migrate text action shortcuts to Fluent, part {index}."""
ctx.add_transforms(
'toolkit/toolkit/global/textActions.ftl',
'toolkit/toolkit/global/textActions.ftl',
transforms_from(
"""
text-action-undo-shortcut =
.key = { COPY(from_path, "undoCmd.key") }
text-action-redo-shortcut =
.key = { COPY(from_path, "redoCmd.key") }
text-action-cut-shortcut =
.key = { COPY(from_path, "cutCmd.key") }
text-action-copy-shortcut =
.key = { COPY(from_path, "copyCmd.key") }
text-action-paste-shortcut =
.key = { COPY(from_path, "pasteCmd.key") }
text-action-select-all-shortcut =
.key = { COPY(from_path, "selectAllCmd.key") }
""", from_path="browser/chrome/browser/browser.dtd")
)

Просмотреть файл

@ -6,17 +6,21 @@
XBL, in platformHTMLBindings.xml. See bugs 57078 and 71779. -->
<keyset id="editMenuKeys">
<key id="key_undo" key="&undoCmd.key;" modifiers="accel" command="cmd_undo"/>
<key id="key_undo" data-l10n-id="text-action-undo-shortcut" modifiers="accel" command="cmd_undo"/>
<key id="key_redo"
#ifdef XP_UNIX
<key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift" command="cmd_redo"/>
data-l10n-id="text-action-undo-shortcut"
modifiers="accel,shift"
#else
<key id="key_redo" key="&redoCmd.key;" modifiers="accel" command="cmd_redo"/>
data-l10n-id="text-action-redo-shortcut"
modifiers="accel"
#endif
<key id="key_cut" key="&cutCmd.key;" modifiers="accel" command="cmd_cut"/>
<key id="key_copy" key="&copyCmd.key;" modifiers="accel" command="cmd_copy"/>
<key id="key_paste" key="&pasteCmd.key;" modifiers="accel" command="cmd_paste"/>
command="cmd_redo"/>
<key id="key_cut" data-l10n-id="text-action-cut-shortcut" modifiers="accel" command="cmd_cut"/>
<key id="key_copy" data-l10n-id="text-action-copy-shortcut" modifiers="accel" command="cmd_copy"/>
<key id="key_paste" data-l10n-id="text-action-paste-shortcut" modifiers="accel" command="cmd_paste"/>
<key id="key_delete" keycode="VK_DELETE" command="cmd_delete"/>
<key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel" command="cmd_selectAll"/>
<key id="key_selectAll" data-l10n-id="text-action-select-all-shortcut" modifiers="accel" command="cmd_selectAll"/>
<key id="key_find" key="&findCmd.key;" modifiers="accel" command="cmd_find"/>
<key id="key_findAgain" key="&findAgainCmd.key;" modifiers="accel" command="cmd_findAgain"/>
<key id="key_findPrevious" key="&findAgainCmd.key;" modifiers="shift,accel" command="cmd_findPrevious"/>

Просмотреть файл

@ -2,14 +2,6 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY editMenu.label "Edit">
<!ENTITY editMenu.accesskey "e">
<!ENTITY undoCmd.key "Z">
<!ENTITY redoCmd.key "Y">
<!ENTITY cutCmd.key "X">
<!ENTITY copyCmd.key "C">
<!ENTITY pasteCmd.key "V">
<!ENTITY selectAllCmd.key "A">
<!ENTITY findCmd.label "Find">
<!ENTITY findCmd.key "F">
<!ENTITY findCmd.accesskey "F">

Просмотреть файл

@ -6,22 +6,37 @@ text-action-undo =
.label = Undo
.accesskey = U
text-action-undo-shortcut =
.key = Z
text-action-redo =
.label = Redo
.accesskey = R
text-action-redo-shortcut =
.key = Y
text-action-cut =
.label = Cut
.accesskey = t
text-action-cut-shortcut =
.key = X
text-action-copy =
.label = Copy
.accesskey = C
text-action-copy-shortcut =
.key = C
text-action-paste =
.label = Paste
.accesskey = P
text-action-paste-shortcut =
.key = V
text-action-delete =
.label = Delete
.accesskey = D
@ -30,3 +45,5 @@ text-action-select-all =
.label = Select All
.accesskey = A
text-action-select-all-shortcut =
.key = A