[PATCH 0/7] Document translation with po4a.

DORMANTno replies

9 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH 0/7] Document translation with po4a.

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

1 Document translation with po4a. 
---------------------------------
I tried to translate Docmentation with po4a.
Please relive my translation flow.

1.1 prepareration 
==================
$ install po4a
$ git am 0001-Add-new-target-pot-in-Makefile.patch
$ git am 0002-add-make-shell-scripts.patch
$ cd Documentation
$ make pot    # convert .txt to .pot  with po4a-gettexize

1.2 new translation 
====================
$ mkdir ja
$ cp git-stage.pot ja/git-stage.po
  -> 0003-cp-git-stage.pot-ja-git-stage.po.patch
$ cd ja
$  translate .po by hand ...
  -> 0004-translate-ja-git-stage.po.patch
$ ../make_txt    # convert .po  to .txt  with po4a-translate
$ ../make_html   # convert .txt to .html with asciidoc

1.3 update translation 
=======================
$ git-stage.txt was updated.
  -> 0005-your-file.patch
$ cd Documentation/ja
$ ../make_update # update(merge) .po     with po4a-updatepo
  -> 0006-update-git-stage.po.patch
$ translate and remove fuzzy
  -> 0007-translate-and-remove-fazzy.patch
$ ../make_txt
$ ../make_html

=======================
Osamu OKANO (7):
  Add new target pot in Makefile
  add make(shell) scripts
  cp git-stage.pot ja/git-stage.po
  translate ja/git-stage.po
  your file
  update git-stage.po
  translate and remove fazzy

 Documentation/.gitignore      |    1 +
 Documentation/Makefile        |   15 ++++++++-
 Documentation/git-stage.txt   |    2 +-
 Documentation/ja/git-stage.po |   74 +++++++++++++++++++++++++++++++++++++++++
 Documentation/make_html       |   10 +++++
 Documentation/make_txt        |   13 +++++++
 Documentation/make_update     |   13 +++++++
 7 files changed, 126 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/ja/git-stage.po
 create mode 100644 Documentation/make_html
 create mode 100644 Documentation/make_txt
 create mode 100644 Documentation/make_update

-- 
1.7.5.1.169.g505a1.dirty

[PATCH 2/7] add make(shell) scripts

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

---
 Documentation/make_html   |   10 ++++++++++
 Documentation/make_txt    |   13 +++++++++++++
 Documentation/make_update |   13 +++++++++++++
 3 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/make_html
 create mode 100644 Documentation/make_txt
 create mode 100644 Documentation/make_update
diff --git a/Documentation/make_html b/Documentation/make_html
new file mode 100644
index 0000000..cbd0a69
--- /dev/null
+++ b/Documentation/make_html
@@ -0,0 +1,10 @@
+#!/bin/sh
+for t in *.txt
+do
+  asciidoc \
+  -b xhtml11 \
+  -d manpage \
+  -f ../asciidoc.conf \
+  -o `basename $t .txt`.html \
+  $t
+done
diff --git a/Documentation/make_txt b/Documentation/make_txt
new file mode 100644
index 0000000..8fd6ab7
--- /dev/null
+++ b/Documentation/make_txt
@@ -0,0 +1,13 @@
+#!/bin/sh
+for t in *.po
+do
+  po4a-translate \
+  --keep 0 \
+  --format text \
+  --option asciidoc \
+  --master-charset UTF8 \
+  --localized-charset UTF8 \
+  --master ../`basename $t .po`.txt \
+  --po $t \
+  --localized `basename $t .po`.txt
+done
diff --git a/Documentation/make_update b/Documentation/make_update
new file mode 100644
index 0000000..59322d2
--- /dev/null
+++ b/Documentation/make_update
@@ -0,0 +1,13 @@
+#!/bin/sh
+for t in *.po
+do
+  lang=`basename $PWD`
+  cd ..
+  po4a-updatepo \
+  --master-charset UTF8 \
+  --format text \
+  --master `basename $t .po`.txt \
+  --po $lang/$t \
+  --option asciidoc
+  cd $lang
+done
-- 
1.7.5.1.169.g505a1.dirty

[PATCH 1/7] Add new target pot in Makefile

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

---
 Documentation/.gitignore |    1 +
 Documentation/Makefile   |   15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 1c3a9fe..0d8dc2e 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -3,6 +3,7 @@
 *.[1-8]
 *.made
 *.texi
+*.pot
 git.info
 gitman.info
 howto-index.txt
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 36989b7..ac97d5f 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -11,6 +11,7 @@ MAN7_TXT=gitcli.txt gittutorial.txt gittutorial-2.txt \
 MAN_TXT = $(MAN1_TXT) $(MAN5_TXT) $(MAN7_TXT)
 MAN_XML=$(patsubst %.txt,%.xml,$(MAN_TXT))
 MAN_HTML=$(patsubst %.txt,%.html,$(MAN_TXT))
+MAN_POT=$(patsubst %.txt,%.pot,$(MAN_TXT))
 
 DOC_HTML=$(MAN_HTML)
 
@@ -41,6 +42,7 @@ man7dir=$(mandir)/man7
 # DESTDIR=
 
 ASCIIDOC=asciidoc
+PO4AG=po4a-gettextize
 ASCIIDOC_EXTRA =
 MANPAGE_XSL = manpage-normal.xsl
 XMLTO_EXTRA =
@@ -151,6 +153,7 @@ ifndef V
 	QUIET_SUBDIR0	= +@subdir=
 	QUIET_SUBDIR1	= ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
 			  $(MAKE) $(PRINT_DIR) -C $$subdir
+	QUIET_PO4AG	= @echo '   ' PO4AG $@;
 	export V
 endif
 endif
@@ -166,6 +169,8 @@ man1: $(DOC_MAN1)
 man5: $(DOC_MAN5)
 man7: $(DOC_MAN7)
 
+pot: $(MAN_POT)
+
 info: git.info gitman.info
 
 pdf: user-manual.pdf
@@ -230,7 +235,7 @@ cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
 	date >$@
 
 clean:
-	$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
+	$(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7 *.pot
 	$(RM) *.texi *.texi+ *.texi++ git.info gitman.info
 	$(RM) howto-index.txt howto/*.html doc.dep
 	$(RM) technical/api-*.html technical/api-index.txt
@@ -256,6 +261,14 @@ manpage-base-url.xsl: manpage-base-url.xsl.in
 		$(ASCIIDOC_EXTRA) -agit_version=$(GIT_VERSION) -o $@+ $< && \
 	mv $@+ $@
 
+%.pot : %.txt
+	$(QUIET_PO4AG)$(RM) $@+ $@ && \
+	$(PO4AG) --master-charset UTF8 --localized-charset UTF8 \
+		--master `basename $@ .pot`.txt \
+		--format text --option asciidoc \
+		--po $@+ $< && \
+	mv $@+ $@
+
 user-manual.xml: user-manual.txt user-manual.conf
 	$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
 	$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book -o $@+ $< && \
-- 
1.7.5.1.169.g505a1.dirty

[PATCH 3/7] cp git-stage.pot ja/git-stage.po

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

---
 Documentation/ja/git-stage.po |   71 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 71 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ja/git-stage.po
diff --git a/Documentation/ja/git-stage.po b/Documentation/ja/git-stage.po
new file mode 100644
index 0000000..18c057f
--- /dev/null
+++ b/Documentation/ja/git-stage.po
@@ -0,0 +1,71 @@
+# SOME DESCRIPTIVE TITLE
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2011-05-13 11:06+0900\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. type: Plain text
+#: git-stage.txt:2
+msgid "git-stage(1)"
+msgstr ""
+
+#. type: Title -
+#: git-stage.txt:5
+#, no-wrap
+msgid "NAME\n"
+msgstr ""
+
+#. type: delimited block =
+#: git-stage.txt:7
+msgid "git-stage - Add file contents to the staging area"
+msgstr ""
+
+#. type: Title -
+#: git-stage.txt:10
+#, no-wrap
+msgid "SYNOPSIS\n"
+msgstr ""
+
+#. type: delimited block =
+#: git-stage.txt:13
+#, no-wrap
+msgid "'git stage' args...\n"
+msgstr ""
+
+#. type: Title -
+#: git-stage.txt:16
+#, no-wrap
+msgid "DESCRIPTION\n"
+msgstr ""
+
+#. type: delimited block =
+#: git-stage.txt:20
+msgid ""
+"This is a synonym for linkgit:git-add[1].  Please refer to the documentation "
+"of that command."
+msgstr ""
+
+#. type: delimited block =
+#: git-stage.txt:22
+#, no-wrap
+msgid ""
+"GIT\n"
+"---\n"
+msgstr ""
+
+#. type: delimited block =
+#: git-stage.txt:23
+msgid "Part of the linkgit:git[1] suite"
+msgstr ""
-- 
1.7.5.1.169.g505a1.dirty

[PATCH 6/7] update git-stage.po

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

---
 Documentation/ja/git-stage.po |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/Documentation/ja/git-stage.po b/Documentation/ja/git-stage.po
index e464a06..697b411 100644
--- a/Documentation/ja/git-stage.po
+++ b/Documentation/ja/git-stage.po
@@ -4,15 +4,16 @@
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
 msgid ""
-msgstr "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2011-05-12 11:34+0900\n"
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2011-05-13 11:18+0900\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
+"Language: \n"
 
 #. type: Plain text
 #: git-stage.txt:2
@@ -27,7 +28,8 @@ msgstr "NAME\n"
 
 #. type: delimited block =
 #: git-stage.txt:7
-msgid "git-stage - Add file contents to the staging area"
+#, fuzzy
+msgid "git-stage - Add your file contents to the staging area"
 msgstr "git-stage - ファイルコンテンツをステージングエリアに追加する"
 
 #. type: Title -
@@ -53,7 +55,9 @@ msgstr "DESCRIPTION\n"
 msgid ""
 "This is a synonym for linkgit:git-add[1].  Please refer to the documentation "
 "of that command."
-msgstr "これは linkgit:git-add[1] の同義語です.  git-add のドキュメントを参照してください."
+msgstr ""
+"これは linkgit:git-add[1] の同義語です.  git-add のドキュメントを参照してくだ"
+"さい."
 
 #. type: delimited block =
 #: git-stage.txt:22
-- 
1.7.5.1.169.g505a1.dirty

[PATCH 4/7] translate ja/git-stage.po

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

---
 Documentation/ja/git-stage.po |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Documentation/ja/git-stage.po b/Documentation/ja/git-stage.po
index 18c057f..e464a06 100644
--- a/Documentation/ja/git-stage.po
+++ b/Documentation/ja/git-stage.po
@@ -3,59 +3,57 @@
 # This file is distributed under the same license as the PACKAGE package.
 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
 #
-#, fuzzy
 msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2011-05-13 11:06+0900\n"
+msgstr "Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2011-05-12 11:34+0900\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "Language: \n"
 "MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
 #. type: Plain text
 #: git-stage.txt:2
 msgid "git-stage(1)"
-msgstr ""
+msgstr "git-stage(1)"
 
 #. type: Title -
 #: git-stage.txt:5
 #, no-wrap
 msgid "NAME\n"
-msgstr ""
+msgstr "NAME\n"
 
 #. type: delimited block =
 #: git-stage.txt:7
 msgid "git-stage - Add file contents to the staging area"
-msgstr ""
+msgstr "git-stage - ファイルコンテンツをステージングエリアに追加する"
 
 #. type: Title -
 #: git-stage.txt:10
 #, no-wrap
 msgid "SYNOPSIS\n"
-msgstr ""
+msgstr "SYNOPSIS\n"
 
 #. type: delimited block =
 #: git-stage.txt:13
 #, no-wrap
 msgid "'git stage' args...\n"
-msgstr ""
+msgstr "'git stage' 引数...\n"
 
 #. type: Title -
 #: git-stage.txt:16
 #, no-wrap
 msgid "DESCRIPTION\n"
-msgstr ""
+msgstr "DESCRIPTION\n"
 
 #. type: delimited block =
 #: git-stage.txt:20
 msgid ""
 "This is a synonym for linkgit:git-add[1].  Please refer to the documentation "
 "of that command."
-msgstr ""
+msgstr "これは linkgit:git-add[1] の同義語です.  git-add のドキュメントを参照してください."
 
 #. type: delimited block =
 #: git-stage.txt:22
@@ -64,8 +62,10 @@ msgid ""
 "GIT\n"
 "---\n"
 msgstr ""
+"GIT\n"
+"---\n"
 
 #. type: delimited block =
 #: git-stage.txt:23
 msgid "Part of the linkgit:git[1] suite"
-msgstr ""
+msgstr "この文書は linkgit:git[1] の一部です"
-- 
1.7.5.1.169.g505a1.dirty

[PATCH 7/7] translate and remove fazzy

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

---
 Documentation/ja/git-stage.po |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Documentation/ja/git-stage.po b/Documentation/ja/git-stage.po
index 697b411..cf45291 100644
--- a/Documentation/ja/git-stage.po
+++ b/Documentation/ja/git-stage.po
@@ -28,9 +28,8 @@ msgstr "NAME\n"
 
 #. type: delimited block =
 #: git-stage.txt:7
-#, fuzzy
 msgid "git-stage - Add your file contents to the staging area"
-msgstr "git-stage - ファイルコンテンツをステージングエリアに追加する"
+msgstr "git-stage - あなたのファイルコンテンツをステージングエリアに追加する"
 
 #. type: Title -
 #: git-stage.txt:10
-- 
1.7.5.1.169.g505a1.dirty

[PATCH 5/7] your file

From: Osamu OKANO <hidden>
Date: 2016-06-15 22:51:14

---
 Documentation/git-stage.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-stage.txt b/Documentation/git-stage.txt
index ba3fe0d..8fcb93c 100644
--- a/Documentation/git-stage.txt
+++ b/Documentation/git-stage.txt
@@ -3,7 +3,7 @@ git-stage(1)
 
 NAME
 ----
-git-stage - Add file contents to the staging area
+git-stage - Add your file contents to the staging area
 
 
 SYNOPSIS
-- 
1.7.5.1.169.g505a1.dirty

Re: [PATCH 5/7] your file

From: Drew Northup <hidden>
Date: 2016-06-15 22:51:14

On Fri, 2011-05-13 at 22:14 +0900, Osamu OKANO wrote:
quoted hunk
---
 Documentation/git-stage.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-stage.txt b/Documentation/git-stage.txt
index ba3fe0d..8fcb93c 100644
--- a/Documentation/git-stage.txt
+++ b/Documentation/git-stage.txt
@@ -3,7 +3,7 @@ git-stage(1)
 
 NAME
 ----
-git-stage - Add file contents to the staging area
+git-stage - Add your file contents to the staging area
Is the demarcation of file ownership (the audience) required in the
translation? I suspect that the English original was left vague on that
point for a reason (the file could be yours, his, hers, or its). If a
change in the demarcation of the audience is required in the translation
I suggest doing such changes there and leaving the source text intact as
different natural languages approach this matter differently. 
As an example, some languages require that the text be reworded
literally to: "Add the contents of the file to the staging area" as it
stands, being rather different from "Add the contents of the file
of/from [belonging to] you to the staging area"; there is advantage to
leaving this text as-is.

-- 
-Drew Northup
________________________________________________
"As opposed to vegetable or mineral error?"
-John Pescatore, SANS NewsBites Vol. 12 Num. 59
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help