fix: Wrap MobileLayout with I18nProvider; use outputLanguage key in config

P1: MobileLayout was missing I18nProvider wrapper, causing useI18n
    to throw error on mobile devices. Now both desktop and mobile
    layouts are wrapped with I18nProvider.

P2: SKILL.md used 'language' key but Dashboard reads 'outputLanguage'.
    Fixed config.json key name to match ProjectConfig type definition.

All tests passed:
- Core: 670 tests
- Dashboard: 42 tests
This commit is contained in:
zhushen
2026-05-11 20:30:50 +08:00
parent 752fe59e0c
commit e1650f627c
2 changed files with 14 additions and 12 deletions
@@ -394,16 +394,18 @@ function Dashboard({ accessToken }: { accessToken: string }) {
if (isMobile) {
return (
<ThemeProvider metaTheme={metaTheme}>
<MobileLayout
accessToken={accessToken}
showKeyboardHelp={showKeyboardHelp}
setShowKeyboardHelp={setShowKeyboardHelp}
loadError={loadError}
allIssues={allIssues}
shortcuts={shortcuts}
/>
</ThemeProvider>
<I18nProvider language={outputLanguage ?? "en"}>
<ThemeProvider metaTheme={metaTheme}>
<MobileLayout
accessToken={accessToken}
showKeyboardHelp={showKeyboardHelp}
setShowKeyboardHelp={setShowKeyboardHelp}
loadError={loadError}
allIssues={allIssues}
shortcuts={shortcuts}
/>
</ThemeProvider>
</I18nProvider>
);
}
@@ -121,10 +121,10 @@ Determine whether to run a full analysis or incremental update.
- `chinese` → `zh`, `japanese` → `ja`, `korean` → `ko`, `english` → `en`, `spanish` → `es`, `french` → `fr`, `german` → `de`, `portuguese` → `pt`, `russian` → `ru`, `arabic` → `ar`, etc.
- Locale variants: `zh-TW`, `zh-HK`, `zh-CN`, `pt-BR`, etc. are preserved as-is.
- If `--language` is NOT specified:
- Check `$PROJECT_ROOT/.understand-anything/config.json` for an existing `language` field. If present, use that.
- Check `$PROJECT_ROOT/.understand-anything/config.json` for an existing `outputLanguage` field. If present, use that.
- If no stored preference, default to `en` (English).
- If `--language` IS specified:
- Update `$PROJECT_ROOT/.understand-anything/config.json` with the new language: merge `{"language": "<lang>"}` into existing config.
- Update `$PROJECT_ROOT/.understand-anything/config.json` with the new language: merge `{"outputLanguage": "<lang>"}` into existing config.
- Store as `$OUTPUT_LANGUAGE` for use throughout all phases.
- **Language directive template:** Store as `$LANGUAGE_DIRECTIVE`:
```markdown