Skip to content

Comments

Add i18n specification#75

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/plan-architectural-change-i18n
Draft

Add i18n specification#75
Copilot wants to merge 6 commits intomainfrom
copilot/plan-architectural-change-i18n

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

  • Create specs/i18n/ directory with initial i18n proposals
  • Add recommendation explaining why the full-replacement approach suits AI-driven translation
  • Remove Plan A per review feedback
  • Rewrite Plan B and recommendation as a single unified specs/i18n/i18n-spec.md (Internationalization Specification)
  • Replace all python3 html-generators/generate.py references in the spec with jbang html-generators/generate.java to match the project's canonical build tooling
Original prompt

This section details on the original issue you should resolve

<issue_title>Plan architectural change for i18n</issue_title>
<issue_description>Propose two plans for an update to the architecture of the website, to support internationalization.

Add the plans to ./specs/i18n</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Propose plans for internationalization architecture update Add i18n architectural specs Feb 20, 2026
@javaevolved javaevolved deleted a comment from Copilot AI Feb 20, 2026
@brunoborges
Copy link
Contributor

@copilot which plan is better? Especially considering we will be using AI to generate the translations later on, automatically, whenever a new slug is added.

Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot which plan is better? Especially considering we will be using AI to generate the translations later on, automatically, whenever a new slug is added.

Plan B is the better fit for an AI-driven workflow. I've added a detailed breakdown in specs/i18n/recommendation.md (commit 318ffb1), but the key points are:

Plan A (overlay) is awkward for AI because the AI must know which fields to omit from the overlay (oldCode, modernCode, docs, related, prev/next). If the AI accidentally includes any of those, the build silently uses the AI value instead of the canonical English one — a subtle and hard-to-detect error.

Plan B (full replacement) is ideal because:

  • The AI just translates the full JSON file — no special field-filtering rules in the prompt.
  • The generator always overwrites oldCode/modernCode with the English values at build time, so even if the AI copies them verbatim (or hallucinates), the correct code still ships.
  • Output validation is simple: run the same JSON schema checks used for English files.
  • When a translation doesn't yet exist, the fallback is explicit (optional "not yet translated" banner) rather than silent.

The recommended automation loop is: detect new/changed English slug → AI translates → schema validation → commit to translations/content/{locale}/ → generator picks it up on next deploy.

@brunoborges
Copy link
Contributor

@copilot ok let's get rid of Plan A, and focus on Plan B.

Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot ok let's get rid of Plan A, and focus on Plan B.

Done (commit ce99798). plan-a-locale-keyed-content.md has been deleted. The Plan B spec and recommendation.md have been cleaned up to remove all Plan A cross-references and comparison tables — the specs/i18n/ folder now contains only plan-b-externalized-strings-full-translations.md and recommendation.md (which now documents the AI automation workflow directly).

Copilot AI changed the title Add i18n architectural specs Add i18n architectural spec Feb 20, 2026
@brunoborges
Copy link
Contributor

@copilot rewrite Plan B as Internationalization Spec.

Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot rewrite Plan B as Internationalization Spec.

Done (commit d301312). plan-b-externalized-strings-full-translations.md and recommendation.md have been replaced by a single specs/i18n/i18n-spec.md. It's written as an authoritative specification — no "plan" framing — and consolidates all sections: directory layout, string and content schemas, generator resolution order, template/HTML/JS changes, GitHub Actions setup, the AI-driven translation workflow, and the phased migration path.

Copilot AI changed the title Add i18n architectural spec Add i18n specification Feb 20, 2026
@brunoborges
Copy link
Contributor

@copilot

The specification suggests using the Python script, but the copilot-instructions.md in this repo are strictly pointing at the Java-based generator (triggered with jbang). If the instructions are not clear, make it so.

Copy link
Contributor Author

Copilot AI commented Feb 20, 2026

@copilot

The specification suggests using the Python script, but the copilot-instructions.md in this repo are strictly pointing at the Java-based generator (triggered with jbang). If the instruct...

Fixed in commit 9c2ff55. The spec now uses jbang html-generators/generate.java everywhere — in the directory layout comment, the GitHub Actions YAML block, and the explicit per-locale build examples.

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.

Plan architectural change for i18n

2 participants