Search code examples
gettextpoweblate

What is the best way to localize Markdown files in Weblate?


So I have been trialling Weblate using Docker, and pointing it at a Git repo with some .md files I want to localize. I believe a good way of doing this is to use po4a to first convert the .md (basically text) files to a Gettext .pot file then import these as individual components.

My main aim is to make the process as automated as possible but so far it looks like the steps will be something like this:

  • Convert from .md to .pot using po4a-getextize
  • Copy .pot file to .en.po file
  • Commit both files
  • Create new Component for this file in Weblate, manually putting in the name of the '.pot' file
  • Add new languages to translate this Component to
  • Wait for translators to do their thing
  • Download all .po files
  • Convert back to original format with po4a-translate

Feels like I'm missing something with the way Weblate creates components... or how the .pot & .po files work together... ideally I'd like to automatically pick up and create Components when .potfile appear in the repo, then just set up some scripts outside Weblate to automate the conversion to/from the different file formats.


Solution

  • You can use component discovery or API to automatically create the components.