From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Lepiller Subject: Re: Translation of the Guix manual & node names Date: Tue, 23 Apr 2019 23:59:00 +0200 Message-ID: <20190423235900.480eada2@sybil.lepiller.eu> References: <87sgu8hmmr.fsf@gnu.org> <20190423155219.03d067f5@sybil.lepiller.eu> <20190423234813.4d270de2@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/6LKondV0DsvOb49ewQImj/x" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:45990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJ3SB-0000vU-D1 for guix-devel@gnu.org; Tue, 23 Apr 2019 17:59:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJ3S7-0007Vz-Kc for guix-devel@gnu.org; Tue, 23 Apr 2019 17:59:50 -0400 In-Reply-To: <20190423234813.4d270de2@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Miguel Cc: Guix-devel --MP_/6LKondV0DsvOb49ewQImj/x Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Tue, 23 Apr 2019 23:48:13 +0200, Miguel a =C3=A9crit : > El Tue, 23 Apr 2019 15:52:19 +0200 > Julien Lepiller escribi=C3=B3: > > Le Tue, 23 Apr 2019 15:33:32 +0200, > > Ludovic Court=C3=A8s a =C3=A9crit : > > =20 > > > Hello Miguel & Meiyo, =20 >=20 > Hi! >=20 > > > Thanks a lot for your translations of the Guix manual! =20 >=20 > Thank you too for your effort and kindness. >=20 > > > (...) > > > If we look at these, you both translated, for example, the > > > =E2=80=9CPackaging Guidelines=E2=80=9D string. However, you also lef= t, in your > > > translations, things like =E2=80=9C@pxref{Packaging Guidelines}=E2=80= =9D. > > > (...) =20 > > No, we have a small script that takes care of this. As long as the > > node name is translated somewhere near the beginning of the file, it > > is also automatically translated in the rest of the file. So that > > shouldn't cause an issue. Maybe there's an error in the script? > >=20 > > Look at xref_command in doc/local.mk > > > > Also look at fr.po, I haven't translated most of the node names. =20 >=20 > It took me some time getting that, by example from fr.po, of course, > but I think there are some errors or warnings related when you do it > wrong. AFAIK the only problem are some @ref or @xref entries that > contain the link and some text, that actually must be translated. I > have to double check them this week on the translation. >=20 > > > Could you please translate all the node names, and make sure that > > > all the cross-reference commands use the same names? (The plan is > > > to release Guix 1.0 in one week, so it would be great if you could > > > send an updated PO file by then!) =20 >=20 > I hope having more than only the node names this week. Pretty sure it > won't be the full translation, but I hope reaching 70% at least for > 1.0. We'll see... The attached python script (it requires python and python-polib) might get you closer by automatically translating some very common strings. So you have to change these lines: regexps.append([re.compile('English regexp'), 'Translate string']) #1, #2 etc. are replaced by the content of the matches in the English regexp. I don't know if you'll use it, but I hope it will be of some help to you. Good luck with the translation! >=20 > Happy hacking, > Miguel --MP_/6LKondV0DsvOb49ewQImj/x Content-Type: text/x-python Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=templatetranslator.py #!/usr/bin/python3 # -*- coding: utf-8 -*- # Template Translator v0.1 # Traduit automatiquement certaines chaine de caract=C3=A8res des paquets # Publi=C3=A9 par roptat le 8 ao=C3=BBt 2016 # sous la licence gnu General Public License version 3 pubil=C3=A9e par = la Free Software Foundation. # Visitez pour obtenir la licence. import sys import re import polib files =3D sys.argv files.pop(0) def convert(entry, regexp, template): m =3D regexp.match(entry.msgid) # do not modify anything if the translation is already correct if m and ("fuzzy" in entry.flags or not entry.msgstr): msgstr =3D template try: msgstr =3D msgstr.replace("#1", m.group(1)) msgstr =3D msgstr.replace('#2', m.group(2)) msgstr =3D msgstr.replace('#3', m.group(3)) msgstr =3D msgstr.replace('#4', m.group(4)) except: x=3D1 entry.msgstr =3D msgstr if "fuzzy" in entry.flags: entry.flags.remove("fuzzy") # regexps regexps =3D [] regexps.append([re.compile('{Scheme Procedure} (.*)$'), '{Proc=C3=A9dure Sc= heme} #1']) regexps.append([re.compile('{Scheme Variable} (.*)$'), '{Variable Scheme} #= 1']) regexps.append([re.compile('{Data Type} (.*)$'), '{Type de donn=C3=A9es} #1= ']) regexps.append([re.compile('@code{([^}]*)} \\(default:? #t\\)$'), '@code{#1} (par d=C3=A9faut : #t)']) regexps.append([re.compile('@code{([^}]*)} \\(default:? ([0-9]*)\\)$'), '@code{#1} (par d=C3=A9faut : #2)']) regexps.append([re.compile('@code{([^}]*)} \\(default:? @code{([^}]*)}\\)$'= ), '@code{#1} (par d=C3=A9faut : @code{#2})']) regexps.append([re.compile('@code{([^}]*)} \\(default:? @var{([^}]*)}\\)$'), '@code{#1} (par d=C3=A9faut : @var{#2})']) regexps.append([re.compile('@code{([^}]*)} \\(default:? "([^"]*)"\\)$'), '@code{#1} (par d=C3=A9faut : "#2")']) regexps.append([re.compile('{@code{([^}]*)} parameter} ([^ ]*) ([^ ]*)$'), = '{param=C3=A8tre de @code{#1}} #2 #3']) regexps.append([re.compile('The ([^ ]*) package to use.$'), 'Le paquet #1 = =C3=A0 utiliser.']) regexps.append([re.compile('Defaults to @samp{([^}]*)}.$'), 'La valeur par = d=C3=A9faut est @samp{#1}.']) regexps.append([re.compile('Available @code{(.*)} fields are:$'), 'Les cham= ps de @code{#1} disponibles sont :']) po =3D polib.pofile(files[0]) for entry in po: for reg in regexps: convert(entry, reg[0], reg[1]) po.save() --MP_/6LKondV0DsvOb49ewQImj/x--