Repository navigation
fix(i18n): localize the status bar Resource Manager tooltip and remote-host count - #12478
Conversation
📝 WalkthroughWalkthroughThe PR expands localization coverage detection for fallback and conditional expressions. It localizes CLI registration, worktree activation, floating-terminal, Resource Manager, and SSH status-bar copy. Resource Manager tooltip lines now include stable IDs and emphasis metadata. New translation entries were added for English, Spanish, Japanese, Korean, and Chinese locales. Tests cover analyzer behavior, tooltip structure, SSH labels, and Japanese status-bar rendering. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
|
Three notes on your open questions, from having hit all of them. 1. The Tailwind filter you want already existsYou asked for "a filter for Concretely, in One residue the filter does not catch: proper nouns. 2. Identical
|
…e-host count The Resource Manager tooltip/aria label and the SSH segment's host count were assembled from bare English literals inside helper functions, so they stayed English under every non-English UI language while the labels around them translated. Route them through the catalog with _one/_other plural keys and whole-line messages (locales reorder and repunctuate the summary), and add en/es/ja/ko/zh entries. Root cause of the miss: audit-localization-coverage bailed on any ancestor binary expression whose operator was not `+`, which hid every string under a `cond && <JSX/>` guard or a `?? 'fallback'` — including this segment's 'Connecting…'. Only comparison operands are code, so keep `??`, `||` and `&&` walking, and localize the four real strings that surfaced. Co-authored-by: Orca <[email protected]>
…its English text
The tooltip tinted a row with `line === 'Space scan ready'`, so routing that
copy through the catalog silently dropped the tint in every translated build.
Return `{ text, emphasized }` and let the segment read the flag.
Adopted from #12439 by @smwbev.
Co-authored-by: Evgenii <[email protected]>
Co-authored-by: Orca <[email protected]>
… array index Co-authored-by: Orca <[email protected]>
efa07a2 to
2fabd80
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
src/renderer/src/components/status-bar/resource-manager-terminal-copy.ts (1)
24-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueShorten the type comment.
The comment repeats implementation details and spans nine lines. Keep only the non-obvious stable-key invariant in one concise line.
As per coding guidelines, “Comments must be concise, limited to non-obvious information, and preferably one line.”
Source: Coding guidelines
src/renderer/src/components/status-bar/status-bar-copy-localization.test.tsx (1)
2-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueShorten the test rationale.
Keep this as a one- or two-line comment that states why runtime localization coverage is required. Remove the historical detail and cross-file comparison.
As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bb919fd9-16e7-4680-8104-3d2c9b077743
📒 Files selected for processing (19)
config/localization-coverage-allowlist.jsonconfig/scripts/audit-localization-coverage.mjsconfig/scripts/audit-localization-coverage.test.mjssrc/renderer/src/components/settings/CliSkillRuntimeSetup.tsxsrc/renderer/src/components/status-bar/ResourceUsageStatusSegment.tsxsrc/renderer/src/components/status-bar/SshStatusSegment.tsxsrc/renderer/src/components/status-bar/StatusBar.tsxsrc/renderer/src/components/status-bar/resource-manager-terminal-copy.test.tssrc/renderer/src/components/status-bar/resource-manager-terminal-copy.tssrc/renderer/src/components/status-bar/ssh-status-segment-copy.test.tssrc/renderer/src/components/status-bar/ssh-status-segment-copy.tssrc/renderer/src/components/status-bar/status-bar-copy-localization.test.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/agent-skill-cli-prerequisite.tssrc/renderer/src/lib/worktree-activation.ts
| export function connectedHostCountLabel(count: number): string { | ||
| return count === 1 | ||
| ? translate( | ||
| 'auto.components.status.bar.SshStatusSegment.connectedHostCount_one', | ||
| '{{count}} host', | ||
| { count } | ||
| ) | ||
| : translate( | ||
| 'auto.components.status.bar.SshStatusSegment.connectedHostCount_other', | ||
| '{{count}} hosts', | ||
| { count } | ||
| ) | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg 'ssh-status-segment-copy|src/renderer/src/i18n|language|pluginLanguage|addResourceBundle|translate\(' | head -200
echo
echo "== target file =="
cat -n src/renderer/src/components/status-bar/ssh-status-segment-copy.ts
echo
echo "== connectedHostCount occurrences =="
rg -n "connectedHostCount|connectedHost" .
echo
echo "== translation helper outline/files =="
fd -a '.*' src/renderer/src | rg '/i18n/|translate|language|resource' | head -200Repository: stablyai/orca
Length of output: 14080
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== i18n.ts =="
cat -n src/renderer/src/i18n/i18n.ts
echo
echo "== localized catalog =="
cat -n src/renderer/src/i18n/localized-catalog.ts
echo
echo "== plugin packs outline/contents =="
cat -n src/renderer/src/store/plugin-language-packs.ts
rg -n "pluginLanguageResourceId|pluginLanguagePacks|languagePack|addResourceBundle|useStore|plural|defaultNS|fallbackLng|keySeparator|nsSeparator" src/renderer/src/src -S || true
rg -n "pluginLanguageResourceId|pluginLanguagePacks|languagePack|addResourceBundle|useStore|plural|defaultNS|fallbackLng|keySeparator|nsSeparator" src/renderer/src -S || true
echo
echo "== connectedHostCount locales exact sections =="
python3 - <<'PY'
import json, pathlib
for p in sorted(pathlib.Path('src/renderer/src/i18n/locales').glob('*.json')):
data=json.loads(p.read_text())
cur=data
path='SshStatusSegment.connectedHostCount'
for k in ['auto','components','status','bar','SshStatusSegment','connectedHostCount']:
if isinstance(cur, dict) and k in cur: cur=cur[k]
else: cur=None; break
print(f'-- {p.name} --')
if cur is None:
print('missing')
elif isinstance(cur, dict):
print(json.dumps(cur, ensure_ascii=False, indent=2))
else:
print(repr(cur))
PYRepository: stablyai/orca
Length of output: 19669
🌐 Web query:
i18next plural selection _one _other _few _many CLDR rules passing count option
💡 Result:
In i18next, pluralization is handled by passing a count option to the translation function (e.g., t('key', { count: N })) [1][2]. Since version 24, i18next mandates the use of the Intl.PluralRules API to determine which plural form to use based on the current language's rules [1][3]. CLDR Rules and Plural Categories i18next relies on the Unicode Common Locale Data Repository (CLDR) rules to categorize numbers into plural forms [4][5]. Depending on the target language, these forms may include zero, one, two, few, many, and other [1][4]. How it works: 1. When you pass the count option, i18next uses Intl.PluralRules to select the appropriate plural category for that number in the current language [1][5]. 2. It then appends the corresponding suffix (e.g., _one, _few, _many, _other) to your translation key [1][5]. 3. For example, in Polish, count: 1 resolves to the _one suffix, while count: 14 resolves to the _many suffix [5]. Crucial Implementation Details: - Mandatory Intl.PluralRules: If your environment (such as some versions of React Native) lacks native Intl.PluralRules support, you must use a polyfill [1][3]. Since v24, there is no built-in fallback to legacy plural handling; missing Intl support will result in errors and a failure to resolve complex plural forms [1][3]. - Complete Translation Sets: To ensure correct behavior, you must provide translations for all plural categories required by the target language's CLDR rules [5]. If you only define _one and _other for a language that requires _few or _many, i18next will fail to find the translation when the count falls into those categories [5]. - Automatic Management: It is highly recommended to use tools like i18next-parser or i18next-cli, which automatically generate the correct set of plural suffixes for your target languages based on CLDR standards, preventing manual errors in missing key definitions [5]. If you call the translation function without a count option (e.g., t('key')), i18next will not look for plural suffixes and will instead attempt to find the literal key 'key' [5]. If you have only defined pluralized keys in your JSON (e.g., key_one, key_other), the lookup will fail [5].
Citations:
- 1: https://www.i18next.com/translation-function/plurals
- 2: https://www.i18next.com/translation-function/plurals.md
- 3: https://www.i18next.com/how-to/faq.md
- 4: https://cldr.unicode.org/index/cldr-spec/plural-rules
- 5: plural keys don't resolve consistently i18next/i18next#2423
🌐 Web query:
i18next missing plural suffixes fallback missing plural keys fallbackLng
💡 Result:
In i18next, plural keys are handled through language-specific plural suffixes (e.g., _one, _other) determined by the Intl.PluralRules API [1][2]. If a translation for a specific plural key is missing, i18next does not automatically fallback to a singular form or a different plural form [1][3]. Instead, it follows a standard resolution order: 1. Language Fallback: i18next attempts to find the translation in the configured fallback language(s) defined by the fallbackLng option [4][5]. 2. Key Fallback: If no translation is found in the current or fallback languages, and you have provided fallback keys (e.g., passing an array to the t function), i18next will attempt to resolve those keys [4][6][7]. 3. Key Itself: If no translation is found after these steps, i18next returns the key itself as the default fallback value [4][6]. Important Considerations: - Requirement of 'count': You must provide the count option (e.g., {count: 1}) to trigger pluralization [1][2]. If count is missing, i18next will not use plural logic and will not fallback to a plural form [1][2]. - Default Values: You can provide default plural forms using defaultValue and defaultValue_other (or other relevant suffixes) in the t function options [8][7]. - Missing Keys: If you want to identify missing translations during development, you should enable the saveMissing configuration option, which allows backends to collect these keys [6]. - Intl.PluralRules: Since i18next v24, the library relies on the native Intl.PluralRules API [1][9]. In environments without this (or without a polyfill), only English-style _one/_other suffixes will be supported, and no automatic fallback to other plural forms occurs [1][9].
Citations:
- 1: https://www.i18next.com/translation-function/plurals
- 2: https://www.i18next.com/translation-function/plurals.md
- 3: Missing plural keys in translation i18next/i18next#1690
- 4: https://www.i18next.com/principles/translation-resolution
- 5: https://www.i18next.com/principles/translation-resolution.md
- 6: https://www.i18next.com/principles/fallback
- 7: https://www.i18next.com/translation-function/essentials
- 8: Missing key default pluralization issues i18next/i18next#1549
- 9: https://www.i18next.com/misc/json-format
🌐 Web query:
site:i18next.com/how-to/pluralization fallback missing plural keys key separator _ plural suffix
💡 Result:
Relevant i18next documentation:
- Pluralization: plural keys require
count; i18next selects suffixes such as_one,_other, or_zero. There is no fallback to the base key whencountis omitted. (i18next.com) - Missing plural keys: i18next resolves keys through plural/context variants, then fallback languages and namespaces. (i18next.com)
- Plural suffixes and separator: modern v4 uses Intl-style suffixes; the default plural separator is
_. Older environments may fall back to v3 handling ifIntl.PluralRulesis unavailable. (i18next.com) - Key separator:
keySeparatorcontrols nested-key parsing; set it tofalsewhen keys containing dots should be treated literally. (i18next.com)
Citations:
- 1: https://www.i18next.com/translation-function/plurals?utm_source=openai
- 2: https://www.i18next.com/principles/translation-resolution?utm_source=openai
- 3: https://www.i18next.com/how-to/faq?utm_source=openai
- 4: https://www.i18next.com/overview/api?utm_source=openai
🌐 Web query:
i18next fallbackLng plural missing plural key fallbackLng same namespace behavior
💡 Result:
In i18next, when a specific plural key is missing, the fallback mechanism—whether through fallbackLng or fallbackNS—follows a defined resolution process to locate the most relevant translation [1][2]. 1. Plural Keys and Fallbacks When you use a plural key (e.g., key with a count option), i18next first attempts to find the specific plural form (e.g., key_one, key_other) for the current language and namespace [1][3]. If it is not found, i18next performs a hierarchical lookup [1]: - First, it searches for similar keys, prioritizing matches for the plural, context, and singular forms in order [1]. - If still not found, it traverses the defined fallbackLng list [1]. - If the key is still missing, it proceeds to the fallbackNS list [1][4]. - If no translation is found through these fallbacks, i18next returns the key itself (or a configured fallback key) [1][2]. 2. Important Constraints on Plurals - Missing count: The count variable is mandatory for pluralization [3]. If count is missing, i18next will not trigger plural logic and will not fallback to the pluralized versions of the key [3]. - Default Values: You can provide default plural forms using the defaultValue option with suffixes matching your pluralRules (e.g., defaultValue: 'one item', defaultValue_other: '{{ count }} items') [5][6]. If the primary key is missing, i18next will use these defaults [5]. - No Implicit Fallback for Missing Plural Logic: Be aware that if your environment lacks Intl.PluralRules support (and no polyfill is present), i18next may not resolve complex plural forms correctly, potentially failing to reach expected fallbacks [3]. 3. Namespace Behavior When fallbackNS is configured, i18next looks for the key in your primary namespaces before attempting the fallback namespace [4]. Note that the lookup order is hierarchical: i18next generally tries to resolve the key fully within the current language before moving to the next language in the fallback chain, searching through all specified namespaces at each language step [1][7]. For robust development, ensure saveMissing is enabled during development to identify and capture these missing keys in your backend, preventing runtime resolution issues [2][8].
Citations:
- 1: https://www.i18next.com/principles/translation-resolution
- 2: https://www.i18next.com/principles/fallback
- 3: https://www.i18next.com/translation-function/plurals.md
- 4: https://github.com/i18next/i18next-gitbook/blob/master/principles/fallback.md
- 5: https://www.i18next.com/translation-function/essentials
- 6: Missing key default pluralization issues i18next/i18next#1549
- 7: fallback order with multiple namespaces i18next/i18next#1260
- 8: https://www.i18next.com/overview/configuration-options.md
🌐 Web query:
i18next fallback missing plural key plural separator underscore same namespace fallbackLng
💡 Result:
In i18next, when a translation key is missing, the system follows a specific resolution order to find a fallback [1]. If a key is not found in the current namespace and language, i18next attempts to resolve it through fallback languages (fallbackLng) and fallback namespaces (fallbackNS) [2][3][4]. Regarding your specific configuration concerns: 1. Plural Separator: The default character used to split plural suffixes from a key is an underscore (_) [3][5]. You can modify this by setting the pluralSeparator option in your i18next configuration [3][6]. 2. Fallback Behavior for Missing Keys: - If a key is missing even after checking fallbacks, i18next returns the key itself by default [1]. - To handle missing keys systematically during development, you can enable saveMissing: true [2][7]. This allows you to collect missing keys via a backend or the missingKey event [2][7]. - If you want a specific string to be returned instead of the key when a translation is missing, you should provide a defaultValue in your t() function call [8]. 3. Namespaces: When a key is not found in the primary namespace, i18next will look for it in the configured fallbackNS if one is defined [3][1]. 4. Important Note on Plurals: If you provide a count to the t() function, i18next expects the corresponding plural form (e.g., key_one, key_other) to exist [9][10]. If the specific plural form is missing and cannot be resolved through your fallback configuration, it will not automatically fall back to the singular key; you must ensure the necessary plural forms are present in your translation files or provided as defaults [9][10]. If you find that your keys are appearing as raw text in your UI, it typically indicates that the translation is missing from all resolved sources (current language/namespace and fallback language/namespace) [2]. Using saveMissing is the recommended practice for identifying and fixing these gaps [2].
Citations:
- 1: https://www.i18next.com/principles/translation-resolution
- 2: https://www.i18next.com/principles/fallback
- 3: https://www.i18next.com/overview/configuration-options.md
- 4: https://www.i18next.com/overview/configuration-options
- 5: https://cdn.jsdelivr.net/npm/[email protected]/typescript/options.d.ts
- 6: https://github.com/i18next/i18next-gitbook/blob/master/overview/configuration-options.md
- 7: https://www.i18next.com/overview/api
- 8: https://www.i18next.com/translation-function/essentials
- 9: https://www.i18next.com/translation-function/plurals.md
- 10: https://www.i18next.com/translation-function/plurals
Use i18next plural selection for host counts.
count === 1 selects only _one and _other, so CLDR plural forms such as _few or _many cannot render. Pass the unsuffixed key with { count }, and ensure language packs register their declared locale.
Proposed fix
export function connectedHostCountLabel(count: number): string {
- return count === 1
- ? translate(
- 'auto.components.status.bar.SshStatusSegment.connectedHostCount_one',
- '{{count}} host',
- { count }
- )
- : translate(
- 'auto.components.status.bar.SshStatusSegment.connectedHostCount_other',
- '{{count}} hosts',
- { count }
- )
+ return translate(
+ 'auto.components.status.bar.SshStatusSegment.connectedHostCount',
+ '{{count}} hosts',
+ { count }
+ )
}📝 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.
| export function connectedHostCountLabel(count: number): string { | |
| return count === 1 | |
| ? translate( | |
| 'auto.components.status.bar.SshStatusSegment.connectedHostCount_one', | |
| '{{count}} host', | |
| { count } | |
| ) | |
| : translate( | |
| 'auto.components.status.bar.SshStatusSegment.connectedHostCount_other', | |
| '{{count}} hosts', | |
| { count } | |
| ) | |
| } | |
| export function connectedHostCountLabel(count: number): string { | |
| return translate( | |
| 'auto.components.status.bar.SshStatusSegment.connectedHostCount', | |
| '{{count}} hosts', | |
| { count } | |
| ) | |
| } |
Source: Learnings
| ? translate( | ||
| 'auto.components.status.bar.StatusBar.floatingTerminalNewActivity', | ||
| '{{label}}, new activity', | ||
| { label: floatingTerminalActionLabel } | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Localize floatingTerminalActionLabel before interpolating it.
floatingTerminalActionLabel is set directly from the hardcoded English literals 'Minimize Floating Workspace' and 'Show Floating Workspace' (unchanged, lines 2154-2156). This translated template interpolates that value as {{label}}. For any non-English locale, the resulting aria-label mixes the English label with the translated ", new activity" suffix.
Localize floatingTerminalActionLabel itself, then pass the localized value into this translate() call. Also update the plain usage at line 2395, which renders the same unlocalized variable directly in TooltipContent.
🌐 Proposed fix
- const floatingTerminalActionLabel = floatingTerminalOpen
- ? 'Minimize Floating Workspace'
- : 'Show Floating Workspace'
+ const floatingTerminalActionLabel = floatingTerminalOpen
+ ? translate(
+ 'auto.components.status.bar.StatusBar.minimizeFloatingWorkspace',
+ 'Minimize Floating Workspace'
+ )
+ : translate(
+ 'auto.components.status.bar.StatusBar.showFloatingWorkspace',
+ 'Show Floating Workspace'
+ )| "0f116999f1": "Reinicia tu shell o agrega el directorio de Orca CLI a PATH antes de la configuración.", | ||
| "15cbedc3e3": "Instala la CLI de Orca antes de configurar skills para agentes.", | ||
| "windowsPathUnknown": "Orca could not check your Windows user PATH" | ||
| "windowsPathUnknown": "Orca could not check your Windows user PATH", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== file exists and line count =="
wc -l src/renderer/src/i18n/locales/es.json
echo "== relevant lines =="
sed -n '344,358p;5644,5660p' src/renderer/src/i18n/locales/es.json
echo "== all windowsPathUnknown occurrences across locale files =="
python3 - <<'PY'
import json
from pathlib import Path
for p in sorted(Path("src/renderer/src/i18n/locales").glob("*.json")):
try:
data=json.load(open(p, encoding="utf-8"))
except Exception as e:
print(f"{p}: JSON parse error {e}")
continue
matches=[]
def walk(obj, path):
if isinstance(obj, dict):
for k,v in obj.items():
if k=="windowsPathUnknown" and isinstance(v,str) and v.startswith("WSL") or k=="windowsPathUnknown" and isinstance(v,str) and v.startswith("Orca"):
matches.append((path,k,v))
walk(v, path+(k,))
elif isinstance(obj,list):
for i,v in enumerate(obj):
walk(v, path+(str(i),))
walk(data, ())
if matches:
print(f"\n{p}")
for m in matches:
print(f" {'.'.join(m[:2])}: {m[2]}")
PY
echo "== search workflow references for i18n/fallback/catalog =="
rg -n "locales|i18n|locales/.*/es\.json|fallback|Translation|translate|locales" -S . --glob '!node_modules' --glob '!dist' --glob '!build' | head -200Repository: stablyai/orca
Length of output: 2553
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== exact context around problematic entries =="
printf '\n--- src/renderer/src/i18n/locales/es.json:340-356 ---\n'
sed -n '340,356p' src/renderer/src/i18n/locales/es.json
printf '\n--- src/renderer/src/i18n/locales/es.json:5640-5656 ---\n'
sed -n '5640,5656p' src/renderer/src/i18n/locales/es.json
printf '\n--- en.json windowsPathUnknown ---\n'
python3 - <<'PY'
import json
from pathlib import Path
for p in sorted(Path("src/renderer/src/i18n/locales").glob("*.json")):
try:
data=json.load(open(p, encoding="utf-8"))
except Exception as e:
print(f"{p}: JSON parse error {e}")
continue
def walk(obj, path):
if isinstance(obj, dict):
for k,v in obj.items():
if k == "windowsPathUnknown" and isinstance(v, str):
print(f"{p}:{'.'.join(path)}:{v}")
walk(v, path+(k,))
elif isinstance(obj, list):
for i,v in enumerate(obj):
walk(v, path+(str(i),))
walk(data, ())
PY
echo "== i18n locale generation/workflow references =="
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
"generate.*locale|i18n|locales/.*/[^/]+\.json|fallback|en\.json|wsI18n|translateMessage|i18next|i18n" \
-S .Repository: stablyai/orca
Length of output: 50370
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
import json
from pathlib import Path
for loc in ["en", "es", "ja", "ko"]:
p = Path(f"src/renderer/src/i18n/locales/{loc}.json")
data = json.loads(p.read_text(encoding="utf-8"))
hits = []
def walk(obj, keypath):
if isinstance(obj, dict) and "windowsPathUnknown" in obj and isinstance(obj["windowsPathUnknown"], str):
hits.append((keypath + ["windowsPathUnknown"], obj["windowsPathUnknown"]))
if isinstance(obj, dict):
for k, v in obj.items():
walk(v, keypath + [k])
elif isinstance(obj, list):
for i, v in enumerate(obj):
walk(v, keypath + [i])
walk(data, [])
print(f"\n{loc}.json ({len(hits)} windowsPathUnknown)")
for keypath, value in hits:
print(f" {'.'.join(str(p) for p in keypath)}: {value[:120]}")
PY
echo "== locate localized-catalog =="
fd -a 'localized-catalog\.(ts|tsx|js)$|locales' src/renderer/src/i18n 2>/dev/null || true
sed -n '1,220p' src/renderer/src/i18n/localized-catalog.tsRepository: stablyai/orca
Length of output: 1960
Localize the missing Spanish fallbacks.
windowsPathUnknown is still English in both Spanish locale entries:
src/renderer/src/i18n/locales/es.json#L352-L352: Orca CLI Windows user PATH fallback.src/renderer/src/i18n/locales/es.json#L5652-L5652: WSL CLI PATH fallback.
Translate these entries before merge.
📍 Affects 1 file
src/renderer/src/i18n/locales/es.json#L352-L352(this comment)src/renderer/src/i18n/locales/es.json#L5652-L5652
Source: Learnings
| "0f116999f1": "セットアップ前にシェルを再起動するか、Orca CLI ディレクトリを PATH に追加します。", | ||
| "15cbedc3e3": "agent スキル セットアップを実行する前に、Orca CLI をインストールします。", | ||
| "windowsPathUnknown": "Orca could not check your Windows user PATH" | ||
| "windowsPathUnknown": "Orca could not check your Windows user PATH", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Files matching ja.json:"
fd -a 'ja\.json$' . | sed 's#^\./##'
echo
echo "Relevant ja.json entries:"
python3 - <<'PY'
import json
from pathlib import Path
p=Path('src/renderer/src/i18n/locales/ja.json')
data=json.load(open(p, encoding='utf-8'))
print('root keys:', list(data.keys())[:5])
def walk(obj, path=''):
if isinstance(obj, dict):
for k,v in sorted(obj.items()):
p=path+'.'+k if path else k
if k in {'windowsPathUnknown'} or isinstance(v, str) and ('windowsPathUnknown' in v or 'Orca could not check' in v or 'Path check failed' in v):
print(p, repr(v))
walk(v, p)
walk(data)
PY
echo
echo "Exact context around ja.json lines 348-356 and 5633-5641:"
sed -n '348,356p;5633,5641p' src/renderer/src/i18n/locales/ja.json | cat -n
echo
echo "Search for i18n usage of windowsPathUnknown:"
rg -n '"windowsPathUnknown"|windowsPathUnknown|Path check failed|Path check failed' -S .Repository: stablyai/orca
Length of output: 3195
Translate the English PATH-status strings in ja.json.
ja.json currently uses English source text for windowsPathUnknown at lines 352 and 5637, while adjacent entries and other locale catalogs contain local translations. Replace them with Japanese values so Japanese users do not see fallback English strings.
| "0f116999f1": "설정하기 전에 셸을 다시 시작하거나 Orca CLI 디렉터리를 PATH에 추가하세요.", | ||
| "15cbedc3e3": "agent 스킬 설정을 실행하기 전에 Orca CLI를 설치하십시오.", | ||
| "windowsPathUnknown": "Orca could not check your Windows user PATH" | ||
| "windowsPathUnknown": "Orca could not check your Windows user PATH", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Translate both PATH error values in the Korean catalog.
These entries override the Korean UI with English text for two failure states.
src/renderer/src/i18n/locales/ko.json#L352-L352: Translate the Windows user PATH error.src/renderer/src/i18n/locales/ko.json#L5637-L5637: Translate the WSL shell command PATH error.
📍 Affects 1 file
src/renderer/src/i18n/locales/ko.json#L352-L352(this comment)src/renderer/src/i18n/locales/ko.json#L5637-L5637
…e-host count (stablyai#12478) * fix(i18n): localize the status bar Resource Manager tooltip and remote-host count The Resource Manager tooltip/aria label and the SSH segment's host count were assembled from bare English literals inside helper functions, so they stayed English under every non-English UI language while the labels around them translated. Route them through the catalog with _one/_other plural keys and whole-line messages (locales reorder and repunctuate the summary), and add en/es/ja/ko/zh entries. Root cause of the miss: audit-localization-coverage bailed on any ancestor binary expression whose operator was not `+`, which hid every string under a `cond && <JSX/>` guard or a `?? 'fallback'` — including this segment's 'Connecting…'. Only comparison operands are code, so keep `??`, `||` and `&&` walking, and localize the four real strings that surfaced. Co-authored-by: Orca <[email protected]> * fix(status-bar): flag the space-scan tooltip row instead of matching its English text The tooltip tinted a row with `line === 'Space scan ready'`, so routing that copy through the catalog silently dropped the tint in every translated build. Return `{ text, emphasized }` and let the segment read the flag. Adopted from stablyai#12439 by @smwbev. Co-authored-by: Evgenii <[email protected]> Co-authored-by: Orca <[email protected]> * fix(status-bar): key Resource Manager tooltip rows by role instead of array index Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
What was broken (ELI5)
If you set Orca's language to Japanese (or Spanish, Korean, Chinese), most of the app translates — but two bits of the bottom status bar stubbornly stayed in English. Hovering the Resource Manager showed an English tooltip ("Resource Manager - 3.69 GB · Σ RSS - 2 terminal sessions"), and the remote-hosts pill next to it read "2 hosts" even though the label a screen reader announced for the very same button was already Japanese. Now every line of that tooltip and the host count read in your chosen language, and the highlighted "space scan ready" row keeps its highlight in every language instead of only English.
Root cause
Two independent layers.
1. The strings. They were assembled from bare literals inside helper functions rather than looked up in the catalog:
src/renderer/src/components/status-bar/resource-manager-terminal-copy.ts:1-2—`${count} terminal session${count === 1 ? '' : 's'}`resource-manager-terminal-copy.ts:13,16,20,24,26—'memory unavailable', theResource Manager - … - …summary,'Space scan ready','Terminal sessions are grouped by workspace.','No terminal sessions yet.'src/renderer/src/components/status-bar/SshStatusSegment.tsx:65-67—`${count} ${count === 1 ? 'host' : 'hosts'}`SshStatusSegment.tsx:346— the?? 'Connecting…'fallback and the adjacent'Workspace conflict'/'Workspace sync error'ternarySshStatusSegment.tsxalready importstranslateat line 13 and uses it for every other label in the same render path, which is exactly the inconsistency the report names.grep -n "SshStatusSegment" src/renderer/src/i18n/locales/en.jsonshows the section at line 3186 has no host-count key, and noterminal session/Space scan readykey exists anywhere inen.json.2. Why the gate let it ship.
classifyStringNodeinconfig/scripts/audit-localization-coverage.mjs:311-366only returns a kind for jsx-attribute / jsx-text / jsx-expression / user-visible-call / object-property, so a literal in areturnstatement classifies asundefined. It also bails at lines 316-322 on any ancestor binary expression whose operator is not+— which hides not just?? 'Connecting…'but every string nested under acond && <JSX/>guard. Running the audit's owncollectLocalizationCandidatesover both files returns 0 candidates, andnode config/scripts/audit-localization-coverage.mjs --checkpassed clean onmain.3. A latent bug the fix surfaces (found by @smwbev, see below).
ResourceUsageStatusSegment.tsx:1193tinted one tooltip row by comparing it against the English text:That comparison stops matching the instant the copy comes from the catalog, so simply routing the string through
translate()silently drops the highlight in every non-English build.The fix
Strings. Every literal in the status-bar render path now goes through
translate(). The Resource Manager copy stays inresource-manager-terminal-copy.ts; the SSH labels move into a newssh-status-segment-copy.ts, mirroring the directory's existingresource-memory-metric-copy.tsconvention. That extraction was also forced: addingtranslate()inline pushedSshStatusSegment.tsxfrom 394 to 415 effective lines, past the 400max-linescap, and AGENTS.md forbids adding a disable.The tooltip summary and the aria label are whole-line keys (
Resource Manager - {{memory}} - {{sessions}},Resource Manager, {{sessions}}, {{spaceScan}}) rather than fragments joined with' - '/', '. Those separators and that word order are sentence structure: ja and zh reorder and repunctuate them (、/,), which is visible in the screenshots below.Catalog entries land in all five locales with real translations, reusing terminology already in the catalog (リソースマネージャー / 资源管理器 / Administrador de recursos, 台のホスト / 个主机, 接続中…). Both
_oneand_otherare supplied per locale on purpose: the code picks the suffix, so a ja catalog with only_otherwould render the English_onesource atcount === 1.The tint.
getResourceManagerTooltipLinesnow returns{ text, emphasized }[]and the segment reads the flag, so the highlight no longer depends on the row's wording.Gate.
classifyStringNodenow keeps walking through??,||and&&ancestors — only comparison operands are code — with the same set applied inisRenderedJsxExpression. That surfaced exactly 5 new candidates: 4 genuine unlocalized strings, now localized (StatusBar's', new activity'aria label, the duplicated'Refresh CLI registration status and try again.'toast description inCliSkillRuntimeSetupandagent-skill-cli-prerequisite, and worktree-activation's'Cannot open folder workspace'toast title), and 1 false positive (label="sidebar"is a'sidebar' | 'source-control'variant discriminator onDetachedHeadBadge), which got an allowlist entry.I deliberately did not close the other half of the gate blind spot (classifying strings returned from helpers). I measured it with a probe reusing the audit's own AST walk: 1056 candidates across the renderer, most real but some noise (Tailwind class strings from
: stringhelpers, e.g.overallDotColorreturning'bg-emerald-500'). A 1000-entry allowlist inside a bug fix would be unreviewable and would freeze the backlog in place. Instead I followed the repo's own established remediation for exactly this blind spot —src/renderer/src/i18n/settings-status-label-localization.test.ts, whose docblock names the same root cause — and pinned the contract with a runtime test that switches the real i18n instance to Japanese.Reproduction
Base commit:
git log --oneline -1→29bfc1e22c Fix Windows git/gh attribution wrappers rejecting a piped stdin argument (#12440).A scratch vitest (since deleted) switched the real i18n instance to Japanese, called the real exported copy helpers, and rendered the real
SshStatusSegmentwith 2 connected SSH targets:With the UI in Japanese, the trigger's aria-label renders
リモートホスト接続状態but its visible text renders the English2 hosts, and the whole tooltip stays English.The gate blind spot, via a probe calling the audit's own
collectLocalizationCandidates:and
node config/scripts/audit-localization-coverage.mjs --check→Localization coverage check passed with 12 allowlisted candidates.Regression tests fail without the source fix. Reverting only the source files (
git checkout 29bfc1e22c -- <sources>, keeping the new tests) givesTest Files 4 failed (4) / Tests 13 failed | 3 passed (16):Visual proof
Rendered through a scratch Vite harness (deleted before commit) that mounts the real exported copy helpers and the real
main.csstokens withi18n.changeLanguage('ja'), inside the realTooltipContentsurface classes (bg-foreground … text-background). Three states, same harness, only the source files swapped bygit checkout.1. Before (
main, 29bfc1e) — the tooltip, the screen-reader label and the host pill are all English under a Japanese UI. The space-scan row is highlighted:2. Localizing the strings alone — copy is Japanese, but the space-scan row has silently lost its highlight, because
line === 'Space scan ready'no longer matches. This is the regression @smwbev caught:3. After (this PR) — translated and the highlight is back, now driven by the
emphasizedflag. Note the、separators in the screen-reader label, which is why the aria label is a whole-line key:Relationship to #12439
Full credit to @smwbev for finding, reporting and diagnosing this in #12439 — including correctly identifying that
audit-localization-coverage.mjscannot see values returned from helper functions, which is why the strings shipped untranslated in the first place. I worked the fix independently before reading their PR, then cross-referenced.What I took from #12439: the
{ text, emphasized }tooltip-line shape, and the reason for it. My independent fix localized'Space scan ready'but leftResourceUsageStatusSegment.tsx:1193comparing the row against its English text — a real regression in my version that @smwbev caught and I did not. Their structural fix (return the flag, don't re-derive it from wording) is strictly better than the alternative of exporting the label helper and comparing againstspaceScanReadyLabel(), because it can't drift. Their unit test for the flag is adopted too, and extended with a ja-locale assertion that the emphasized row's text is not'Space scan ready'. Commit6d1fdbcis co-authored to them.What I did differently:
en.jsononly, so at runtime nothing changes for anyone —translate()already falls back to the same inline English default. This PR adds real es/ja/ko/zh translations, which is what recent i18n PRs in this repo do (0d38053945,8fc892dd02, and every locale-touching merge in the last month). Without them the reported symptom is unchanged for the users who hit it.Connecting…. This PR also covers the'Workspace conflict'/'Workspace sync error'ternary two lines away in the same span, plus the 4 strings the fixed gate surfaced elsewhere.??/||/&&now keep walking) and localizes what that turns up. The helper-return half stays open for the reasons measured above.parts.join(', ')for the aria label, which hardcodes English punctuation and ordering; this PR makes it a whole-line key so ja/zh can use、.status-bar-copy-localization.test.tsasserts key/value pairs inen.json. That doesn't actually catch a helper reverting to a bare literal — the catalog entries would still be there. This PR renders under a real Japanese i18n instance and asserts the Japanese output, which does.Closes #12439's issue; happy to defer to that PR on anything I got wrong.
Testing
Cross-platform: this change is UI copy and its lookup path only — no paths, shells, accelerators or platform APIs.
Connecting…keeps U+2026, already used in the file. The memory label (3.69 GB · Σ RSS) is produced upstream bymemoryMetricCopyand passes through as an interpolation value unchanged. Nothing here assumes a git worktree over a folder workspace, or local execution over SSH.Open questions for a maintainer
: stringhelpers that return Tailwind classes/ids._oneand_othervalues because those languages don't inflect — required because the code picks the suffix. Confirm that matches how the localization team wants plural families filled.connectedHostCount_*/connecting/workspaceConflict/workspaceSyncErrorkeep theauto.components.status.bar.SshStatusSegment.*prefix even though the helpers now live inssh-status-segment-copy.ts, to avoid catalog churn. Nothing enforces file/key correspondence; say the word if you'd rather have the file-derived prefix.Made with Orca 🐋