6

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.

Dominic Porter
  • 103
  • 1
  • 8

1 Answers1

2

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

Michal Čihař
  • 9,799
  • 6
  • 49
  • 87
  • Thanks Michal, I have that running now but it seems I can't detect the new components by just adding the POT file... there needs to be at least one `.lang.PO` it seems... SO I tried copying the POT to a `.en.po` and this makes it detect the component, but complains about duplicate `en` language... so I can then delete it. Surely there must be a better way than: - generate POT - copy POT to `.en.po` - upload and detect component - delete `.en.po` – Dominic Porter Feb 03 '20 at 10:15
  • Yes, the PO file currently needs to be present. See also https://github.com/WeblateOrg/weblate/issues/2084 – Michal Čihař Feb 03 '20 at 11:34