How to Configure Non-English Language Output for Egonex AI Node Summaries
You configure non-English language output for Egonex AI node summaries by setting the outputLanguage field in .understand-anything/config.json or using the dashboard's Persona Selector to dynamically load locale modules like zh.ts or ja.ts.
The Egonex-AI/Understand-Anything repository provides a built-in localization system that controls both the dashboard UI and the LLM-generated node summaries. By modifying the ProjectConfig interface and selecting from the available locale files, you can render analysis results in Chinese, Japanese, Korean, Russian, or any supported language. This configuration applies to both the static strings in the interface and the dynamic content produced by the AI context builder.
Understanding the Language Configuration Architecture
ProjectConfig and the outputLanguage Field
The configuration system centers on the ProjectConfig type defined in packages/core/src/types.ts at lines 16-20. This interface declares the outputLanguage property, which accepts a locale code string (e.g., "zh", "ja", "en").
When outputLanguage is populated, the analysis pipeline passes this code to the LLM prompt construction logic in understand-anything-plugin/src/context-builder.ts. This ensures the AI generates node summaries in the specified language rather than the default English.
Locale File Structure
Each supported language has a dedicated module in packages/dashboard/src/locales/. For example, the Simplified Chinese locale resides in packages/dashboard/src/locales/zh.ts, while the index file at packages/dashboard/src/locales/index.ts exports the locale map and handles fallback resolution.
These files contain all UI strings used by the dashboard, including the labels that appear in node-summary panels. When outputLanguage is set to "zh", the dashboard automatically imports the matching module and re-renders the interface with the translated strings.
Step-by-Step Configuration Methods
Method 1: Configuring via Project Config File
For persistent language settings across analysis runs, create or edit .understand-anything/config.json in your project root.
{
"autoUpdate": true,
"outputLanguage": "zh"
}
Valid values for outputLanguage correspond to the locale file names: en for English, zh for Simplified Chinese, zh-TW for Traditional Chinese, ja for Japanese, ko for Korean, and ru for Russian. After saving this file, restart the analysis to apply the changes.
Method 2: Using CLI Language Flags
You can override the config file temporarily by passing the --language flag when running the CLI:
understand --full --language zh
The CLI forwards this flag to the same outputLanguage configuration key, allowing you to generate one-off reports in different languages without modifying your persistent configuration.
Method 3: Runtime Language Switching via Dashboard
The dashboard provides a language selector in the Persona Selector pane. Changing this selector updates ProjectConfig.outputLanguage in memory and triggers a re-render without requiring a restart.
// Example from the dashboard implementation
import { locales } '@/locales';
const changeLanguage = (lang: LocaleKey) => {
saveProjectConfig({ outputLanguage: lang });
i18n.setLocale(lang);
};
The selector component in src/components/PersonaSelector.tsx maps locale keys to human-readable labels:
<select
value={currentLocale}
onChange={e => changeLanguage(e.target.value as LocaleKey)}
>
<option value="en">English</option>
<option value="zh">中文</option>
<option value="ja">日本語</option>
</select>
How the Locale System Works Under the Hood
When the analysis pipeline initializes, the context-builder (understand-anything-plugin/src/context-builder.ts) retrieves the outputLanguage value from ProjectConfig and injects it into the LLM request. This ensures that node summaries, dependency explanations, and architectural insights are generated in the target language.
Simultaneously, the dashboard's internationalization layer loads the corresponding locale module from packages/dashboard/src/locales/. The system uses the index file to resolve the correct translation set and falls back to English if the specified locale is not found.
Supported Languages and Adding Custom Locales
The repository ships with locale files for major languages, but you can extend support by adding new TypeScript files to packages/dashboard/src/locales/. Follow the structure of en.ts (the default English locale) to ensure all required UI strings are defined, then update the LocaleKey type in types.ts to include your new language code.
Summary
- Set
outputLanguagein.understand-anything/config.jsonto persist language preferences across analysis runs. - Use CLI flags like
--language zhfor temporary language overrides without modifying config files. - Switch languages at runtime using the dashboard's Persona Selector, which updates
ProjectConfigin memory and reloads the UI instantly. - Extend localization by adding locale modules to
packages/dashboard/src/locales/and updating theLocaleKeytype definition. - Both AI output and UI strings are controlled by the same
outputLanguagefield, ensuring consistency between generated summaries and interface labels.
Frequently Asked Questions
What file do I edit to permanently set the language for Egonex AI summaries?
Create or edit .understand-anything/config.json in your project root and add the outputLanguage key with your desired locale code (e.g., "zh" for Chinese). This file persists your settings across CLI runs and dashboard sessions.
Can I switch languages without restarting the analysis?
Yes. The dashboard's Persona Selector allows you to change outputLanguage at runtime. This updates the configuration in memory and immediately re-renders the UI with the new locale strings, though you may need to re-run the analysis to regenerate existing node summaries in the new language.
Where are the UI translation strings stored?
Translation strings are stored in packages/dashboard/src/locales/ as TypeScript modules (e.g., zh.ts, ja.ts). The index.ts file in that directory exports a locale map that the dashboard uses to resolve translations and handle fallbacks to English.
How does the language setting affect the LLM-generated content?
The outputLanguage value is passed to the prompt construction logic in understand-anything-plugin/src/context-builder.ts, which injects the language hint into requests to the LLM. This ensures that node summaries, architectural explanations, and dependency analyses are generated in the specified language rather than defaulting to English.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →