-
Notifications
You must be signed in to change notification settings - Fork 13k
feat: Detect OS and dynamically update keyboard shortcuts. #37646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1204,12 +1204,17 @@ | |
| "Katex_Parenthesis_Syntax_Description": "\\ [Katex blok \\] və \\ (inline katex \\) sözdizimlərini istifadə etməyə icazə verin", | ||
| "Keep_default_user_settings": "Varsayılan parametrləri saxlayın", | ||
| "Keyboard_Shortcuts_Edit_Previous_Message": "Əvvəlki mesajı redaktə edin", | ||
| "Keyboard_Shortcuts_Keys_1": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_2": "Yuxarı Ok", | ||
| "Keyboard_Shortcuts_Keys_3": "Komut(və ya Alt) + Sol Ok", | ||
| "Keyboard_Shortcuts_Keys_4": "Komut(və ya Alt) + Yuxarıdakı", | ||
| "Keyboard_Shortcuts_Keys_5": "Command(və ya Alt) + Sağ Ok", | ||
| "Keyboard_Shortcuts_Keys_6": "Komut(və ya Alt) + Aşağı Ok", | ||
| "Keyboard_Shortcuts_Keys_3_mac": "Komut + Sol Ok", | ||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + Sol Ok", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent terminology for modifier keys: "Komut" vs "Command". The translations use both "Komut" (Azerbaijani for Command) and "Command" (English) for the same modifier key. Line 1211 uses "Komut", line 1215 uses "Command", and line 1217 uses "Komut" again. This inconsistency breaks the localization quality. All should use the same Azerbaijani term. Also applies to: 1215-1215, 1217-1217 🤖 Prompt for AI Agents |
||
| "Keyboard_Shortcuts_Keys_4_mac": "Komut + Yuxarıdakı", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + Yuxarıdakı", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incomplete translation text: missing key name suffix. Line 1213 reads "Komut + Yuxarıdakı" but appears incomplete. Comparing with adjacent shortcuts (lines 1211, 1214, 1216, 1217), the pattern includes the key type suffix (e.g., "Ok" meaning arrow/key). Line 1213 should likely be "Komut + Yuxarı Ok" or similar for consistency. 🤖 Prompt for AI Agents |
||
| "Keyboard_Shortcuts_Keys_5_mac": "Command + Sağ Ok", | ||
| "Keyboard_Shortcuts_Keys_5_win": "Alt + Sağ Ok", | ||
| "Keyboard_Shortcuts_Keys_6_mac": "Komut + Aşağı Ok", | ||
| "Keyboard_Shortcuts_Keys_6_win": "Alt + Aşağı Ok", | ||
| "Keyboard_Shortcuts_Keys_7": "Shift+ Giriş", | ||
| "Keyboard_Shortcuts_Move_To_Beginning_Of_Message": "Mesajın başlanğıcına keçin", | ||
| "Keyboard_Shortcuts_Move_To_End_Of_Message": "Mesajın sonuna keçin", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1978,14 +1978,20 @@ | |
| "Katex_Parenthesis_Syntax_Description": "Permetre l'ús de \\ [bloc katex \\] \\ sintaxi i (en línia katex \\)", | ||
| "Keep_default_user_settings": "Manteniu la configuració predeterminada", | ||
| "Keyboard_Shortcuts_Edit_Previous_Message": "Edita missatge anterior", | ||
| "Keyboard_Shortcuts_Keys_1": "Comand (o Ctrl ) + p o Command (o Ctrl ) + k ", | ||
| "Keyboard_Shortcuts_Keys_1_mac": "Command + p o Command + k ", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p o Ctrl + k ", | ||
| "Keyboard_Shortcuts_Keys_2": "Fletxa amunt", | ||
| "Keyboard_Shortcuts_Keys_3": "Cmd (o Alt) + Fletxa esquerra", | ||
| "Keyboard_Shortcuts_Keys_4": "Cmd (o Alt) + Fletxa amunt", | ||
| "Keyboard_Shortcuts_Keys_5": "Cmd (o Alt) + Fletxa dreta", | ||
| "Keyboard_Shortcuts_Keys_6": "Cmd (o Alt) + Fletxa avall", | ||
| "Keyboard_Shortcuts_Keys_3_mac": "Cmd + Fletxa esquerra", | ||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + Fletxa esquerra", | ||
| "Keyboard_Shortcuts_Keys_4_mac": "Cmd + Fletxa amunt", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + Fletxa amunt", | ||
| "Keyboard_Shortcuts_Keys_5_mac": "Cmd + Fletxa dreta", | ||
| "Keyboard_Shortcuts_Keys_5_win": "Alt + Fletxa dreta", | ||
| "Keyboard_Shortcuts_Keys_6_mac": "Cmd + Fletxa avall", | ||
| "Keyboard_Shortcuts_Keys_6_win": "Alt + Fletxa avall", | ||
| "Keyboard_Shortcuts_Keys_7": "Shift + Enter", | ||
| "Keyboard_Shortcuts_Keys_8": "Shift (or Ctrl) + ESC", | ||
| "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC", | ||
| "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", | ||
| "Keyboard_Shortcuts_Mark_all_as_read": "Marca tots els missatges (en tots els canals) com a llegits", | ||
|
Comment on lines
+1994
to
1995
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find KeyboardShortcuts component
fd -type f 'KeyboardShortcuts\.' --extension tsx --extension tsRepository: RocketChat/Rocket.Chat Length of output: 188 🏁 Script executed: #!/bin/bash
# Search for Keys_8 references in the codebase
rg -n 'Keys_8' --type=ts --type=tsx --type=jsonRepository: RocketChat/Rocket.Chat Length of output: 188 🏁 Script executed: #!/bin/bash
# Check casing patterns in the ca.i18n.json file around the problematic lines
sed -n '1990,2000p' packages/i18n/src/locales/ca.i18n.jsonRepository: RocketChat/Rocket.Chat Length of output: 188 🏁 Script executed: #!/bin/bash
# Look for keyboard binding implementation and Esc/Escape handling
rg -n -C3 'Escape|ESC|Esc' packages/i18n/src/locales/ca.i18n.json | head -50Repository: RocketChat/Rocket.Chat Length of output: 188 🌐 Web query:
💡 Result: Yes — Ctrl+Esc is a built‑in Windows shell shortcut that opens the Start menu / Start screen and is treated as a reserved/system key combination. (learn.microsoft.com) Citations: 🌐 Web query:
💡 Result: Short answer: Ctrl+Esc is a predefined system (shell) key combination that Windows handles at a low level (so it’s normally intercepted by the OS before an app’s normal message queue). That’s why apps don’t reliably receive or block it. You can only override it with special mechanisms (low-level keyboard hooks are possible but time‑limited and discouraged; enterprise/OS features such as the Keyboard Filter / WEKF PredefinedKey API or policy can block predefined keys). [1][2][4][5] Key points and sources:
If you want, I can:
Change "Ctrl + ESC" to a non-reserved keyboard combo on Windows. Ctrl+Esc is a predefined Windows system shortcut that opens the Start menu. The OS intercepts this key combination at a low level before applications receive it, so users cannot reliably trigger this binding. Either choose a different key combination for Windows or standardize the casing to "Esc" if keeping the current binding. Also ensure consistent "Esc" casing across all key definitions in this locale file. 🤖 Prompt for AI Agents |
||
| "Keyboard_Shortcuts_Move_To_Beginning_Of_Message": "Moure's al principi del missatge", | ||
| "Keyboard_Shortcuts_Move_To_End_Of_Message": "Moure's al final del missatge", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1200,12 +1200,17 @@ | |
| "Katex_Parenthesis_Syntax_Description": "Caniatáu defnyddio cystrawen \\ [katex block] a \\ (inline katex \\)", | ||
| "Keep_default_user_settings": "Cadwch y gosodiadau diofyn", | ||
| "Keyboard_Shortcuts_Edit_Previous_Message": "Golygu neges flaenorol", | ||
| "Keyboard_Shortcuts_Keys_1": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_2": "Up Arrow", | ||
| "Keyboard_Shortcuts_Keys_3": "Command(neu Alt) + Left Left", | ||
| "Keyboard_Shortcuts_Keys_4": "Command(neu Alt) + Up Arrow", | ||
| "Keyboard_Shortcuts_Keys_5": "Command(neu Alt) + Right Arrow", | ||
| "Keyboard_Shortcuts_Keys_6": "Command(neu Alt) + Down Arrow", | ||
| "Keyboard_Shortcuts_Keys_3_mac": "Command + Left Left", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix duplicated "Left" text in arrow key shortcuts. Lines 1206 and 1207 both contain
These should likely be: - "Keyboard_Shortcuts_Keys_3_mac": "Command + Left Left",
+ "Keyboard_Shortcuts_Keys_3_mac": "Command + Left",
- "Keyboard_Shortcuts_Keys_3_win": "Alt + Left Left",
+ "Keyboard_Shortcuts_Keys_3_win": "Alt + Left",Or if the intention is to spell out "Arrow": - "Keyboard_Shortcuts_Keys_3_mac": "Command + Left Left",
+ "Keyboard_Shortcuts_Keys_3_mac": "Command + Left Arrow",Also applies to: 1207-1207 🤖 Prompt for AI Agents |
||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + Left Left", | ||
| "Keyboard_Shortcuts_Keys_4_mac": "Command + Up Arrow", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + Up Arrow", | ||
| "Keyboard_Shortcuts_Keys_5_mac": "Command + Right Arrow", | ||
| "Keyboard_Shortcuts_Keys_5_win": "Alt + Right Arrow", | ||
| "Keyboard_Shortcuts_Keys_6_mac": "Command + Down Arrow", | ||
| "Keyboard_Shortcuts_Keys_6_win": "Alt + Down Arrow", | ||
| "Keyboard_Shortcuts_Keys_7": "Shift+ Rhowch", | ||
| "Keyboard_Shortcuts_Move_To_Beginning_Of_Message": "Symudwch i ddechrau'r neges", | ||
| "Keyboard_Shortcuts_Move_To_End_Of_Message": "Symudwch i ddiwedd y neges", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not manually update non-English locale files—only en.i18n.json should be modified.
Per the repository workflow, new translation keys should only be added to
packages/i18n/src/locales/en.i18n.json. Other locale files like Afrikaans (af.i18n.json) are populated via the external translation pipeline or fall back to English entries. Manually adding keys to non-English files circumvents this process and creates maintenance burden.Recommended action: Remove all keyboard shortcut key additions from this file and ensure they exist only in
en.i18n.json. The translation pipeline will propagate them to other locales.Based on learnings: In this repository, new translation keys should be added to
packages/i18n/src/locales/en.i18n.jsononly; other locale files are populated via the external translation pipeline and/or fall back to English.🤖 Prompt for AI Agents