Skip to content

Commit

Permalink
Vary show shortcut by OS, automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jul 29, 2024
1 parent 14ee1e5 commit 4eee4d1
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion source/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"message": "Nach Name suchen…"
},
"undoInfoMsg": {
"message": "Du kannst deine letzte Aktionen rückgäng machen oder wiederherstellen. Dies funktioniert aber nur solange wie dieser Popup-Dialog geöffnet ist. Drücke dazu <kbd>Strg+z</kbd> unter Windows und <kbd>cmd+z</kbd> unter macOS, <kbd>super+z</kbd> unter Ubuntu."
"message": "Du kannst deine letzte Aktionen rückgäng machen oder wiederherstellen. Dies funktioniert aber nur solange wie dieser Popup-Dialog geöffnet ist. Drücke dazu <kbd>Strg+Z</kbd>"
},
"uninstall": {
"message": "Erweiterung entfernen…"
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"message": "Search by name…"
},
"undoInfoMsg": {
"message": "You can undo and redo your last action until you close this popup. Press <kbd>ctrl+z</kbd> on Windows or Ubuntu, and <kbd>cmd+z</kbd> on macOS."
"message": "You can undo and redo your last action until you close this popup. Press <kbd>Ctrl+Z</kbd>"
},
"uninstall": {
"message": "Remove from Chrome"
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"message": "Buscar por nombre…"
},
"undoInfoMsg": {
"message": "Puedes deshacer y rehacer tu última acción hasta que cierres esta ventana. Presiona <kbd>ctrl+z</kbd> en Windows y <kbd>cmd+z</kbd> en macOS, <kbd>super+z</kbd> en Ubuntu."
"message": "Puedes deshacer y rehacer tu última acción hasta que cierres esta ventana. Presiona <kbd>Ctrl+Z</kbd>"
},
"uninstall": {
"message": "Eliminar"
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"hash": "1220702106584c8c90c0f41c486a3e0b"
},
"undoInfoMsg": {
"message": "Vous pouvez annuler et refaire votre dernière action jusqu'à ce que vous fermiez cette fenêtre contextuelle. Appuyez sur <kbd>ctrl+z</kbd> sur Windows et <kbd>cmd+z</kbd> sur macOS, <kbd>super+z</kbd> sur Ubuntu.",
"message": "Vous pouvez annuler et refaire votre dernière action jusqu'à ce que vous fermiez cette fenêtre contextuelle. Appuyez sur <kbd>Ctrl+Z</kbd>",
"hash": "4105b6ebe6d3c7badf1a2bf9d425ddbb"
},
"uninstall": {
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/he/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"message": "חיפוש תוסף לפי שם"
},
"undoInfoMsg": {
"message": "ניתן לבטל או לבצע מחדש פעולות עד לסגירת החלון באמצעות <kbd>ctrl+z</kbd> ב - windows, <kbd>cmd+z</kbd> ב - macOS או <kbd>super+z</kbd> ב Ubuntu."
"message": "ניתן לבטל או לבצע מחדש פעולות עד לסגירת החלון באמצעות <kbd>Ctrl+Z</kbd>"
},
"uninstall": {
"message": "להסיר את התוסף"
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/it/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"hash": "1220702106584c8c90c0f41c486a3e0b"
},
"undoInfoMsg": {
"message": "Puoi annullare e ripetere la tua ultima azione finché non chiudi questo popup. Premi <kbd>ctrl+z</kbd> su Windows, <kbd>cmd+z</kbd> su macOS o <kbd>super+z</kbd> on Ubuntu.",
"message": "Puoi annullare e ripetere la tua ultima azione finché non chiudi questo popup. Premi <kbd>Ctrl+Z</kbd>",
"hash": "4c9adc1bb6418b3ecbc77f3ddda22a70"
},
"uninstall": {
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/nl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"hash": "1220702106584c8c90c0f41c486a3e0b"
},
"undoInfoMsg": {
"message": "Je kan je laatste actie ongedaan maken of opnieuw uitvoeren totdat je deze popup sluit. Druk op <kbd>ctrl+z</kbd> op Windows of Ubuntu, en <kbd>cmd+z</kbd> op MacOS.",
"message": "Je kan je laatste actie ongedaan maken of opnieuw uitvoeren totdat je deze popup sluit. Druk op <kbd>Ctrl+Z</kbd>",
"hash": "b8be6c1fc88c7e6042b054effb2c6981"
},
"uninstall": {
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/tr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"hash": "1220702106584c8c90c0f41c486a3e0b"
},
"undoInfoMsg": {
"message": "Bu pencere kapanıncaya kadar son işleminizi geri ya da ileri alabilirsiniz. Windows’ta <kbd>ctrl+z</kbd>’ye, macOS’te <kbd>cmd+z</kbd>’ye.",
"message": "Bu pencere kapanıncaya kadar son işleminizi geri ya da ileri alabilirsiniz. Windows’ta <kbd>Ctrl+Z</kbd>’ye, macOS’te <kbd>cmd+z</kbd>’ye.",
"hash": "4105b6ebe6d3c7badf1a2bf9d425ddbb"
},
"uninstall": {
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"message": "查找扩展"
},
"undoInfoMsg": {
"message": "在关闭这个窗口前你可以撤销你的操作。 在 Windows 或 Ubuntu 中按 <kbd>Ctrl+Z</kbd>, macOS 中按<kbd>CMD+Z</kbd>."
"message": "在关闭这个窗口前你可以撤销你的操作。 在 Windows 中按 <kbd>Ctrl+Z</kbd>"
},
"uninstall": {
"message": "卸载这个扩展"
Expand Down
2 changes: 1 addition & 1 deletion source/_locales/zh_TW/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"hash": "1220702106584c8c90c0f41c486a3e0b"
},
"undoInfoMsg": {
"message": "在關閉這個窗口前你可以撤銷你的操作。 <br>在 Windows 或 Ubuntu 中按<kbd>ctrl+z</kbd>, macOS 中按<kbd>cmd+z</kbd>。",
"message": "在關閉這個窗口前你可以撤銷你的操作。 <br>在 Windows 中按<kbd>Ctrl+Z</kbd>",
"hash": "4105b6ebe6d3c7badf1a2bf9d425ddbb"
},
"uninstall": {
Expand Down
4 changes: 3 additions & 1 deletion source/app.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
const getI18N = chrome.i18n.getMessage;
const undoStack = new UndoStack(window);
// Replace the whole kbd because some locales don't call it "ctrl"
const replaceKbdOnMac = (string) => navigator.platform.includes('Mac') ? string.replace(/<kbd>(.*?)<\/kbd>/g, '<kbd>⌘Z</kbd>') : string;

Check failure on line 12 in source/app.svelte

View workflow job for this annotation

GitHub Actions / Lint

Prefer `String#replaceAll()` over `String#replace()`
const myid = getI18N('@@extension_id');
let extensions = [];
Expand Down Expand Up @@ -149,7 +151,7 @@
<main>
{#if showInfoMessage && !userClickedHideInfoMessage}
<p class="notice">
{@html getI18N('undoInfoMsg')}
{@html replaceKbdOnMac(getI18N('undoInfoMsg'))}
<a class="hide-action" href="#hide" on:click={hideInfoMessage}
>{getI18N('hideInfoMsg')}</a
>
Expand Down

0 comments on commit 4eee4d1

Please sign in to comment.