-
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?
feat: Detect OS and dynamically update keyboard shortcuts. #37646
Conversation
…cuts and improved related text content.
|
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
WalkthroughImplements platform-specific keyboard shortcuts by detecting the user's operating system and selecting appropriate localized strings. Introduces Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 14
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
🟡 Minor comments (14)
packages/i18n/src/locales/sk-SK.i18n.json-1215-1216 (1)
1215-1216: Fix inconsistent keyboard shortcut terminology in Slovak translation.Line 1215 uses English "Command" while lines 1218–1225 use the Slovak "Príkaz" for the macOS modifier key. For consistency, line 1215 should use "Príkaz" instead of "Command":
- "Keyboard_Shortcuts_Keys_1_mac": "Command + p ALEBO Command + k", + "Keyboard_Shortcuts_Keys_1_mac": "Príkaz + p ALEBO Príkaz + k",packages/i18n/src/locales/sv.i18n.json-2670-2684 (1)
2670-2684: Normalize keyboard shortcut wording and casing for consistency.
- Use “eller” (not “ELLER”), capitalize key letters (P/K), keep “Kommando” casing consistent, and unify arrows as “Pil ” to match “Pil upp/ned” style used elsewhere.
Apply:
- "Keyboard_Shortcuts_Keys_1_mac": "Kommando + p ELLER kommando + k", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p ELLER Ctrl + k", + "Keyboard_Shortcuts_Keys_1_mac": "Kommando + P eller Kommando + K", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + P eller Ctrl + K", - "Keyboard_Shortcuts_Keys_3_mac": "Kommando + Vänsterpil", - "Keyboard_Shortcuts_Keys_3_win": "Alt + Vänsterpil", + "Keyboard_Shortcuts_Keys_3_mac": "Kommando + Pil vänster", + "Keyboard_Shortcuts_Keys_3_win": "Alt + Pil vänster", "Keyboard_Shortcuts_Keys_4_mac": "Kommando + Pil upp", "Keyboard_Shortcuts_Keys_4_win": "Alt + Pil upp", - "Keyboard_Shortcuts_Keys_5_mac": "Kommando + Högerpil", - "Keyboard_Shortcuts_Keys_5_win": "Alt + Högerpil", + "Keyboard_Shortcuts_Keys_5_mac": "Kommando + Pil höger", + "Keyboard_Shortcuts_Keys_5_win": "Alt + Pil höger", "Keyboard_Shortcuts_Keys_6_mac": "Kommando + Pil ned", "Keyboard_Shortcuts_Keys_6_win": "Alt + Pil ned", "Keyboard_Shortcuts_Keys_8_mac": "Skift + ESC", "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC",packages/i18n/src/locales/ar.i18n.json-2019-2020 (1)
2019-2020: Normalize Esc casing to match “Enter” style.Use “Esc” (title case) instead of all caps “ESC”.
- "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", + "Keyboard_Shortcuts_Keys_8_mac": "Shift + Esc", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + Esc",packages/i18n/src/locales/ar.i18n.json-2010-2017 (1)
2010-2017: Use “Command” instead of “أمر” for consistency with other modifiers.Keep arrows in Arabic; just switch the modifier label.
- "Keyboard_Shortcuts_Keys_3_mac": "أمر + سهم لليسار", + "Keyboard_Shortcuts_Keys_3_mac": "Command + سهم لليسار", - "Keyboard_Shortcuts_Keys_4_mac": "أمر + سهم لأعلى", + "Keyboard_Shortcuts_Keys_4_mac": "Command + سهم لأعلى", - "Keyboard_Shortcuts_Keys_5_mac": "أمر + سهم لليمين", + "Keyboard_Shortcuts_Keys_5_mac": "Command + سهم لليمين", - "Keyboard_Shortcuts_Keys_6_mac": "أمر + سهم لأسفل", + "Keyboard_Shortcuts_Keys_6_mac": "Command + سهم لأسفل",packages/i18n/src/locales/ar.i18n.json-2007-2008 (1)
2007-2008: Unify modifier naming and key-case (use “Command”, uppercase letters).mac uses Arabic “أمر” while others use English (“Shift”, “Ctrl”). Also use uppercase P/K for clarity.
Apply:
- "Keyboard_Shortcuts_Keys_1_mac": "أمر + p أو أمر + k", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p أو Ctrl + k", + "Keyboard_Shortcuts_Keys_1_mac": "Command + P أو Command + K", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + P أو Ctrl + K",packages/i18n/src/locales/hu.i18n.json-2177-2179 (1)
2177-2179: Minor locale copy nit: use lowercase “vagy”.Hungarian style prefers “vagy” (lowercase) mid-phrase.
- "Keyboard_Shortcuts_Keys_1_mac": "Command + p VAGY Command + k", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p VAGY Ctrl + k", + "Keyboard_Shortcuts_Keys_1_mac": "Command + p vagy Command + k", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p vagy Ctrl + k",packages/i18n/src/locales/nl.i18n.json-1997-1998 (1)
1997-1998: Fix casing and conjunction in shortcut labels (nl).Use lowercase “of” and uppercase letters for keys.
- "Keyboard_Shortcuts_Keys_1_mac": "Command + p OF Command + k", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p OF Ctrl + k", + "Keyboard_Shortcuts_Keys_1_mac": "Command + P of Command + K", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + P of Ctrl + K",packages/i18n/src/locales/nb.i18n.json-2673-2674 (1)
2673-2674: Fix stray double spaces before “Pil”.There are double spaces after the plus sign; align spacing with surrounding entries.
- "Keyboard_Shortcuts_Keys_3_mac": "Kommando + Pil venstre", - "Keyboard_Shortcuts_Keys_3_win": "Alt + Pil venstre", + "Keyboard_Shortcuts_Keys_3_mac": "Kommando + Pil venstre", + "Keyboard_Shortcuts_Keys_3_win": "Alt + Pil venstre",(No content changes needed for Keys_4/5/6 lines; they already match the single‑space pattern.)
Also applies to: 2675-2679
packages/i18n/src/locales/ko.i18n.json-1762-1775 (1)
1762-1775: Clean up leading/trailing whitespace in keyboard shortcut translations.The OS-specific keyboard shortcut translations have minor formatting issues that should be corrected:
Line 1771: Extra leading space in
Keyboard_Shortcuts_Keys_6_mac
- Current:
" Command + 아래 화살표"- Should be:
"Command + 아래 화살표"Lines 1774-1775: Trailing spaces after
ESC
- Current:
"Shift + ESC "and"Ctrl + ESC "- Should be:
"Shift + ESC"and"Ctrl + ESC"These inconsistencies may cause subtle display issues in the UI or introduce unintended whitespace in tooltips.
- "Keyboard_Shortcuts_Keys_6_mac": " Command + 아래 화살표", + "Keyboard_Shortcuts_Keys_6_mac": "Command + 아래 화살표", - "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC ", + "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC ", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC",packages/i18n/src/locales/en.i18n.json-2683-2685 (1)
2683-2685: Minor text nits in key 1 (Mac/Win).
- Extra space: "Command + p" has double space before "+".
- Consider consistent casing for keys (see Esc note below).
Apply this diff:
- "Keyboard_Shortcuts_Keys_1_mac": "Command + p OR Command + k", + "Keyboard_Shortcuts_Keys_1_mac": "Command + p OR Command + k",packages/i18n/src/locales/ja.i18n.json-1995-1996 (1)
1995-1996: Unify “Esc/ESC” styling with existing strings.Elsewhere the locale uses “Esc” (e.g., “Escキーで”). Prefer “Esc” over “ESC” for consistency.
- "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", + "Keyboard_Shortcuts_Keys_8_mac": "Shift + Esc", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + Esc",Committable suggestion skipped: line range outside the PR's diff.
packages/i18n/src/locales/ja.i18n.json-1982-1983 (1)
1982-1983: Normalize key letter casing and spacing around “または”.Use consistent style like other entries (“Shift + Enter”): capitalize keys and add spaces around “または”.
- "Keyboard_Shortcuts_Keys_1_mac": "Command + pまたはCommand + k", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + pまたはCtrl + k", + "Keyboard_Shortcuts_Keys_1_mac": "Command + P または Command + K", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + P または Ctrl + K",packages/i18n/src/locales/ja.i18n.json-1988-1988 (1)
1988-1988: Remove double space before “+”.There’s an extra space after “Command”.
- "Keyboard_Shortcuts_Keys_4_mac": "Command + ↑", + "Keyboard_Shortcuts_Keys_4_mac": "Command + ↑",Committable suggestion skipped: line range outside the PR's diff.
packages/i18n/src/locales/ro.i18n.json-1211-1218 (1)
1211-1218: Inconsistent terminology for macOS modifier key in Romanian locale.Lines 1211–1213 use the Romanian term
"Comandă"for the Command key, while lines 1215–1217 use the English term"Command". For consistency in a Romanian locale file, all keyboard shortcut keys should use the same language.Recommend standardizing on either
"Comandă"(Romanian) or"Command"(English) throughout these keyboard shortcut entries.
🧹 Nitpick comments (18)
packages/i18n/src/locales/mn.i18n.json (1)
1208-1215: Inconsistent terminology in arrow key translationsThe Mongolian translations for arrow keys use mixed language conventions:
- Lines 1208-1211 (Keys_3, 4): Mix English word "Arrow" with Mongolian text (
"Тушаал + Зүүн Arrow","Тушаал + Дээш Arrow")- Lines 1212-1215 (Keys_5, 6): Use Mongolian
"сумтай"(meaning arrow/pointer) instead ("Баруун сумтай","Доош сумтай")For consistency and localization quality, standardize the arrow key naming across all shortcuts to use either the Mongolian term or English, but not a mix.
packages/i18n/src/locales/fa.i18n.json (1)
1445-1446: Minor inconsistency in keyboard shortcut notation across OS variants.The search shortcuts (Keys_1) remain entirely in English notation ("Command + p OR Command + k" / "Ctrl + p OR Ctrl + k"), while navigation shortcuts (Keys_3–6) use mixed Persian-English notation ("فرمان + فلش چپ" / "Alt + فلش چپ"). This is likely intentional to preserve standard keyboard notation for search, but ensure this approach is documented or consistent across all locale files if applicable.
packages/i18n/src/locales/ms-MY.i18n.json (1)
1215-1216: Partial translation: Keys_5 variants mix English ("Arrow") with Malay ("Panah").Lines 1215–1216 for
Keyboard_Shortcuts_Keys_5_macandKeyboard_Shortcuts_Keys_5_wincontain"Arrow Right"in English, whereas similar lines (e.g., 1211–1213) use full Malay translations like"Panah Kiri". For consistency and full localization, consider translating to"Perintah + Panah Kanan"(macOS) and"Alt + Panah Kanan"(Windows).packages/i18n/src/locales/ru.i18n.json (2)
2117-2118: Align terminology/casing with existing style (“Command”, “Ctrl”).Use “Command” (not “Команда”) to match nearby entries and “Ctrl” (not “CTRL”). Also drop the trailing spaces.
- "Keyboard_Shortcuts_Keys_1_mac": "Команда + p ИЛИ Команда + k ", - "Keyboard_Shortcuts_Keys_1_win": "CTRL + p ИЛИ CTRL + k ", + "Keyboard_Shortcuts_Keys_1_mac": "Command + p ИЛИ Command + k", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p ИЛИ Ctrl + k",
2130-2131: Casing and whitespace for Esc; trim trailing spaces.Prefer “Esc” (consistent with common usage) and remove trailing spaces.
- "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC ", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC ", + "Keyboard_Shortcuts_Keys_8_mac": "Shift + Esc", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + Esc",packages/i18n/src/locales/hu.i18n.json (1)
2180-2187: Consistency note (optional): decide strategy for mixed generic vs OS-suffixed keys.Keys 2 and 7 remain generic while others split per OS. If the UX intends full per-OS listing, consider aligning these too; otherwise add a brief comment in code/docs stating why only some are OS-specific.
packages/i18n/src/locales/hi-IN.i18n.json (1)
2369-2383: Optional: terminology/casing nits if keys are kept temporarily.
- Prefer consistent Hindi for arrows: use “नीचे तीर” instead of “डाउन एरो”.
- Keep key letters/codes consistently cased: “P/K”, “Esc”.
- "Keyboard_Shortcuts_Keys_1_mac": "कमांड + p या कमांड + k", + "Keyboard_Shortcuts_Keys_1_mac": "कमांड + P या कमांड + K", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p या Ctrl + k", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + P या Ctrl + K", - "Keyboard_Shortcuts_Keys_6_mac": "कमांड + डाउन एरो", + "Keyboard_Shortcuts_Keys_6_mac": "कमांड + नीचे तीर", - "Keyboard_Shortcuts_Keys_6_win": "Alt + डाउन एरो", + "Keyboard_Shortcuts_Keys_6_win": "Alt + नीचे तीर", - "Keyboard_Shortcuts_Keys_8_mac": "শিফ्ट + ESC", + "Keyboard_Shortcuts_Keys_8_mac": "शिफ्ट + Esc", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + Esc",packages/i18n/src/locales/nl.i18n.json (2)
2000-2007: Unify arrow terminology.Align left/right with existing “Pijltje omhoog/omlaag” pattern.
- "Keyboard_Shortcuts_Keys_3_mac": "Command + Linker pijl", - "Keyboard_Shortcuts_Keys_3_win": "Alt + Linker pijl", - "Keyboard_Shortcuts_Keys_4_mac": "Command + Pijltje omhoog", - "Keyboard_Shortcuts_Keys_4_win": "Alt + Pijltje omhoog", - "Keyboard_Shortcuts_Keys_5_mac": "Command + Pijl naar rechts", - "Keyboard_Shortcuts_Keys_5_win": "Alt + Pijl naar rechts", - "Keyboard_Shortcuts_Keys_6_mac": "Command + Pijltje omlaag", - "Keyboard_Shortcuts_Keys_6_win": "Alt + Pijltje omlaag", + "Keyboard_Shortcuts_Keys_3_mac": "Command + Pijltje naar links", + "Keyboard_Shortcuts_Keys_3_win": "Alt + Pijltje naar links", + "Keyboard_Shortcuts_Keys_4_mac": "Command + Pijltje omhoog", + "Keyboard_Shortcuts_Keys_4_win": "Alt + Pijltje omhoog", + "Keyboard_Shortcuts_Keys_5_mac": "Command + Pijltje naar rechts", + "Keyboard_Shortcuts_Keys_5_win": "Alt + Pijltje naar rechts", + "Keyboard_Shortcuts_Keys_6_mac": "Command + Pijltje omlaag", + "Keyboard_Shortcuts_Keys_6_win": "Alt + Pijltje omlaag",
2009-2010: Use “Esc” casing consistently.Matches existing “Esc_to” key wording.
- "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", + "Keyboard_Shortcuts_Keys_8_mac": "Shift + Esc", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + Esc",packages/i18n/src/locales/ca.i18n.json (1)
1981-1982: Normalize modifier naming and remove trailing spaces.Use a consistent “Cmd” abbreviation on macOS, capitalize letters, and drop trailing spaces.
Apply:
- "Keyboard_Shortcuts_Keys_1_mac": "Command + p o Command + k ", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p o Ctrl + k ", + "Keyboard_Shortcuts_Keys_1_mac": "Cmd + P o Cmd + K", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + P o Ctrl + K",packages/i18n/src/locales/de.i18n.json (3)
2219-2220: De-strings: prefer “Cmd” and lowercase “oder” for consistency.Consider aligning with common German UI terms.
- "Keyboard_Shortcuts_Keys_1_mac": "Command + p ODER Command + k", - "Keyboard_Shortcuts_Keys_1_win": "Strg + p ODER Strg + k", + "Keyboard_Shortcuts_Keys_1_mac": "Cmd + p oder Cmd + k", + "Keyboard_Shortcuts_Keys_1_win": "Strg + p oder Strg + k",
2223-2230: German phrasing for arrow keys.Use “Pfeiltaste nach …” for clarity; “runter” → “nach unten”.
- "Keyboard_Shortcuts_Keys_3_mac": "Command + Pfeiltaste links", - "Keyboard_Shortcuts_Keys_3_win": "Alt + Pfeiltaste links", - "Keyboard_Shortcuts_Keys_4_mac": "Command + Pfeiltaste hoch", - "Keyboard_Shortcuts_Keys_4_win": "Alt + Pfeiltaste hoch", - "Keyboard_Shortcuts_Keys_5_mac": "Command + Pfeiltaste rechts", - "Keyboard_Shortcuts_Keys_5_win": "Alt + Pfeiltaste rechts", - "Keyboard_Shortcuts_Keys_6_mac": "Command + Pfeiltaste runter", - "Keyboard_Shortcuts_Keys_6_win": "Alt + Pfeiltaste runter", + "Keyboard_Shortcuts_Keys_3_mac": "Cmd + Pfeiltaste nach links", + "Keyboard_Shortcuts_Keys_3_win": "Alt + Pfeiltaste nach links", + "Keyboard_Shortcuts_Keys_4_mac": "Cmd + Pfeiltaste nach oben", + "Keyboard_Shortcuts_Keys_4_win": "Alt + Pfeiltaste nach oben", + "Keyboard_Shortcuts_Keys_5_mac": "Cmd + Pfeiltaste nach rechts", + "Keyboard_Shortcuts_Keys_5_win": "Alt + Pfeiltaste nach rechts", + "Keyboard_Shortcuts_Keys_6_mac": "Cmd + Pfeiltaste nach unten", + "Keyboard_Shortcuts_Keys_6_win": "Alt + Pfeiltaste nach unten",
2232-2233: Esc casing and potential Windows conflict (“Strg + Esc”).
- Use “Esc” casing to match other strings.
- “Strg + Esc” opens the Windows Start menu; verify this shortcut isn’t conflicting.
- "Keyboard_Shortcuts_Keys_8_mac": "Umschalt + ESC", - "Keyboard_Shortcuts_Keys_8_win": "Strg + ESC", + "Keyboard_Shortcuts_Keys_8_mac": "Umschalt + Esc", + "Keyboard_Shortcuts_Keys_8_win": "Strg + Esc",Please confirm the intended key combo on Windows/macOS matches product behavior and avoids OS-reserved shortcuts.
packages/i18n/src/locales/en.i18n.json (1)
2695-2697: Casing consistency for Esc.Elsewhere we use “Esc” (e.g., “Esc to”). Consider aligning:
- "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", + "Keyboard_Shortcuts_Keys_8_mac": "Shift + Esc", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + Esc",apps/meteor/client/views/room/contextualBar/KeyboardShortcuts/KeyboardShortcuts.tsx (2)
15-28: Guardnavigatorat module scope and normalise OS detectionAccessing
navigatorat the top level will throw in non‑browser environments (Node tests, SSR, tooling). Also,osis never set to"macintel"or"macintosh", so those later comparisons are dead.Consider guarding
navigatorand deriving a reusableisMacOSflag:-let os = 'unknown'; - -if (navigator.userAgentData && navigator.userAgentData.platform) { - os = navigator.userAgentData.platform.toLowerCase(); -} else { - // Fallback for Firefox, Safari, older browsers - const ua = navigator.userAgent.toLowerCase(); - - if (ua.includes("win")) os = "windows"; - else if (ua.includes("mac")) os = "macos"; - else if (ua.includes("linux")) os = "linux"; - else if (ua.includes("android")) os = "android"; - else if (ua.includes("iphone") || ua.includes("ipad")) os = "ios"; -} +let os = 'unknown'; + +if (typeof navigator !== 'undefined') { + if (navigator.userAgentData && navigator.userAgentData.platform) { + os = navigator.userAgentData.platform.toLowerCase(); + } else { + const ua = navigator.userAgent.toLowerCase(); + + if (ua.includes('win')) os = 'windows'; + else if (ua.includes('mac')) os = 'macos'; + else if (ua.includes('linux')) os = 'linux'; + else if (ua.includes('android')) os = 'android'; + else if (ua.includes('iphone') || ua.includes('ipad')) os = 'ios'; + } +} + +const isMacOS = os.includes('mac');This keeps behaviour in browsers, avoids crashes when
navigatoris missing, and gives you a single, future‑proof Mac check.
41-47: Reduce duplication in per‑OS shortcut selectionThe condition
os === 'macos' || os === 'macintel' || os === 'macintosh'is repeated and partly dead; with theisMacOShelper, these branches become much clearer:-<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Open_Channel_Slash_User_Search')} command={os === 'macos' || os === 'macintel' || os === 'macintosh' ? t('Keyboard_Shortcuts_Keys_1_mac') : t('Keyboard_Shortcuts_Keys_1_win')} /> -<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Mark_all_as_read')} command={os === 'macos' || os === 'macintel' || os === 'macintosh' ? t('Keyboard_Shortcuts_Keys_8_mac') : t('Keyboard_Shortcuts_Keys_8_win')} /> +<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Open_Channel_Slash_User_Search')} command={isMacOS ? t('Keyboard_Shortcuts_Keys_1_mac') : t('Keyboard_Shortcuts_Keys_1_win')} /> +<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Mark_all_as_read')} command={isMacOS ? t('Keyboard_Shortcuts_Keys_8_mac') : t('Keyboard_Shortcuts_Keys_8_win')} /> @@ -<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_Beginning_Of_Message')} command={os === 'macos' || os === 'macintel' || os === 'macintosh' ? t('Keyboard_Shortcuts_Keys_3_mac') : t('Keyboard_Shortcuts_Keys_3_win')} /> -<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_Beginning_Of_Message')} command={os === 'macos' || os === 'macintel' || os === 'macintosh' ? t('Keyboard_Shortcuts_Keys_4_mac') : t('Keyboard_Shortcuts_Keys_4_win')} /> -<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_End_Of_Message')} command={os === 'macos' || os === 'macintel' || os === 'macintosh' ? t('Keyboard_Shortcuts_Keys_5_mac') : t('Keyboard_Shortcuts_Keys_5_win')} /> -<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_End_Of_Message')} command={os === 'macos' || os === 'macintel' || os === 'macintosh' ? t('Keyboard_Shortcuts_Keys_6_mac') : t('Keyboard_Shortcuts_Keys_6_win')} /> +<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_Beginning_Of_Message')} command={isMacOS ? t('Keyboard_Shortcuts_Keys_3_mac') : t('Keyboard_Shortcuts_Keys_3_win')} /> +<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_Beginning_Of_Message')} command={isMacOS ? t('Keyboard_Shortcuts_Keys_4_mac') : t('Keyboard_Shortcuts_Keys_4_win')} /> +<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_End_Of_Message')} command={isMacOS ? t('Keyboard_Shortcuts_Keys_5_mac') : t('Keyboard_Shortcuts_Keys_5_win')} /> +<KeyboardShortcutSection title={t('Keyboard_Shortcuts_Move_To_End_Of_Message')} command={isMacOS ? t('Keyboard_Shortcuts_Keys_6_mac') : t('Keyboard_Shortcuts_Keys_6_win')} />This keeps the JSX readable and reduces the chance of future condition drift.
packages/i18n/src/locales/fi.i18n.json (1)
2280-2294: Minor casing/wording nits for consistency (fi locale).
- Prefer lowercase "tai" instead of "TAI".
- Use "Esc" (not "ESC") to match existing strings (see "Esc-näppäimellä").
Apply:
- "Keyboard_Shortcuts_Keys_1_mac": "Komento + p TAI Komento + k", - "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p TAI Ctrl + k", + "Keyboard_Shortcuts_Keys_1_mac": "Komento + p tai Komento + k", + "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p tai Ctrl + k", - "Keyboard_Shortcuts_Keys_8_mac": "Vaihto + ESC", - "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", + "Keyboard_Shortcuts_Keys_8_mac": "Vaihto + Esc", + "Keyboard_Shortcuts_Keys_8_win": "Ctrl + Esc",packages/i18n/src/locales/pl.i18n.json (1)
2187-2197: Normalize keyboard modifier casing and punctuation in Polish shortcut labels.The review suggests optional refactoring to:
- Standardize modifier keys: Use "Cmd" (instead of "Polecenie"), "Ctrl" (instead of "CTRL"), "Alt" (consistent casing), and "Esc" (instead of "ESC")
- Replace ", albo" with "lub" for Polish grammar consistency
- Capitalize single-letter keys (P, K)
- Remove trailing spaces
Current Polish entries show inconsistent casing (e.g., "CTRL + p" vs "Alt +") and verbose phrasing. These normalizations improve consistency with common Polish UI conventions.
Note: No
_linuxvariants exist in the i18n files; verify Linux platform fallback behavior if required before implementing changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (57)
apps/meteor/client/views/room/contextualBar/KeyboardShortcuts/KeyboardShortcuts.tsx(2 hunks)packages/i18n/src/locales/af.i18n.json(1 hunks)packages/i18n/src/locales/ar.i18n.json(1 hunks)packages/i18n/src/locales/az.i18n.json(1 hunks)packages/i18n/src/locales/be-BY.i18n.json(1 hunks)packages/i18n/src/locales/bg.i18n.json(1 hunks)packages/i18n/src/locales/bs.i18n.json(1 hunks)packages/i18n/src/locales/ca.i18n.json(1 hunks)packages/i18n/src/locales/cs.i18n.json(1 hunks)packages/i18n/src/locales/cy.i18n.json(1 hunks)packages/i18n/src/locales/da.i18n.json(1 hunks)packages/i18n/src/locales/de-AT.i18n.json(1 hunks)packages/i18n/src/locales/de-IN.i18n.json(1 hunks)packages/i18n/src/locales/de.i18n.json(1 hunks)packages/i18n/src/locales/el.i18n.json(1 hunks)packages/i18n/src/locales/en.i18n.json(1 hunks)packages/i18n/src/locales/eo.i18n.json(1 hunks)packages/i18n/src/locales/es.i18n.json(1 hunks)packages/i18n/src/locales/fa.i18n.json(1 hunks)packages/i18n/src/locales/fi.i18n.json(1 hunks)packages/i18n/src/locales/fr.i18n.json(1 hunks)packages/i18n/src/locales/hi-IN.i18n.json(1 hunks)packages/i18n/src/locales/hr.i18n.json(1 hunks)packages/i18n/src/locales/hu.i18n.json(1 hunks)packages/i18n/src/locales/id.i18n.json(1 hunks)packages/i18n/src/locales/it.i18n.json(1 hunks)packages/i18n/src/locales/ja.i18n.json(1 hunks)packages/i18n/src/locales/ka-GE.i18n.json(1 hunks)packages/i18n/src/locales/km.i18n.json(1 hunks)packages/i18n/src/locales/ko.i18n.json(1 hunks)packages/i18n/src/locales/ku.i18n.json(1 hunks)packages/i18n/src/locales/lo.i18n.json(1 hunks)packages/i18n/src/locales/lt.i18n.json(1 hunks)packages/i18n/src/locales/lv.i18n.json(1 hunks)packages/i18n/src/locales/mn.i18n.json(1 hunks)packages/i18n/src/locales/ms-MY.i18n.json(1 hunks)packages/i18n/src/locales/nb.i18n.json(1 hunks)packages/i18n/src/locales/nl.i18n.json(1 hunks)packages/i18n/src/locales/nn.i18n.json(1 hunks)packages/i18n/src/locales/pl.i18n.json(1 hunks)packages/i18n/src/locales/pt-BR.i18n.json(1 hunks)packages/i18n/src/locales/pt.i18n.json(1 hunks)packages/i18n/src/locales/ro.i18n.json(1 hunks)packages/i18n/src/locales/ru.i18n.json(1 hunks)packages/i18n/src/locales/sk-SK.i18n.json(1 hunks)packages/i18n/src/locales/sl-SI.i18n.json(1 hunks)packages/i18n/src/locales/sq.i18n.json(1 hunks)packages/i18n/src/locales/sr.i18n.json(1 hunks)packages/i18n/src/locales/sv.i18n.json(1 hunks)packages/i18n/src/locales/ta-IN.i18n.json(1 hunks)packages/i18n/src/locales/th-TH.i18n.json(1 hunks)packages/i18n/src/locales/tr.i18n.json(1 hunks)packages/i18n/src/locales/uk.i18n.json(1 hunks)packages/i18n/src/locales/vi-VN.i18n.json(1 hunks)packages/i18n/src/locales/zh-HK.i18n.json(1 hunks)packages/i18n/src/locales/zh-TW.i18n.json(1 hunks)packages/i18n/src/locales/zh.i18n.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/views/room/contextualBar/KeyboardShortcuts/KeyboardShortcuts.tsx
🧠 Learnings (2)
📚 Learning: 2025-11-19T12:32:29.696Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.
Applied to files:
packages/i18n/src/locales/es.i18n.jsonpackages/i18n/src/locales/ku.i18n.jsonpackages/i18n/src/locales/lo.i18n.jsonpackages/i18n/src/locales/hi-IN.i18n.jsonpackages/i18n/src/locales/ru.i18n.jsonpackages/i18n/src/locales/km.i18n.jsonpackages/i18n/src/locales/pt.i18n.jsonpackages/i18n/src/locales/af.i18n.jsonpackages/i18n/src/locales/en.i18n.json
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.
Applied to files:
packages/i18n/src/locales/ru.i18n.jsonpackages/i18n/src/locales/en.i18n.json
🧬 Code graph analysis (1)
apps/meteor/client/views/room/contextualBar/KeyboardShortcuts/KeyboardShortcuts.tsx (1)
apps/meteor/app/utils/lib/i18n.ts (1)
t(6-6)
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_2": "Boontoe arrow", | ||
| "Keyboard_Shortcuts_Keys_3": "Opdrag(of Alt) + Linkerpyltjie", | ||
| "Keyboard_Shortcuts_Keys_4": "Opdrag(of Alt) + Op Arrow", | ||
| "Keyboard_Shortcuts_Keys_5": "Opdrag(of Alt) + Regterpyltjie", | ||
| "Keyboard_Shortcuts_Keys_6": "Opdrag(of Alt) + Onderpyl", | ||
| "Keyboard_Shortcuts_Keys_3_mac": "Opdrag + Linkerpyltjie", | ||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + Linkerpyltjie", | ||
| "Keyboard_Shortcuts_Keys_4_mac": "Opdrag + Op Arrow", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + Op Arrow", | ||
| "Keyboard_Shortcuts_Keys_5_mac": "Opdrag + Regterpyltjie", | ||
| "Keyboard_Shortcuts_Keys_5_win": "Alt + Regterpyltjie", | ||
| "Keyboard_Shortcuts_Keys_6_mac": "Opdrag + Onderpyl", | ||
| "Keyboard_Shortcuts_Keys_6_win": "Alt + Onderpyl", | ||
| "Keyboard_Shortcuts_Keys_7": "Skuif+ Gee", |
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.json only; other locale files are populated via the external translation pipeline and/or fall back to English.
🤖 Prompt for AI Agents
In packages/i18n/src/locales/af.i18n.json around lines 1207 to 1218, this
Afrikaans file contains manually added keyboard shortcut keys that should not be
edited directly; remove the newly added keys (the Keyboard_Shortcuts_Keys_*
entries) from this file so only en.i18n.json contains the new translation keys,
and ensure any corresponding entries are added to
packages/i18n/src/locales/en.i18n.json instead so the translation pipeline can
propagate them to other locales.
| "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", |
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.
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
In packages/i18n/src/locales/az.i18n.json around lines 1211, 1215 and 1217, the
modifier key terminology is inconsistent (mixing "Komut" and "Command"); update
lines 1215 and any other entries nearby that use the English "Command" to the
Azerbaijani "Komut" so all modifier key labels consistently use "Komut" across
the file.
| "Keyboard_Shortcuts_Keys_3_mac": "Komut + Sol Ok", | ||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + Sol Ok", | ||
| "Keyboard_Shortcuts_Keys_4_mac": "Komut + Yuxarıdakı", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + Yuxarıdakı", |
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.
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
In packages/i18n/src/locales/az.i18n.json around line 1213, the translation
value is missing the key-type suffix and should match the pattern used by
adjacent entries; replace the incomplete "Alt + Yuxarıdakı"/"Komut + Yuxarıdakı"
text with the complete form "Komut + Yuxarı Ok" (ensure consistent spacing and
capitalization) so it aligns with nearby shortcut entries.
| "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", | ||
| "Keyboard_Shortcuts_Mark_all_as_read": "Marca tots els missatges (en tots els canals) com a llegits", |
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.
🧩 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:
Ctrl+Esc Windows reserved keyboard shortcut
💡 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:
Windows keyboard shortcuts Ctrl+Esc intercepted by OS
💡 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:
- Ctrl+Esc is a predefined shell key (opens Start) and is handled by the OS. Apps don’t get the normal thread messages for it. [1][4][5]
- WH_KEYBOARD_LL (low-level hook) can see/consume such keys, but Windows enforces a timeout on low-level hooks and the system will ignore hooks that hang — so this is fragile and restricted. (See MSDN/MSDN‑magazine explanation). [2][5]
- For managed blocking in kiosk/enterprise scenarios, Windows provides keyboard-filter / WEKF_PredefinedKey APIs (and related configuration) to disable predefined combinations like Ctrl+Esc. [1][4]
If you want, I can:
- show a short example of a WH_KEYBOARD_LL hook and explain the timeout/registry setting (LowLevelHooksTimeout), or
- show how to configure the WEKF_PredefinedKey / keyboard filter for kiosk/enterprise use.
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
In packages/i18n/src/locales/ca.i18n.json around lines 1994-1995, the Windows
binding "Ctrl + ESC" uses a reserved OS shortcut — replace it with a
non-reserved combo (for example "Ctrl + Shift + K" or another app-specific
combo) by updating the value for "Keyboard_Shortcuts_Keys_8_win", and normalize
the Esc casing to "Esc" (ensure all key definitions in this locale use the same
"Esc" capitalization) so the locale file is consistent and the shortcut is
reliably usable on Windows.
| "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", |
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.
Fix duplicated "Left" text in arrow key shortcuts.
Lines 1206 and 1207 both contain "Left Left" which appears to be a copy-paste error:
"Command + Left Left"(Keys_3_mac)"Alt + Left Left"(Keys_3_win)
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
In packages/i18n/src/locales/cy.i18n.json around lines 1206-1207, both
"Keyboard_Shortcuts_Keys_3_mac" and "Keyboard_Shortcuts_Keys_3_win" contain a
duplicated "Left Left" token due to a copy/paste error; update those entries to
remove the duplicate so they read "Command + Left" for mac and "Alt + Left" for
win (or if the project prefers explicit naming use "Left Arrow" instead of
"Left"), keeping the rest of the string intact and preserving JSON formatting.
| "Keyboard_Shortcuts_Keys_1_mac": "Command + p OF Command + k", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl + p OF Ctrl + k", | ||
| "Keyboard_Shortcuts_Keys_2": "Pijltje omhoog", | ||
| "Keyboard_Shortcuts_Keys_3": "Command (of Alt) + Linker pijl", | ||
| "Keyboard_Shortcuts_Keys_4": "Command (of Alt) + Pijltje omhoog", | ||
| "Keyboard_Shortcuts_Keys_5": "Command (of Alt) + Pijl naar rechts", | ||
| "Keyboard_Shortcuts_Keys_6": "Command (of Alt) + Pijltje omlaag", | ||
| "Keyboard_Shortcuts_Keys_3_mac": "Command + Linker pijl", | ||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + Linker pijl", | ||
| "Keyboard_Shortcuts_Keys_4_mac": "Command + Pijltje omhoog", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + Pijltje omhoog", | ||
| "Keyboard_Shortcuts_Keys_5_mac": "Command + Pijl naar rechts", | ||
| "Keyboard_Shortcuts_Keys_5_win": "Alt + Pijl naar rechts", | ||
| "Keyboard_Shortcuts_Keys_6_mac": "Command + Pijltje omlaag", | ||
| "Keyboard_Shortcuts_Keys_6_win": "Alt + Pijltje omlaag", | ||
| "Keyboard_Shortcuts_Keys_7": "Shift + Enter", | ||
| "Keyboard_Shortcuts_Keys_8": "Shift (of Ctrl) + ESC", | ||
| "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC", | ||
| "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC", |
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.
🧩 Analysis chain
🏁 Script executed:
# Check the current PR context: which files were modified related to i18n
git diff --name-only HEAD | grep -i i18n || echo "No git diff available; checking file structure"Repository: RocketChat/Rocket.Chat
Length of output: 188
🏁 Script executed:
# Find all files modified in this change to understand PR scope
git ls-files packages/i18n/src/locales/ | head -20Repository: RocketChat/Rocket.Chat
Length of output: 188
🏁 Script executed:
# Search for the keyboard shortcut keys in all locales to see consistency
rg -n "Keyboard_Shortcuts_Keys_(1|3|4|5|6|8)" packages/i18n/src/locales/ | head -30Repository: RocketChat/Rocket.Chat
Length of output: 188
🏁 Script executed:
# Check if en.i18n.json has these keys as the source of truth
rg -n "Keyboard_Shortcuts_Keys_(1|3|4|5|6|8)_(mac|win)" packages/i18n/src/locales/en.i18n.jsonRepository: RocketChat/Rocket.Chat
Length of output: 188
🏁 Script executed:
# Verify no orphaned generic keys (without _mac/_win suffix) exist
rg -nP "\"Keyboard_Shortcuts_Keys_(1|3|4|5|6|8)\":\s*" packages/i18n/src/locales/Repository: RocketChat/Rocket.Chat
Length of output: 188
🏁 Script executed:
# Check code usage - search for these keys in TypeScript/JavaScript files
rg -nP 'Keyboard_Shortcuts_Keys_(1|3|4|5|6|8)(?!_(mac|win))' --type=ts --type=tsx --type=js --type=jsx -g '!**/dist/**' -g '!**/node_modules/**' 2>/dev/null | head -20Repository: RocketChat/Rocket.Chat
Length of output: 188
This PR modifies nl.i18n.json directly, which violates the i18n workflow. Per the repository's established process, new translation keys should be added only to en.i18n.json; other locale files are populated via the external translation pipeline and should not be manually edited. Remove edits to nl.i18n.json and add the keyboard shortcut keys only to en.i18n.json.
🤖 Prompt for AI Agents
In packages/i18n/src/locales/nl.i18n.json around lines 1997-2010, the PR
directly modified the Dutch locale which violates the i18n workflow; revert all
changes in nl.i18n.json to the repo’s previous state and instead add the new
keyboard shortcut keys (the same keys/identifiers present in your diff) to
packages/i18n/src/locales/en.i18n.json only; do not touch other locale files and
ensure you commit only the en.i18n.json additions so the external translation
pipeline can propagate translations.
| "Keyboard_Shortcuts_Keys_1_mac": "Команда + p ИЛИ Команда + k ", | ||
| "Keyboard_Shortcuts_Keys_1_win": "CTRL + p ИЛИ CTRL + k ", | ||
| "Keyboard_Shortcuts_Keys_2": "Клавиша ↑", | ||
| "Keyboard_Shortcuts_Keys_3": "Command (или Alt) + клавиша ←", | ||
| "Keyboard_Shortcuts_Keys_4": "Command (или Alt) + клавиша ↑", | ||
| "Keyboard_Shortcuts_Keys_5": "Command (или Alt) + клавиша →", | ||
| "Keyboard_Shortcuts_Keys_6": "Command (или Alt) + клавиша ↓", | ||
| "Keyboard_Shortcuts_Keys_3_mac": "Command + клавиша ←", | ||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + клавиша ←", | ||
| "Keyboard_Shortcuts_Keys_4_mac": "Command + клавиша ↑", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + клавиша ↑", | ||
| "Keyboard_Shortcuts_Keys_5_mac": "Command + клавиша →", | ||
| "Keyboard_Shortcuts_Keys_5_win": "Alt + клавиша →", | ||
| "Keyboard_Shortcuts_Keys_6_mac": "Command + клавиша ↓", | ||
| "Keyboard_Shortcuts_Keys_6_win": "Alt + клавиша ↓", | ||
| "Keyboard_Shortcuts_Keys_7": "Shift + Enter", | ||
| "Keyboard_Shortcuts_Keys_8": "Shift (или Ctrl) + ESC ", | ||
| "Keyboard_Shortcuts_Keys_8_mac": "Shift + ESC ", | ||
| "Keyboard_Shortcuts_Keys_8_win": "Ctrl + ESC ", | ||
| "Keyboard_Shortcuts_Mark_all_as_read": "Отметить все сообщения как прочитанные", |
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.
🧩 Analysis chain
🏁 Script executed:
# Check if new keys exist in en.i18n.json
grep -E "Keyboard_Shortcuts_Keys_(1_mac|1_win|2|3_mac|3_win|4_mac|4_win|5_mac|5_win|6_mac|6_win|7|8_mac|8_win)" packages/i18n/src/locales/en.i18n.jsonRepository: RocketChat/Rocket.Chat
Length of output: 188
🏁 Script executed:
# Search for UI code that uses these keyboard shortcut keys
fd -t ts -t tsx -t js -t jsx . --exec grep -l "Keyboard_Shortcuts_Keys" {} \;Repository: RocketChat/Rocket.Chat
Length of output: 188
🏁 Script executed:
# Look for any references to old keyboard shortcut keys in ru.i18n.json to understand what was replaced
rg "Keyboard_Shortcuts_Keys" packages/i18n/src/locales/ru.i18n.json -B2 -A2 --no-headingRepository: RocketChat/Rocket.Chat
Length of output: 188
Revert ru.i18n.json changes; add new keys to en.i18n.json only.
Per this repo's i18n workflow, new translation keys must be introduced in packages/i18n/src/locales/en.i18n.json only; other locales are populated via the external translation pipeline or fall back to English. Please revert all changes to ru.i18n.json and add the new Keyboard_Shortcuts_Keys_* variants to en.i18n.json instead. Also remove trailing spaces (e.g., lines 2117, 2118, 2130) and align terminology—"Команда" should match existing "Command" usage, and casing for keys like "CTRL" and "ESC" should be consistent with the rest of the file.
🤖 Prompt for AI Agents
packages/i18n/src/locales/ru.i18n.json lines 2117-2131: revert all edits in this
block so ru.i18n.json remains unchanged (remove any newly added
Keyboard_Shortcuts_Keys_* entries), strip trailing spaces on the noted lines,
and ensure casing/terminology in ru remains consistent with existing Russian
entries (e.g., use the established translation for "Command" if previously
localized); instead add the new Keyboard_Shortcuts_Keys_* variants only to
packages/i18n/src/locales/en.i18n.json with consistent key names and platform
variants, using consistent casing for modifiers (e.g., "Ctrl", "ESC", "Ctrl" vs
"CTRL") in the en file.
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ ப", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ ப", |
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.
Inconsistent platform-specific shortcut for Keys_1: both Mac and Windows variants are identical.
Lines 1208–1209 both map to "Ctrl+ ப", which contradicts the pattern established in Keys_3–6 below, where macOS uses "கட்டளை" (Command) and Windows uses "Alt".
Expected: Keyboard_Shortcuts_Keys_1_mac should likely be "கட்டளை + ப" to match the platform-specific intent of this PR.
Suggested fix:
- "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ ப",
+ "Keyboard_Shortcuts_Keys_1_mac": "கட்டளை + ப",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ ப", | |
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ ப", | |
| "Keyboard_Shortcuts_Keys_1_mac": "கட்டளை + ப", | |
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ ப", |
🤖 Prompt for AI Agents
In packages/i18n/src/locales/ta-IN.i18n.json around lines 1208 to 1209, the
platform-specific shortcut values for Keys_1 are inconsistent (both set to
"Ctrl+ ப"); update Keyboard_Shortcuts_Keys_1_mac to use the macOS-specific
wording by changing its value to "கட்டளை + ப" (keeping the Windows entry as
"Ctrl+ ப") so it matches the pattern used for Keys_3–6 and preserves
spacing/formatting consistency.
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ p", |
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.
macOS keyboard shortcut uses Ctrl instead of Command key—breaks OS-specific pattern.
Line 1204 (Keyboard_Shortcuts_Keys_1_mac) specifies "Ctrl+ p", but all other macOS shortcuts in this file (Keys_3, Keys_4, Keys_6) use "คำสั่ง" (Thai for "Command" key). The macOS version should be "คำสั่ง + p" to align with the established pattern and provide correct platform-specific shortcuts.
- "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ p",
+ "Keyboard_Shortcuts_Keys_1_mac": "คำสั่ง + p",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ p", | |
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ p", | |
| "Keyboard_Shortcuts_Keys_1_mac": "คำสั่ง + p", | |
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ p", |
🤖 Prompt for AI Agents
In packages/i18n/src/locales/th-TH.i18n.json around lines 1204–1205, the macOS
entry "Keyboard_Shortcuts_Keys_1_mac" incorrectly uses "Ctrl+ p"; update that
value to use the Thai Command key label and match the existing macOS format
(e.g., "คำสั่ง + p"), leaving the Windows entry unchanged, and ensure spacing
and punctuation follow the other macOS shortcut entries.
| "Keyboard_Shortcuts_Keys_1_mac": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_1_win": "Ctrl+ p", | ||
| "Keyboard_Shortcuts_Keys_2": "向上箭头", | ||
| "Keyboard_Shortcuts_Keys_3": "命令(或Alt)+ 左箭头", | ||
| "Keyboard_Shortcuts_Keys_4": "命令(或Alt)+ 向上箭头", | ||
| "Keyboard_Shortcuts_Keys_5": "命令(或Alt)+ 右箭头", | ||
| "Keyboard_Shortcuts_Keys_6": "命令(或Alt)+ 向下箭头", | ||
| "Keyboard_Shortcuts_Keys_3_mac": "命令+ 左箭头", | ||
| "Keyboard_Shortcuts_Keys_3_win": "Alt + 左箭头", | ||
| "Keyboard_Shortcuts_Keys_4_mac": "命令 + 向上箭头", | ||
| "Keyboard_Shortcuts_Keys_4_win": "Alt + 向上箭头", | ||
| "Keyboard_Shortcuts_Keys_5_mac": "命令 + 右箭头", | ||
| "Keyboard_Shortcuts_Keys_5_win": "Alt + 右箭头", | ||
| "Keyboard_Shortcuts_Keys_6_mac": "命令 + 向下箭头", | ||
| "Keyboard_Shortcuts_Keys_6_win": "Alt + 向下箭头", |
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.
Add Keyboard_Shortcuts_Keys_8_mac / _win for zh‑HK to match new UI usage
The TSX component now calls t('Keyboard_Shortcuts_Keys_8_mac') and t('Keyboard_Shortcuts_Keys_8_win') for “Mark all as read”, but this locale only defines 1_mac/win and 3–6_mac/win. That means zh‑HK users will see the raw key IDs instead of a localised shortcut string for that entry.
Please add Keyboard_Shortcuts_Keys_8_mac and Keyboard_Shortcuts_Keys_8_win here with appropriate zh‑HK values matching the actual shortcuts and other locales.
🤖 Prompt for AI Agents
In packages/i18n/src/locales/zh-HK.i18n.json around lines 1228–1238, this locale
is missing Keyboard_Shortcuts_Keys_8_mac and Keyboard_Shortcuts_Keys_8_win used
by the UI; add both keys to the JSON with zh-HK localized shortcut strings
(match formatting and spacing of existing entries, e.g., "命令 + X" or "Ctrl + X")
by copying the values from the corresponding keys in other locales (or from the
authoritative shortcuts list) and inserting them as
"Keyboard_Shortcuts_Keys_8_mac": "<zh-HK mac shortcut>" and
"Keyboard_Shortcuts_Keys_8_win": "<zh-HK win shortcut>" so the translation
exists and matches the actual shortcut.
…mproved related text content.
Proposed changes (including videos or screenshots)
Issue(s)
Closes : #8505
Steps to test or reproduce
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.