feat(i18n): add multi-language support (zh/en/de)#398
Closed
kevin-hillman wants to merge 1 commit into666ghj:mainfrom
Closed
feat(i18n): add multi-language support (zh/en/de)#398kevin-hillman wants to merge 1 commit into666ghj:mainfrom
kevin-hillman wants to merge 1 commit into666ghj:mainfrom
Conversation
Add a complete internationalization system that supports Chinese (default), English, and German via the LANGUAGE environment variable. Backend: - Add backend/app/i18n/ module with language loader and accessor functions - Extract all prompt templates, format strings, UI strings, and regex patterns into language-specific files (zh.py, en.py, de.py) - Update all services to use i18n: report_agent, zep_tools, ontology_generator, simulation_config_generator, oasis_profile_generator, zep_graph_memory_updater - Add /api/config/language and /api/config/patterns endpoints Frontend: - Add frontend/src/i18n/ with locale JSON files (zh/en/de, 240 keys each) - Add language loader with t(), setLanguage(), initLanguage() functions Configuration: - Add LANGUAGE=zh to .env.example (options: zh, en, de) - Chinese remains the default for backward compatibility This enables the MiroFish community to use the platform in their preferred language and makes it easy to add more languages.
Owner
|
The project already has i18n support in place — please refer to [PR #428] for reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a complete internationalization (i18n) system that enables MiroFish to run in Chinese (default), English, or German via a single
LANGUAGEenvironment variable.app/i18n/module with language-specific files for all prompt templates,to_text()format strings, UI strings, and regex patterns. All services updated to useget_prompt(),get_format(),get_string()instead of hardcoded strings.zh.json,en.json,de.json) with 240 keys each, plus a loader module witht()function./api/config/languageand/api/config/patternsendpoints so the frontend can adapt to the configured language.How to use
Files changed
__init__.py,zh.py,en.py,de.py(~4000 lines)zh.json,en.json,de.json,index.js.env.example,config.py,__init__.pyconfig_api.pywith language/patterns endpointsWhy this matters
MiroFish has growing international interest. This PR makes it accessible to English and German speakers without forking, while keeping the Chinese experience identical. Adding more languages is straightforward -- just create a new language file following the existing pattern.
Test plan
LANGUAGE=zhproduces identical output to current behaviorLANGUAGE=enproduces English prompts, reports, and UILANGUAGE=deproduces German prompts, reports, and UI/api/config/languagereturns the configured language/api/config/patternsreturns language-appropriate regex patterns