Repository navigation
fix(i18n): localize chat font search keywords to repair main CI - #33711
brennanb2025 wants to merge 1 commit into
Conversation
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e58a1d8b-48b4-4ab2-b08b-8b2af0025aac
Files selected for processing: 9-
config/localization-coverage-allowlist.jsonsrc/renderer/src/components/settings/chat-appearance-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/pt.jsonsrc/renderer/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
| keywords: [ | ||
| translate('settings.appearance.chat.title', 'Chat'), | ||
| translate('settings.appearance.chat.fontKeyword', 'font'), | ||
| translate('settings.appearance.chat.familyKeyword', 'family'), | ||
| translate('settings.appearance.chat.typefaceKeyword', 'typeface'), | ||
| translate('settings.appearance.chat.typographyKeyword', 'typography') | ||
| ] |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
git diff --no-ext-diff bd2f46359d1ebf22d7806d5eadab8bce75f6e937 88f61a7bf88f58ec7d1abf713beb69342a19eb13 -- src/renderer/src/components/settings/chat-appearance-search.ts rg -n "keywords|SearchableSetting|translateSearchKeyword|settings.*search|search.*keyword" src/renderer/src/components/settings src/renderer/src | head -240 rg -n "fontKeyword|familyKeyword|typefaceKeyword|typographyKeyword|chat-appearance-search" src tests config
Repository: stablyai/orca
Length of output: 36468
Script executed:
set -o pipefail printf '%s\n' '--- relevant files ---' rg -n -F --glob '*.ts' --glob '*.tsx' --glob '*.test.ts' --glob '*.test.tsx' \ -e 'function translateSearchKeyword' \ -e 'const translateSearchKeyword' \ -e 'translateSearchKeyword' \ -e 'SearchableSetting' \ -e 'keywords' \ -e 'getChatAppearanceSearchEntries' \ src/renderer/src/components/settings src/renderer/src/hooks | head -320 printf '%s\n' '--- keyword helper ---' helper=$(rg -l -F --glob '*.ts' 'function translateSearchKeyword' src/renderer/src/components/settings | head -1) if [ -n "$helper" ]; then nl -ba "$helper" else helper=$(rg -l -F --glob '*.ts' 'translateSearchKeyword' src/renderer/src/components/settings | head -1) [ -n "$helper" ] && nl -ba "$helper" fi printf '%s\n' '--- searchable setting and matcher ---' rg -l -F --glob '*.ts' --glob '*.tsx' 'export function SearchableSetting' src/renderer/src/components/settings | while read -r f; do nl -ba "$f"; done rg -n -F --glob '*.ts' --glob '*.tsx' \ -e 'keywords.some' -e 'keyword.toLowerCase' -e 'entry.keywords' -e 'searchEntries' -e 'searchQuery' \ src/renderer/src/components/settings src/renderer/src/hooks | head -240 printf '%s\n' '--- chat search and tests ---' nl -ba src/renderer/src/components/settings/chat-appearance-search.ts for f in src/renderer/src/components/settings/*Chat*test.tsx src/renderer/src/components/settings/*chat*test.tsx; do [ -f "$f" ] && { echo "### $f"; nl -ba "$f"; } done printf '%s\n' '--- repository guidance relevant to search/localization ---' rg -n -i -F --glob 'AGENTS.md' --glob 'CONTRIBUTING*' --glob '*guid*' --glob '*.md' \ -e 'settings search' -e 'search keyword' -e 'translateSearchKeyword' -e 'localiz' . | head -240 || true
Repository: stablyai/orca
Length of output: 42230
Script executed:
set -o pipefail printf '%s\n' '--- settings-search-keywords.ts ---' nl -ba src/renderer/src/components/settings/settings-search-keywords.ts printf '%s\n' '--- SearchableSetting.tsx ---' nl -ba src/renderer/src/components/settings/SearchableSetting.tsx printf '%s\n' '--- settings search consumers ---' rg -n -F --glob '*.ts' --glob '*.tsx' --glob '*.test.ts' --glob '*.test.tsx' \ -e 'matchesSettingsSearch' -e 'settingsSearchQuery' -e 'keywords.some' -e 'entry.keywords' \ src/renderer/src/components/settings src/renderer/src/hooks | head -180 printf '%s\n' '--- chat search exact block ---' nl -ba src/renderer/src/components/settings/chat-appearance-search.ts | sed -n '1,115p' printf '%s\n' '--- chat search tests and keyword assertions ---' rg -n -C 8 -F --glob '*test.ts' --glob '*test.tsx' \ -e 'getChatAppearanceSearchEntries' -e 'typeface' -e 'font' -e 'family' \ src/renderer/src/components/settings src/renderer/src/hooks | head -260 printf '%s\n' '--- localization guidance exact relevant lines ---' nl -ba config/localization-audit.md | sed -n '10,30p;90,105p;120,130p'
Repository: stablyai/orca
Length of output: 41665
Preserve English aliases for localized settings search.
Keyword arrays are not required to remain English-only. Use translateSearchKeyword() so each chat font keyword includes both its localized value and its English fallback.
Suggested fix
-
+import { translateSearchKeyword } from './settings-search-keywords' ... - translate('settings.appearance.chat.fontKeyword', 'font'), - translate('settings.appearance.chat.familyKeyword', 'family'), - translate('settings.appearance.chat.typefaceKeyword', 'typeface'), - translate('settings.appearance.chat.typographyKeyword', 'typography') + ...translateSearchKeyword('settings.appearance.chat.fontKeyword', 'font'), + ...translateSearchKeyword('settings.appearance.chat.familyKeyword', 'family'), + ...translateSearchKeyword('settings.appearance.chat.typefaceKeyword', 'typeface'), + ...translateSearchKeyword('settings.appearance.chat.typographyKeyword', 'typography')
|
Closing as a duplicate: #33715 landed the same repair (allowlisted code sample, font search keywords localized while English terms still match). |
Problem
Main's CI fails the "Verify localization coverage" step on every PR. #33687 (chat font family setting) added six strings the audit sees as unlocalized: the five Settings search keywords for the new Font family row (
chat,font,family,typeface,typography) and thefontFamilycode sample shown after the font preview sentence.Change
translate(), one key per keyword, the same way other Settings search entries localize keywords.Chatreuses the existingsettings.appearance.chat.titlekey; the other four get new keys with translations in all seven locale catalogs, so searching Settings in any language finds the row.fontFamilyin the preview is the CSS property name shown as code, not prose, so it gets a reviewed entry inconfig/localization-coverage-allowlist.jsoninstead of a translation.No behavior change beyond search keywords matching in the user's language.
bun config/scripts/audit-localization-coverage.mjs --checkpasses locally.