From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Lepiller Subject: Re: [WIP]: localize guix.texi Date: Mon, 19 Feb 2018 23:45:03 +0100 Message-ID: <20180219234503.4091f68f@lepiller.eu> References: <20180219233437.4d709181@lepiller.eu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/.YJFMPpudLd6876UUV7/aGM" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enuBP-0007An-PF for guix-devel@gnu.org; Mon, 19 Feb 2018 17:45:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enuBL-00074Q-5T for guix-devel@gnu.org; Mon, 19 Feb 2018 17:45:15 -0500 Received: from lepiller.eu ([89.234.186.109]:42062) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enuBK-00072d-Qe for guix-devel@gnu.org; Mon, 19 Feb 2018 17:45:11 -0500 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by lepiller.eu (OpenSMTPD) with ESMTPSA id 10b3bec3 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 19 Feb 2018 22:46:31 +0000 (UTC) In-Reply-To: <20180219233437.4d709181@lepiller.eu> 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: guix-devel@gnu.org --MP_/.YJFMPpudLd6876UUV7/aGM Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Mon, 19 Feb 2018 23:34:37 +0100, Julien Lepiller a =C3=A9crit : > Hi, >=20 > here is my first attempt at localizing guix.texi. This patch adds > guix.fr.texi, a localized version of the manual. It uses po4a to > generate the .po file and use that same file to generate the localized > manual. >=20 > I had to include the guix.fr.texi in the commit because it is > necessary that it exists in order to add it to info_TEXINFOS. This > means that this version of guix now requires po4a and will always > build the localized manuals in every available language. I don't > really like that though. >=20 > I had to add a rule in Makefile.am without which guix.fr.info wouldn't > be built. Similar rules are required for generating the html and pdf > versions. >=20 > thoughts? I forgot the patch, here it is. I removed guix.fr.texi and fr.po from the patch as they are ~1MB each. --MP_/.YJFMPpudLd6876UUV7/aGM Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-doc-Allow-documentation-to-be-translated.patch =46rom 7443ce7407a7194a9d9487f95f940b4b9adf5d82 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Mon, 19 Feb 2018 23:24:30 +0100 Subject: [PATCH] doc: Allow documentation to be translated. po/doc/local.mk: New file. Makefile.am: Include it. doc/local.mk (info_TEXINFOS, BUILT_SOURCES, EXTRA_DIST, MAINTAINERCLEANFILE= S): Add guix.fr.texi (rules): New rule to build localized texi files .gitignore: Ignore doc/version.*.texi --- .gitignore | 1 + Makefile.am | 3 +++ doc/local.mk | 21 +++++++++++++++++---- po/doc/local.mk | 23 +++++++++++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 po/doc/local.mk diff --git a/.gitignore b/.gitignore index 4a110fb1f..f4119bc28 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ /doc/os-config-desktop.texi /doc/stamp-vti /doc/version.texi +/doc/version.*.texi /etc/guix-daemon.cil /etc/guix-daemon.conf /etc/guix-daemon.service diff --git a/Makefile.am b/Makefile.am index e2c940ca8..856075e7a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -41,6 +41,8 @@ scripts/guix: scripts/guix.in Makefile $(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t" $(AM_V_at)chmod a+x,a-w "$@-t" && mv -f "$@-t" "$@" =20 +doc/guix.fr.info: doc/guix.fr.texi + nodist_noinst_SCRIPTS =3D \ pre-inst-env \ test-env @@ -535,6 +537,7 @@ SUBDIRS =3D po/guix po/packages BUILT_SOURCES =3D =20 include doc/local.mk +include po/doc/local.mk =20 if BUILD_DAEMON =20 diff --git a/doc/local.mk b/doc/local.mk index 397ade050..f8aa31d5a 100644 --- a/doc/local.mk +++ b/doc/local.mk @@ -20,7 +20,8 @@ # You should have received a copy of the GNU General Public License # along with GNU Guix. If not, see . =20 -info_TEXINFOS =3D %D%/guix.texi +info_TEXINFOS =3D %D%/guix.texi \ + %D%/guix.fr.texi =20 %C%_guix_TEXINFOS =3D \ %D%/contributing.texi \ @@ -51,10 +52,22 @@ OS_CONFIG_EXAMPLES_TEXI =3D \ %D%/os-config-desktop.texi \ %D%/os-config-lightweight-desktop.texi =20 +TRANSLATED_INFO =3D \ + %D%/guix.fr.texi + # Bundle this file so that makeinfo finds it in out-of-source-tree builds. -BUILT_SOURCES +=3D $(OS_CONFIG_EXAMPLES_TEXI) -EXTRA_DIST +=3D $(OS_CONFIG_EXAMPLES_TEXI) -MAINTAINERCLEANFILES =3D $(OS_CONFIG_EXAMPLES_TEXI) +BUILT_SOURCES +=3D $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) +EXTRA_DIST +=3D $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) +MAINTAINERCLEANFILES =3D $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) + +PO4A_PARAMS:=3D-M UTF-8 -L UTF-8 #master and localized encoding +PO4A_PARAMS+=3D-k 0 # produce an output even if the translation is not com= plete +PO4A_PARAMS+=3D-f texinfo # texinfo format + +$(srcdir)/%D%/guix.%.texi: %D%/guix.texi po/doc/%.po + po4a-translate $(PO4A_PARAMS) -m $< -p $(word 2,$^) -l $@.tmp + sed -i 's|guix\.info|guix.fr.info|' $@.tmp + mv $@.tmp $@ =20 %D%/os-config-%.texi: gnu/system/examples/%.tmpl $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ diff --git a/po/doc/local.mk b/po/doc/local.mk new file mode 100644 index 000000000..84d43123d --- /dev/null +++ b/po/doc/local.mk @@ -0,0 +1,23 @@ +# GNU Guix --- Functional package management for GNU +# Copyright =C2=A9 2018 Julien Lepiller +# +# This file is part of GNU Guix. +# +# GNU Guix is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNU Guix is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Guix. If not, see . + +EXTRA_DIST +=3D \ + %D%/fr.po + +$(srcdir)/po/doc/%.po: doc/guix.texi + po4a-updatepo -M UTF-8 -f texinfo -m $< -p $@ --=20 2.16.1 --MP_/.YJFMPpudLd6876UUV7/aGM--