implement translation infrastructure - use portuguese as test example#18
Open
rpetit3 wants to merge 11 commits into
Open
implement translation infrastructure - use portuguese as test example#18rpetit3 wants to merge 11 commits into
rpetit3 wants to merge 11 commits into
Conversation
✅ Deploy Preview for bactopia-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds initial translation infrastructure for the Bactopia documentation site, using Portuguese as the first test locale.
Changes:
- Enables Docusaurus i18n for English and Portuguese with a locale dropdown.
- Adds Claude-based translation tooling, prompts, glossary post-processing, sync/verify commands, and Makefile targets.
- Adds initial Portuguese UI translation JSON files and updates acknowledgements for translation attribution.
Reviewed changes
Copilot reviewed 14 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
docusaurus.config.ts |
Enables Portuguese locale and adds locale dropdown. |
Makefile |
Adds translation sync/full/verify targets. |
bin/translate/__init__.py |
Adds package metadata comments for translation tooling. |
bin/translate/__main__.py |
Enables python -m bin.translate. |
bin/translate/api.py |
Adds Claude API integration and retry/continuation logic. |
bin/translate/cli.py |
Adds translation CLI commands for sync, single-file translation, and verification. |
bin/translate/config.py |
Defines translation constants, paths, plugin mappings, and API key validation. |
bin/translate/glossary.py |
Adds glossary-based post-processing and admonition handling. |
bin/translate/sync.py |
Adds source discovery, hash tracking, and orphan detection. |
bin/translate/verify.py |
Adds structural validation checks for translated files. |
bin/translate/prompts/general.md |
Adds general translation rules for Markdown/MDX docs. |
bin/translate/prompts/pt.md |
Adds Brazilian Portuguese-specific translation guidance. |
data/translations/pt/glossary.yml |
Adds Portuguese glossary and protected terms. |
i18n/pt/code.json |
Adds Portuguese theme/UI strings. |
i18n/pt/docusaurus-theme-classic/navbar.json |
Adds Portuguese navbar strings. |
i18n/pt/docusaurus-theme-classic/footer.json |
Adds Portuguese footer strings. |
i18n/pt/docusaurus-plugin-content-blog/options.json |
Adds localized blog metadata. |
i18n/pt/docusaurus-plugin-content-docs/current.json |
Adds localized main docs metadata. |
i18n/pt/docusaurus-plugin-content-docs-impact/current.json |
Adds localized impact docs metadata. |
i18n/pt/docusaurus-plugin-content-docs-developers/current.json |
Adds localized developer docs metadata. |
i18n/pt/docusaurus-plugin-content-docs-bactopia-tools/current.json |
Adds localized tools docs metadata. |
i18n/pt/docusaurus-plugin-content-docs-bactopia-pipelines/current.json |
Adds localized pipelines docs metadata. |
templates/acknowledgements.j2 |
Adds translation infrastructure acknowledgement to generated content. |
impact/acknowledgements.md |
Regenerates acknowledgements with translation attribution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| locales: ['en', 'pt'], | ||
| localeConfigs: { | ||
| en: { label: 'English', direction: 'ltr' }, | ||
| pt: { label: 'Portugues', direction: 'ltr' }, |
- Add blog to PLUGIN_MAP with versioned flag for correct i18n path - Fix sync.py to handle non-versioned plugins (blog has no current/ subdir) - Add prompt caching to API calls (system prompt cached across all calls) - Update prompt tone from "professional" to "friendly and approachable" - Remove __pycache__ from tracking and add to .gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Translated main documentation pages: index, quick-start, installation, beginners-guide, full-guide, tutorial, plus developers/cli/bactopia-docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix orphan removal bug: only scan plugin dirs present in the filtered file set, preventing --include from deleting other sections' translations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix unclosed code fences: LLM consistently drops trailing ``` at EOF. Added fix_unclosed_fences to post-processing pipeline to prevent recurrence. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…iles) Completes all content translations: 317 files across 6 sections. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Copy blog post images to i18n directory (relative paths need local copies) - Fix broken anchor links in PT full-guide and tutorial where translated headings generate different slug anchors than the English originals Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changed full-guide.md to ./full-guide.mdx to match actual filename and use proper relative path syntax. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Impact & Outreach -> Impacto e Divulgação Developers -> Desenvolvedores CLI Reference -> Referência CLI Modules -> Módulos Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
@Mxrcon howdy here is the PR I mentioned |
Member
Author
|
glossary inconsistencies (LLM chose something other than the glossary) |
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
Type of Change
Version Impact
Checklist
npm run build)npm start)snapshots.jsonupdated (if adding/removing a version)make llms-catalog) if pages were added/removed/renamed