From: Jean-Noel Avila <jn.avila@free.fr>
To: git@vger.kernel.org
Cc: Jean-Noel Avila <jn.avila@free.fr>
Subject: [PATCH v3 1/2] l10n: Introduce framework for localizing man pages
Date: Mon, 20 Mar 2017 22:02:24 +0100 [thread overview]
Message-ID: <20170320210225.13046-2-jn.avila@free.fr> (raw)
In-Reply-To: <20170320210225.13046-1-jn.avila@free.fr>
Providing git in localized version is a good step for general adoption
of the tool. But as of now, if one needs to refer to the manual pages,
they are still confronted to english. The aim is to provide
documentation to users in their own language.
The translation of the source asciidoc files is managed via po4a
driven by the conf file Documentation/po4a.conf.
Only the manpages are generated and installed by using the
`install-man-l10n` target of the Makefile. The localized manpages for
all the translated languages are installed in the man path in their
own language folder, so that they can be accessed by man.
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
---
Documentation/Makefile | 21 ++++++++++++++++++++-
Documentation/po4a.conf | 5 +++++
2 files changed, 25 insertions(+), 1 deletion(-)
create mode 100644 Documentation/po4a.conf
diff --git a/Documentation/Makefile b/Documentation/Makefile
index b5be2e2d3..e721c7149 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,4 +1,5 @@
# Guard against environment variables
+MAN1_L10N_TXT =
MAN1_TXT =
MAN5_TXT =
MAN7_TXT =
@@ -10,6 +11,7 @@ OBSOLETE_HTML =
MAN1_TXT += $(filter-out \
$(addsuffix .txt, $(ARTICLES) $(SP_ARTICLES)), \
$(wildcard git-*.txt))
+MAN1_L10N_TXT += $(wildcard po/*/man1/git-*.txt)
MAN1_TXT += git.txt
MAN1_TXT += gitk.txt
MAN1_TXT += gitremote-helpers.txt
@@ -86,6 +88,7 @@ DOC_HTML += $(patsubst %,%.html,$(ARTICLES) $(SP_ARTICLES))
DOC_MAN1 = $(patsubst %.txt,%.1,$(MAN1_TXT))
DOC_MAN5 = $(patsubst %.txt,%.5,$(MAN5_TXT))
DOC_MAN7 = $(patsubst %.txt,%.7,$(MAN7_TXT))
+DOC_MAN1_L10N = $(patsubst %.txt,%.1,$(MAN1_L10N_TXT))
prefix ?= $(HOME)
bindir ?= $(prefix)/bin
@@ -209,6 +212,7 @@ endif
ifneq ($(findstring $(MAKEFLAGS),s),s)
ifndef V
+ QUIET_PO4A = @echo ' ' PO4A $@;
QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
QUIET_XMLTO = @echo ' ' XMLTO $@;
QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
@@ -234,6 +238,15 @@ man1: $(DOC_MAN1)
man5: $(DOC_MAN5)
man7: $(DOC_MAN7)
+man_l10n: po4a man1_p_l10n
+po4a: po4a.conf
+ $(QUIET_PO4A)po4a po4a.conf
+
+man1_p_l10n: po4a
+ $(MAKE) man1_l10n
+
+man1_l10n: $(DOC_MAN1_L10N)
+
info: git.info gitman.info
pdf: user-manual.pdf
@@ -247,6 +260,11 @@ install-man: man
$(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
$(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
$(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
+ $(MAKE) install-man-l10n
+
+install-man-l10n: $(DOC_MAN1_L10N)
+ $(INSTALL) -d -m 755 $(DESTDIR)$(mandir)/$(firstword $(subst /man1/, ,$(subst po/,,$<)))/man1
+ $(INSTALL) -m 644 $< $(DESTDIR)$(mandir)$(subst po,,$<)
install-info: info
$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
@@ -323,6 +341,7 @@ clean:
$(RM) technical/*.html technical/api-index.txt
$(RM) $(cmds_txt) $(mergetools_txt) *.made
$(RM) manpage-base-url.xsl
+ $(RM) po/*/*.1 po/*/*.txt
$(MAN_HTML): %.html : %.txt asciidoc.conf
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
@@ -339,7 +358,7 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
%.1 %.5 %.7 : %.xml manpage-base-url.xsl
$(QUIET_XMLTO)$(RM) $@ && \
- $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
+ $(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) -o $(dir $<) man $<
%.xml : %.txt asciidoc.conf
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
diff --git a/Documentation/po4a.conf b/Documentation/po4a.conf
new file mode 100644
index 000000000..b6ee8b4a6
--- /dev/null
+++ b/Documentation/po4a.conf
@@ -0,0 +1,5 @@
+[po4a_langs] fr
+[po4a_paths] po/documentation.pot $lang:po/documentation.$lang.po
+[options] opt: " -k 80"
+
+[type: asciidoc] ./git-add.txt $lang:./po/$lang/man1/git-add.txt
--
2.12.0
next prev parent reply other threads:[~2017-03-20 21:04 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-12 20:02 [PATCH] l10n: add framework for localizing the manpages Jean-Noel Avila
2017-03-12 20:02 ` Jean-Noel Avila
2017-03-12 20:36 ` Jean-Noël AVILA
2017-03-13 0:01 ` Junio C Hamano
2017-03-14 21:00 ` Ævar Arnfjörð Bjarmason
2017-03-14 21:13 ` Junio C Hamano
2017-03-15 8:11 ` Jean-Noël Avila
2017-03-15 9:01 ` Ævar Arnfjörð Bjarmason
2017-03-15 7:58 ` Jean-Noël Avila
2017-03-15 16:07 ` Junio C Hamano
2017-03-15 18:28 ` Stefan Beller
2017-03-18 17:53 ` [PATCH v2 1/2] l10n: Introduce framework for localizing man pages Jean-Noel Avila
2017-03-18 17:53 ` [PATCH v2 2/2] l10n: Add git-add.txt to localized " Jean-Noel Avila
2017-03-18 19:41 ` [PATCH v2 1/2] l10n: Introduce framework for localizing " Junio C Hamano
2017-03-18 22:17 ` Jean-Noël AVILA
2017-03-18 23:03 ` Junio C Hamano
2017-03-20 2:11 ` Junio C Hamano
2017-03-20 8:10 ` Jean-Noël Avila
2017-03-20 8:21 ` Jean-Noël AVILA
2017-03-20 16:50 ` Junio C Hamano
2017-03-20 21:02 ` Rework manpage localisation Jean-Noel Avila
2017-03-20 21:02 ` Jean-Noel Avila [this message]
2017-03-21 18:09 ` [PATCH v3 1/2] l10n: Introduce framework for localizing man pages Junio C Hamano
2017-03-20 21:02 ` [PATCH v3 2/2] l10n: Add git-add.txt to localized " Jean-Noel Avila
2017-03-20 22:05 ` Junio C Hamano
2017-03-22 12:01 ` Jean-Noël Avila
2017-03-22 18:02 ` Junio C Hamano
2017-03-22 18:41 ` Stefan Beller
2017-03-22 18:56 ` Junio C Hamano
2017-03-22 18:59 ` Stefan Beller
2017-03-24 14:21 ` Michael J Gruber
2017-03-25 15:40 ` Jean-Noël AVILA
2017-03-26 22:56 ` Junio C Hamano
2017-03-27 20:12 ` Jean-Noël AVILA
2017-03-27 20:29 ` Junio C Hamano
2017-03-24 15:58 ` Ævar Arnfjörð Bjarmason
2017-03-24 17:57 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170320210225.13046-2-jn.avila@free.fr \
--to=jn.avila@free.fr \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.