Conversation
0795b16 to
fab7caa
Compare
There was a problem hiding this comment.
Pull request overview
Adds basic internationalization (i18n) to the Aegis Stack CLI with initial zh locale support, wires locale selection into the CLI entrypoint, and updates user-facing CLI output strings and docs accordingly. It also tightens AI voice template generation by gating voice-specific imports/handlers behind the existing ai_voice template flag.
Changes:
- Introduce i18n registry + English/Chinese message catalogs and use
t()for key CLI output paths. - Add global
--lang/AEGIS_LANGlocale selection and document the feature in README/docs. - Gate AI voice imports/endpoints/templates behind
ai_voiceto avoid generating unused voice code.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cli/test_database_runtime_postgres.py | Adds a post-skip return for type-narrowing clarity. |
| README.md | Documents CLI language selection via --lang / AEGIS_LANG. |
| docs/installation.md | Adds an Installation Guide section describing CLI language support. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/service.py.jinja | Wraps voice imports/attributes/methods in {% if ai_voice %}. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/init.py.jinja | Makes voice exports/docstring conditional on ai_voice. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/backend/api/ai/router.py.jinja | Makes voice-related imports/models/endpoints conditional on ai_voice. |
| aegis/i18n/registry.py | Implements locale detection, normalization, lazy loading, and translation fallback. |
| aegis/i18n/locales/en.py | Adds canonical English message definitions. |
| aegis/i18n/locales/zh.py | Adds Simplified Chinese message definitions. |
| aegis/i18n/locales/init.py | Declares AVAILABLE_LOCALES. |
| aegis/i18n/init.py | Exposes t() and locale helpers with usage guidance. |
| aegis/core/project_map.py | Localizes project map labels via t(). |
| aegis/core/post_gen_tasks.py | Localizes most post-generation user messages via t(). |
| aegis/core/copier_manager.py | Localizes docs/star output strings via t(). |
| aegis/commands/init.py | Localizes init flow prompts/errors/status via t(). |
| aegis/commands/add_service.py | Extends interactive AI config unpacking to include voice and updates bracket syntax. |
| aegis/cli/validators.py | Localizes validation errors via t(). |
| aegis/cli/interactive.py | Localizes interactive prompts/labels and adds AI voice selection support. |
| aegis/main.py | Adds --lang option + envvar support and initializes locale early. |
Comments suppressed due to low confidence (1)
aegis/core/post_gen_tasks.py:1090
- In the TimeoutExpired/Exception handlers for LLM catalog sync, the “Run '{project_slug} llm sync' manually…” hint is still hard-coded in English, so zh output will be partially untranslated. Reuse the existing i18n key (postgen.llm_sync_manual) here as well for consistent localization.
except subprocess.TimeoutExpired:
typer.secho(t("postgen.llm_sync_timeout"), fg=typer.colors.YELLOW)
typer.secho(
f"Run '{project_slug} llm sync' manually to populate the catalog",
dim=True,
)
return False
except Exception as e:
typer.secho(t("postgen.llm_sync_error", error=e), fg=typer.colors.YELLOW)
typer.secho(
f"Run '{project_slug} llm sync' manually to populate the catalog",
dim=True,
)
fab7caa to
2575142
Compare
2575142 to
1e0752e
Compare
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.
No description provided.