Page MenuHomePhabricator

Write localization/internationalization mkdocs plugin
Closed, ResolvedPublic


Implement an mkdocs plugin that will:

  • maintain a "primary" GNU Portable Object (PO) file in the git repo based on English language content added by editors
  • generate internationalized static pages based on PO files found in the git repo

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

My initial design for this is plugin is that it should do something like:

  1. configure theme languages based on po files found on disk
  2. create a temp directory outside of docs_dir for generated files
  3. add navigation strings to the English translation catalog
  4. generate .md files for all (Page, language) pairs where language != English
  5. let mkdocs find all the generated pages
  6. if md target language is English, add messages to English translation catalog
  7. if md target language is not English, translate md using po

These steps will be scattered across multiple mkdocs callbacks so that each happens in a place where other plugins and mkdocs built-ins can find the generated content and config when needed.

Change 747214 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[wikimedia/developer-portal@main] Content localization plugin

Change 747214 merged by jenkins-bot:

[wikimedia/developer-portal@main] Content localization plugin

apaskulin added a subscriber: apaskulin.

Completed and merged! Thanks, Bryan! 🎉