[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RANT] French translation for debconf templates stucked at 90% : analysis



This one time, at band camp, Matthew Palmer said:
> If I've got twelve languages translated in my package (not that I do, I
> think I've maxed two, I just picked the number at semi-random), it starts to
> get rather annoying to look in twelve .po files for the Language-Team and
> send the new version of my POT (and, if I recall correctly, the old .po) to
> them all.  A script (maybe in devscripts or something), well-publicised (ie
> mentioning it prominently in the initial bug report e-mails), which will do
> this work automatically, would encourage maintainers to report updated
> translations.
> 
> What would be even better would be a pre-packaged version of the little
> fragment that was floating around a while ago to check out of date
> translations:
> 
> #!/bin/sh
> 
> for i in debian/po/*.po; do
>         echo $i
>         msgfmt -o /dev/null --statistics $i
> done
> 
> with added functionality to send the updated POT to the fuzzied teams,
> probably along with the old one and whatever else might be useful.  The
> script could then warn the maintainer that N translations were out of date,
> that the relevant data has been sent to the translation teams, and to wait a
> certain amount of time before uploading to collect new translations.

Rough proof of concept (echo's rather than actually does it):

cat ~/trans_request debian/po/templates.pot > ~/trans-request.tmp
for i in debian/po/*.po
  do if msgfmt -o /dev/null --statistics $i 2>&1 | egrep -q '(fuzzy|untranslated)'
    then mailto=`grep 'Last-Translator' $i | cut -f2 -d: | sed -e s/\>.*/\>/`
    echo "mail -s \"New translation needed\" \"$mailto\" < ~/trans-request.tmp"
    echo "Request for new translation for $i emailed to $mailto"
  fi
done
rm ~/trans-request.tmp

And ~/trans_request contains some boilerplate like:

Thank you for your work on translations for my package in  the past.
I have made some changes to the debconf templates, and would appreciate
it if you could spare the time to update the translation.  templates.pot
below - please contact me if you need anything further.

Thanks again,

Obviously, change 
echo "mail -s \"New translation needed\" \"$mailto\" < ~/trans-request.tmp"
to
mail -s "New translation needed" "$mailto" < ~/trans-request.tmp

to make it do anything - I just used echoes as a test.  Also, it may be
better to change the `grep 'Last-Translator'` to `grep 'Language-Team'`,
but I am not sure.

HTH,
-- 
 -----------------------------------------------------------------
|   ,''`.					     Stephen Gran |
|  : :' :					 sgran@debian.org |
|  `. `'			Debian user, admin, and developer |
|    `-					    http://www.debian.org |
 -----------------------------------------------------------------

Attachment: pgpo4Uisvzcu_.pgp
Description: PGP signature


Reply to: