Skip to content

feat: automate docs translation via Aide #138

Description

@kilbot

Background

JS/PHP string translation is now automated via Aide (wcpos/translations#41). Docs are the remaining untranslated surface — 11 locales configured in Docusaurus but no translated markdown files exist yet.

What needs to happen

1. Dispatch trigger in wcpos/docs

Add a workflow that fires on push to versioned_docs/version-1.x/ and src/ (changed .md/.mdx files) and POSTs to Aide's webhook:

on:
  push:
    branches: [main]
    paths:
      - 'versioned_docs/version-1.x/**'
      - 'src/pages/**'

Payload shape (similar to translations repo):

{
  "project": "wcpos-docs",
  "changed_files": ["versioned_docs/version-1.x/getting-started/index.md"]
}

2. New translate-docs skill for Aide

Different from translate-strings — docs are long-form MDX, not key-value pairs. Aide needs to:

  • Fetch changed .md/.mdx files from the docs repo
  • Translate body content only — preserve frontmatter keys, JSX component tags and their props, code blocks, links
  • Write output to i18n/{locale}/docusaurus-plugin-content-docs/version-1.x/{same-relative-path}
  • Commit all locales atomically (same approach as translate-strings)

3. Translation Memory for docs

Docs TM is sentence/paragraph-level, not string-key-level. Options:

  • Use the same TM infrastructure but key on SHA of each paragraph
  • Or skip TM for docs initially (re-translate on every change, rely on git diff to see what actually changed)

4. Retire the manual translate.yml in this repo

Once Aide is wired up, translate.yml and qa-translations.yml can be retired the same way they were in wcpos/translations.

Key differences from JS/PHP string translation

JS/PHP strings Docs
Format Flat key-value JSON / POT Full markdown/MDX
Trigger repository_dispatch from monorepo push to versioned_docs/
TM unit Single UI string Paragraph or heading
Output path translations/js/{locale}/ i18n/{locale}/docusaurus-plugin-content-docs/
Placeholder concern {count}, %s etc. JSX tags, frontmatter, code blocks

Open questions before implementation

  • Which version to translate first — version-1.x only, or version-0.4.x as well?
  • All 11 locales or a subset to start?
  • TM strategy: paragraph-level hashing or stateless re-translation?
  • What to do with JSX components that have translatable string props (e.g. <Badge text="New" />)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions