Skip to content

Mandarin Support#545

Merged
lbedner merged 1 commit intomainfrom
mandarin-support
Mar 20, 2026
Merged

Mandarin Support#545
lbedner merged 1 commit intomainfrom
mandarin-support

Conversation

@lbedner
Copy link
Copy Markdown
Owner

@lbedner lbedner commented Mar 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 20, 2026 03:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_LANG locale selection and document the feature in README/docs.
  • Gate AI voice imports/endpoints/templates behind ai_voice to 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,
        )

Comment thread aegis/__main__.py
Comment thread aegis/__main__.py
Comment thread README.md Outdated
Comment thread docs/installation.md Outdated
Comment thread aegis/i18n/locales/zh.py Outdated
@lbedner lbedner merged commit 60c7157 into main Mar 20, 2026
7 checks passed
@lbedner lbedner deleted the mandarin-support branch March 20, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants