fix(help): render the help dialog from i18n instead of hardcoded English (#647)

The help dialog carried its 13 shortcut labels, its getting-started
paragraph and its version line as hardcoded English, while fully
translated strings for exactly those labels sat unused in all 21 locale
files. Every non-English user read English there. The translations did
not need writing, only reading: t.help.keyboardShortcuts already had
focusSearchBar, goToTools, processFile and the rest, in every locale.

Labels now index into t.help.keyboardShortcuts by key rather than
carrying text. Getting-started reads t.help.gettingStarted.description,
which drops the inline Kbd chip the hardcoded copy had, matching what all
21 locales already say. The version line goes through
t.help.versionLabel.

Also adds the type-to-search row that #644 left out, keyed
help.keyboardShortcuts.typeToSearch, translated into all 21 locales, and
regenerates the two darwin help-dialog baselines for the extra row.

Nothing caught the original bug because the i18n context defaults to en,
so asserting on English text passes whether or not the component reads
i18n at all. The new test mocks the context with sentinel values instead:
putting the hardcoded labels back fails 15 of its 19 cases.

Verified: 19 new unit tests, full unit suite 7576 passed, help-dialog
visual 3/3 against regenerated baselines, help accessibility e2e 7/7,
typecheck and lint clean, all 18 CI checks green.
This commit is contained in:
SnapOtter
2026-07-26 10:28:02 +08:00
committed by GitHub
parent 2d8b57c57f
commit 2848dd0e53
25 changed files with 164 additions and 19 deletions
+1
View File
@@ -3932,6 +3932,7 @@ export const ar: TranslationKeys = {
keyboardShortcuts: {
heading: "اختصارات لوحة المفاتيح",
focusSearchBar: "التركيز على شريط البحث",
typeToSearch: "ابدأ الكتابة للبحث",
goToTools: "الانتقال للأدوات",
toggleTheme: "تبديل السمة",
goToResize: "الانتقال لتغيير الحجم",
+1
View File
@@ -3988,6 +3988,7 @@ export const de: TranslationKeys = {
keyboardShortcuts: {
heading: "Tastenkombinationen",
focusSearchBar: "Suchleiste fokussieren",
typeToSearch: "Tippen, um zu suchen",
goToTools: "Zu Werkzeugen",
toggleTheme: "Farbschema wechseln",
goToResize: "Zu Größe ändern",
+1
View File
@@ -3906,6 +3906,7 @@ export const en = {
keyboardShortcuts: {
heading: "Keyboard Shortcuts",
focusSearchBar: "Focus search bar",
typeToSearch: "Start typing to search",
goToTools: "Go to tools",
toggleTheme: "Toggle theme",
goToResize: "Go to Resize",
+1
View File
@@ -3966,6 +3966,7 @@ export const es: TranslationKeys = {
keyboardShortcuts: {
heading: "Atajos de teclado",
focusSearchBar: "Enfocar barra de búsqueda",
typeToSearch: "Empieza a escribir para buscar",
goToTools: "Ir a herramientas",
toggleTheme: "Cambiar tema",
goToResize: "Ir a Redimensionar",
+1
View File
@@ -3992,6 +3992,7 @@ export const fr: TranslationKeys = {
keyboardShortcuts: {
heading: "Raccourcis clavier",
focusSearchBar: "Focus sur la barre de recherche",
typeToSearch: "Commencer à taper pour rechercher",
goToTools: "Aller aux outils",
toggleTheme: "Changer de thème",
goToResize: "Aller à Redimensionner",
+1
View File
@@ -3761,6 +3761,7 @@ export const hi: TranslationKeys = {
keyboardShortcuts: {
heading: "कीबोर्ड शॉर्टकट",
focusSearchBar: "सर्च बार पर फोकस",
typeToSearch: "खोजने के लिए टाइप करें",
goToTools: "टूल्स पर जाएं",
toggleTheme: "थीम बदलें",
goToResize: "रीसाइज़ पर जाएं",
+1
View File
@@ -3965,6 +3965,7 @@ export const id: TranslationKeys = {
keyboardShortcuts: {
heading: "Pintasan Keyboard",
focusSearchBar: "Fokus ke bilah pencarian",
typeToSearch: "Mulai mengetik untuk mencari",
goToTools: "Ke halaman alat",
toggleTheme: "Ganti tema",
goToResize: "Ke Ubah Ukuran",
+1
View File
@@ -3982,6 +3982,7 @@ export const it: TranslationKeys = {
keyboardShortcuts: {
heading: "Scorciatoie da tastiera",
focusSearchBar: "Focus sulla barra di ricerca",
typeToSearch: "Inizia a digitare per cercare",
goToTools: "Vai agli strumenti",
toggleTheme: "Cambia tema",
goToResize: "Vai a Ridimensiona",
+1
View File
@@ -3912,6 +3912,7 @@ export const ja: TranslationKeys = {
keyboardShortcuts: {
heading: "キーボードショートカット",
focusSearchBar: "検索バーにフォーカス",
typeToSearch: "入力して検索",
goToTools: "ツールへ移動",
toggleTheme: "テーマ切り替え",
goToResize: "リサイズへ移動",
+1
View File
@@ -3891,6 +3891,7 @@ export const ko: TranslationKeys = {
keyboardShortcuts: {
heading: "키보드 단축키",
focusSearchBar: "검색바로 포커스",
typeToSearch: "입력하여 검색",
goToTools: "도구로 이동",
toggleTheme: "테마 전환",
goToResize: "리사이즈로 이동",
+1
View File
@@ -3974,6 +3974,7 @@ export const nl: TranslationKeys = {
keyboardShortcuts: {
heading: "Sneltoetsen",
focusSearchBar: "Zoekbalk focussen",
typeToSearch: "Typen om te zoeken",
goToTools: "Naar gereedschap",
toggleTheme: "Thema wisselen",
goToResize: "Naar Formaat wijzigen",
+1
View File
@@ -3978,6 +3978,7 @@ export const pl: TranslationKeys = {
keyboardShortcuts: {
heading: "Skróty klawiaturowe",
focusSearchBar: "Fokus na pasku wyszukiwania",
typeToSearch: "Zacznij pisać, aby wyszukać",
goToTools: "Przejdź do narzędzi",
toggleTheme: "Przełącz motyw",
goToResize: "Przejdź do zmiany rozmiaru",
+1
View File
@@ -3973,6 +3973,7 @@ export const ptBR: TranslationKeys = {
keyboardShortcuts: {
heading: "Atalhos de teclado",
focusSearchBar: "Focar na barra de busca",
typeToSearch: "Comece a digitar para buscar",
goToTools: "Ir para ferramentas",
toggleTheme: "Alternar tema",
goToResize: "Ir para Redimensionar",
+1
View File
@@ -3970,6 +3970,7 @@ export const ru: TranslationKeys = {
keyboardShortcuts: {
heading: "Горячие клавиши",
focusSearchBar: "Фокус на строке поиска",
typeToSearch: "Начните вводить для поиска",
goToTools: "Перейти к инструментам",
toggleTheme: "Переключить тему",
goToResize: "Перейти к изменению размера",
+1
View File
@@ -3961,6 +3961,7 @@ export const sv: TranslationKeys = {
keyboardShortcuts: {
heading: "Kortkommandon",
focusSearchBar: "Fokusera sökfält",
typeToSearch: "Börja skriva för att söka",
goToTools: "Gå till verktyg",
toggleTheme: "Växla tema",
goToResize: "Gå till Ändra storlek",
+1
View File
@@ -3910,6 +3910,7 @@ export const th: TranslationKeys = {
keyboardShortcuts: {
heading: "ปุ่มลัด",
focusSearchBar: "โฟกัสแถบค้นหา",
typeToSearch: "พิมพ์เพื่อค้นหา",
goToTools: "ไปที่เครื่องมือ",
toggleTheme: "สลับธีม",
goToResize: "ไปที่ปรับขนาด",
+1
View File
@@ -3973,6 +3973,7 @@ export const tr: TranslationKeys = {
keyboardShortcuts: {
heading: "Klavye Kısayolları",
focusSearchBar: "Arama çubuğuna odaklan",
typeToSearch: "Aramak için yazmaya başlayın",
goToTools: "Araçlara git",
toggleTheme: "Temayı değiştir",
goToResize: "Boyutlandırmaya git",
+1
View File
@@ -3968,6 +3968,7 @@ export const uk: TranslationKeys = {
keyboardShortcuts: {
heading: "Гарячі клавіші",
focusSearchBar: "Фокус на рядку пошуку",
typeToSearch: "Почніть вводити для пошуку",
goToTools: "Перейти до інструментів",
toggleTheme: "Перемкнути тему",
goToResize: "Перейти до зміни розміру",
+1
View File
@@ -3957,6 +3957,7 @@ export const vi: TranslationKeys = {
keyboardShortcuts: {
heading: "Phím tắt",
focusSearchBar: "Lấy nét thanh tìm kiếm",
typeToSearch: "Bắt đầu nhập để tìm kiếm",
goToTools: "Đến công cụ",
toggleTheme: "Chuyển đổi giao diện",
goToResize: "Đến Thay đổi kích thước",
+1
View File
@@ -3692,6 +3692,7 @@ export const zhCN: TranslationKeys = {
keyboardShortcuts: {
heading: "键盘快捷键",
focusSearchBar: "聚焦搜索栏",
typeToSearch: "输入即可搜索",
goToTools: "前往工具",
toggleTheme: "切换主题",
goToResize: "前往调整大小",
+1
View File
@@ -3694,6 +3694,7 @@ export const zhTW: TranslationKeys = {
keyboardShortcuts: {
heading: "鍵盤快速鍵",
focusSearchBar: "聚焦搜尋列",
typeToSearch: "輸入即可搜尋",
goToTools: "前往工具",
toggleTheme: "切換佈景主題",
goToResize: "前往調整大小",