feat: Add --language parameter for localized content generation#142
Conversation
Adds --language parameter to /understand command to generate knowledge graph content in user-specified language. Changes: - Update argument-hint and Options documentation in SKILL.md - Add language parsing logic in Phase 0 (language normalization, config persistence, LANGUAGE_DIRECTIVE template) - Inject language directive into agent dispatch prompts for all content-generating phases (Phase 1-5) - Add language directive handling instructions in agent definitions - Create locales/ directory with template files for: - English (en.md) - default - Chinese Simplified (zh.md) - Chinese Traditional (zh-TW.md) - Japanese (ja.md) - Korean (ko.md) Locale files provide language-specific guidance for: - Tag naming conventions - Summary writing style - Technical term handling - Layer name translations Closes Lum1104#141
|
Sounds good. We also discuss this feature here. Really useful! |
|
- Add outputLanguage field to ProjectConfig type - Create /config.json endpoint in vite.config.ts - Build locale files for 5 languages (en, zh, zh-TW, ja, ko) - Add I18nProvider context and useI18n hook - Update 5 components (ProjectOverview, NodeInfo, FileExplorer, FilterPanel, PersonaSelector) - Dashboard reads language from config.json and displays localized UI All tests passed: - Core: 670 tests - Dashboard: 42 tests
|
Awesome! @codex review this~ |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 752fe59e0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…onfig
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
最新提交的i18n for UI text还存在问题,🤭正在修复。 |
|
To use Codex here, create a Codex account and connect to github. |
|
搞定!Dashboard界面语言跟随knowledge graph content的语言,目前支持简体中文、英文、韩文、日文、繁体中文。 |
|
@codex review this |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a3ec91bf39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Remove invalid allowBuilds from pnpm-workspace.yaml (use onlyBuiltDependencies in root package.json) - Use data-testid for search input selector (fixes / keyboard shortcut for non-English locales)



Summary
This PR implements the
--languageparameter for the/understandcommand, allowing users to generate knowledge graph content in their preferred language.Closes #141
Changes
Skill Definition (
SKILL.md)argument-hintto include--language <lang>--languagedocumentation in Options section.understand-anything/config.json$LANGUAGE_DIRECTIVEtemplate for agent dispatchAgent Dispatch Modifications
Injected
$LANGUAGE_DIRECTIVEinto dispatch prompts for all content-generating phases:Agent Definition Updates
Added language directive handling instructions in:
project-scanner.md- affectsdescriptionfieldfile-analyzer.md- affectssummary,tags,languageNotesarchitecture-analyzer.md- affects layername,descriptiontour-builder.md- affectstitle,description,languageLessonLocale Template Files
Created
locales/directory with language-specific guidance:en.mdzh.mdzh-TW.mdja.mdko.mdEach locale file provides guidance for:
Usage Examples
Testing
pnpm build)Implementation Notes
.understand-anything/config.jsonfor consistency across incremental updates--languagespecified, uses stored config or defaults toen$OUTPUT_LANGUAGEis NOTen, locale guidance file is injected into architecture-analyzer prompt (Phase 4 step 4)