On Monday, 13 July 2020 21:51:07 CEST Cole Robinson wrote: > On 7/13/20 4:58 AM, Pino Toscano wrote: > > On Sunday, 12 July 2020 15:12:24 CEST Cole Robinson wrote: > >> On 7/8/20 10:54 AM, Pino Toscano wrote: > >>> This patch series improve the handling of translations. > >>> > >>> Use the gettext tools to: > >>> - extract the messages from all the various sources > >>> - merge old translations with the new catalog > >>> - build translations as mo files > >>> - merge translations to desktop, and AppStream files > >>> This makes gettext a mandatory dependency when installing, replacing > >>> intltool. > >>> > >>> To make sure the translations are updated in Weblate, commit the > >>> catalog in the repository. > >>> > >>> As related (i18n) changes: drop two translations that are totally > >>> empty. > >> > >> Thanks Pino! Pushed now with a tweak to patch 3 to drop now unused > >> fnmatch import. > > > > Ah, missed that one, thanks for the hotfix. > > > >> I set up some automation with this. After every push github CI will > >> refresh po/virt-manager.pot in the 'translations' branch and I updated > >> weblate to use that branch. I would appreciate it if you can confirm > >> everything looks sensible from the weblate translator side > > > > I've seen this separate branch setup already in other projects, and it > > works as long as you remember to periodially merge the translations :) > > The only downside is that checking out master gives no translations. > > One thing I notice is that the branch seems to duplicate commits from > > master, instead of merging from it. > > Also, it could be helpful to commit the updated template only when it > > has actual changes: > > $ diff -u -I 'POT-Creation-Date' old.pot new.pot > > this will ignore changes in lines with the POT-Creation-Date text. > > In practice, this will not show any output if all it changed was the > > creation date of the template. I can try to tweak the action for this. > > > > Any help here is appreciated. Merging sounds like the better idea. > Filtering out the timestamp works for me too, it will take more smarts > in the actions file I will play a bit with it, and see what I can get out of it. Never worked with the github actions before. > To test in your own repo, you need to delete the 'if:' line that limits > it to only run on virt-manager/virt-manager. Ack, thanks. > > It looks to me the updated template was not merged with the existing > > translations. This is something to do in weblate (see below). > > Do you have admin access to the virt-manager project in weblate? If so, > > please enable the following addons (in , select Manage -> Addons): > > - "Update PO files to match POT (msgmerge)": this does what I mentioned > > above, i.e. update the translations to the template, so string > > changes are available to translators; recommended settings: > > - "Keep previous msgids of translated strings": enabled > > when a string changes, this will keep the old msgid around, so > > translators can see what changed > > - "Use fuzzy matching": enabled > > - "Update LINGUAS file": this updates the po/LINGUAS file when new > > languages are added; IMHO sadly it does not keep the file sorted, > > but I personally can live with that (especially if I don't have to > > update LINGUAS myself) > > I suggest also "Squash Git commits" configured per-author: this way, > > translation updates will be squashed as single commit for each > > translator (who will get then proper git authorship), instead of > > multiple commits per-author after each editing session. > > > >  https://translate.fedoraproject.org/projects/virt-manager/virt-manager/ > > Great, thanks for the tips! I enabled those but I also added you as > admin. If you make any tweaks let me know so I can learn. Thanks! Now that I see the configuration, I also remembered to enable the "Contributors in comment" addon: it updates the comment in the PO header (i.e. all the lines that start with '#' before the first msgid) with the names of all the contributors that work on each translation. This way all the translators get the credit in the exported PO files. -- Pino Toscano
Description: This is a digitally signed message part.