Skip to content

Commit

Permalink
Fix shortcut translation
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Aug 1, 2022
1 parent 42cc66b commit 3976e9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions packages/web-app-files/src/mixins/actions/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export default {
return window.navigator.platform.match('Mac')
},
getCopyShortcutString() {
const modifierKey = this.isMacOs ? '⌘' : 'Ctrl'
return `${modifierKey} + C`
if (this.isMacOs) {
return this.$pgettext('Keyboard shortcut for macOS for copying files', '⌘ + C')
}
return this.$pgettext('Keyboard shortcut for non-macOS systems for copying files', 'Ctrl + C')
},
$_copy_items() {
return [
Expand Down
6 changes: 4 additions & 2 deletions packages/web-app-files/src/mixins/actions/move.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ export default {
return window.navigator.platform.match('Mac')
},
getCutShortcutString() {
const modifierKey = this.isMacOs ? '⌘' : 'Ctrl'
return `${modifierKey} + X`
if (this.isMacOs) {
return this.$pgettext('Keyboard shortcut for macOS for cutting files', '⌘ + X')
}
return this.$pgettext('Keyboard shortcut for non-macOS systems for cutting files', 'Ctrl + X')
},
$_move_items() {
return [
Expand Down
7 changes: 5 additions & 2 deletions packages/web-app-files/src/mixins/actions/paste.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ export default {
...mapGetters('Files', ['clipboardResources']),
isMacOs() {
return window.navigator.platform.match('Mac')

},
getPasteShortcutString() {
const modifierKey = this.isMacOs ? '⌘' : 'Ctrl'
return `${modifierKey} + V`
if (this.isMacOs) {
return this.$pgettext('Keyboard shortcut for macOS for pasting files', '⌘ + V')
}
return this.$pgettext('Keyboard shortcut for non-macOS systems for pasting files', 'Ctrl + V')
},
$_paste_items() {
return [
Expand Down

0 comments on commit 3976e9f

Please sign in to comment.