<div dir="ltr"><br><div class="gmail_extra">Hi Martin.<br><br><div class="gmail_quote">2013/5/23 Martin Geisler <span dir="ltr"><<a href="mailto:martin@geisler.net" target="_blank">martin@geisler.net</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Takumi IINO <<a href="mailto:trot.thunder@gmail.com">trot.thunder@gmail.com</a>> writes:<br>
<br>
Hi Takumi,<br>
<div class="im"><br>
> This patch series aim is make i18n man and html.<br>
<br>
</div>Thanks for working on this! I'm really bad at taking time for Mercurial<br>
work these days, but I wanted to reply since I once played with the same<br>
idea... I've just updated my old patch to make it work with the default<br>
branch. The version seems to work.<br></blockquote><div><br></div><div style>I applied your patch and tried to generate translated html with GNU Make 3.81 on mac os x 10.8.3,</div><div><div>but I could not generate html:</div>
<div><br></div><div><div>  % hg log -r qparent --template "{node}\n"</div><div>  865beb8497208ee8e719c939035a6bb5cd9238fc</div></div><div style>  % LANGUAGE=da make clean all 2>&1 | tail</div><div><div>  python runrst hgmanpage  --halt warning \</div>
<div>            --strip-elements-with-class htmlonly hgrc.5.txt hgrc.5</div><div>  python runrst html  --halt warning \</div><div>            --link-stylesheet --stylesheet-path style.css hg.1.txt hg.1.html</div><div>  python runrst html  --halt warning \</div>
<div>            --link-stylesheet --stylesheet-path style.css hgignore.5.txt hgignore.5.html</div><div>  python runrst html  --halt warning \</div><div>            --link-stylesheet --stylesheet-path style.css hgrc.5.txt hgrc.5.html</div>
<div>  make[1]: *** No rule to make target `hg.1.da.html', needed by `html'.  Stop.</div><div>  make: *** [doc] Error 2</div></div></div><div><br></div><div style>i have a mistake or use older version?</div><div><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I think it is simpler than your patch series, but maybe my patch is<br>
missing something? Could you take a look at it and see if it produces<br>
okay output for you?<br></blockquote><div><br></div><div>HTML, which is translated in Japanese partially exists.<br></div><div><div><br></div><div>- <a href="http://mercurial.selenic.com/wiki/TranslatedManPages">http://mercurial.selenic.com/wiki/TranslatedManPages</a></div>
</div><div><br></div><div>The goal is to translate all.<br></div><div><br></div><div>I seem your patch dose not output translation of these files as html:</div><div style><div><br></div><div>- doc/common.txt </div><div>- content of doc/hgignore.5.txt (mercurial/help/hgignore.txt)</div>
<div>- content of doc/hgrc.5.txt (mercurial/help/config.txt)</div><div><br></div><div style>Regards.</div></div><div style> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
The ignore file needs to be updated and I think the Makefile can be<br>
further improved -- there is a hard-coded list of locales to generate<br>
and there is some redundancy with the patch below. But it was just a<br>
quick attempt :)<br>
<br>
Btw, the extra newlines after the ..note directives were needed to make<br>
Docutils like the input. I forget the details, but I seem to recall that<br>
this changed between Docutils versions, i.e., that a newer version<br>
required the newline.<br>
<br>
<br>
# HG changeset patch<br>
# User Martin Geisler <<a href="mailto:martin@geisler.net">martin@geisler.net</a>><br>
# Date 1369259619 -7200<br>
#      Wed May 22 23:53:39 2013 +0200<br>
# Node ID f225f9e1316fff783d06a837c497a06cf56b8c0c<br>
# Parent  0ec31231afad3fc171f882226aae50d4737559b5<br>
[mq]: translate-manpages<br>
<br>
diff --git a/Makefile b/Makefile<br>
--- a/Makefile<br>
+++ b/Makefile<br>
@@ -9,7 +9,7 @@<br>
 PYTHON=python<br>
 PURE=<br>
 PYFILES:=$(shell find mercurial hgext doc -name '*.py')<br>
-DOCFILES=mercurial/help/*.txt<br>
+DOCFILES=mercurial/help/*.txt doc/hg.1.txt doc/hgignore.5.txt doc/hgrc.5.txt<br>
<br>
 # Set this to e.g. "mingw32" to use a non-default compiler.<br>
 COMPILER=<br>
diff --git a/doc/Makefile b/doc/Makefile<br>
--- a/doc/Makefile<br>
+++ b/doc/Makefile<br>
@@ -7,16 +7,16 @@<br>
 MANDIR=$(PREFIX)/share/man<br>
 INSTALL=install -c -m 644<br>
 PYTHON=python<br>
+LOCALES=da<br>
 RSTARGS=<br>
<br>
-export LANGUAGE=C<br>
-export LC_ALL=C<br>
+export HGENCODING=UTF-8<br>
<br>
 all: man html<br>
<br>
 man: $(MAN)<br>
<br>
-html: $(HTML)<br>
+html: $(HTML) $(foreach lang,$(LOCALES),$(HTML:%.html=%.$(lang).html))<br>
<br>
 hg.1.txt: hg.1.gendoc.txt<br>
        touch hg.1.txt<br>
@@ -29,6 +29,19 @@<br>
<br>
 hgrc.5.html: ../mercurial/help/config.txt<br>
<br>
+hg.1.%.txt: hg.1.gendoc.txt ../i18n/%.po $(GENDOC)<br>
+       LANGUAGE=$* ${PYTHON} gendoc.py > hg.1.gendoc.txt<br>
+       LANGUAGE=$* $(PYTHON) translate.py < hg.1.txt > $@<br>
+<br>
+hgignore.5.%.txt: hgignore.5.txt<br>
+       LANGUAGE=$* $(PYTHON) translate.py < $< > $@<br>
+<br>
+hgrc.5.%.txt: hgrc.5.txt<br>
+       LANGUAGE=$* $(PYTHON) translate.py < $< > $@<br>
+<br>
+hg.5.%.txt: hg.5.txt<br>
+       LANGUAGE=$* $(PYTHON) translate.py < $< > $@<br>
+<br>
 %: %.txt common.txt<br>
        $(PYTHON) runrst hgmanpage $(RSTARGS) --halt warning \<br>
          --strip-elements-with-class htmlonly $*.txt $*<br>
diff --git a/doc/gendoc.py b/doc/gendoc.py<br>
--- a/doc/gendoc.py<br>
+++ b/doc/gendoc.py<br>
@@ -7,7 +7,7 @@<br>
 from mercurial import encoding<br>
 from mercurial import minirst<br>
 from mercurial.commands import table, globalopts<br>
-from mercurial.i18n import _<br>
+from mercurial.i18n import _, gettext<br>
 from mercurial.help import helptable<br>
 from mercurial import extensions<br>
 from mercurial import util<br>
@@ -16,6 +16,7 @@<br>
     if not docstr:<br>
         return "", ""<br>
     # sanitize<br>
+    docstr = gettext(docstr)<br>
     docstr = docstr.strip("\n")<br>
     docstr = docstr.rstrip()<br>
     shortdesc = docstr.splitlines()[0].strip()<br>
diff --git a/doc/translate.py b/doc/translate.py<br>
new file mode 100644<br>
--- /dev/null<br>
+++ b/doc/translate.py<br>
@@ -0,0 +1,6 @@<br>
+<br>
+import sys<br>
+from mercurial.i18n import gettext<br>
+<br>
+if __name__ == "__main__":<br>
+    sys.stdout.write(gettext(sys.stdin.read()))<br>
diff --git a/i18n/da.po b/i18n/da.po<br>
--- a/i18n/da.po<br>
+++ b/i18n/da.po<br>
@@ -11990,7 +11990,7 @@<br>
 msgstr "Datoformater"<br>
<br>
 msgid "File Name Patterns"<br>
-msgstr "Mønstre for filnavne"<br>
+msgstr ""<br>
<br>
 msgid "Environment Variables"<br>
 msgstr "Miljøvariable"<br>
diff --git a/mercurial/commands.py b/mercurial/commands.py<br>
--- a/mercurial/commands.py<br>
+++ b/mercurial/commands.py<br>
@@ -396,6 +396,7 @@<br>
     changes and the merged result is left uncommitted.<br>
<br>
     .. note::<br>
+<br>
       backout cannot be used to fix either an unwanted or<br>
       incorrect merge.<br>
<br>
@@ -933,6 +934,7 @@<br>
     """set or show the current branch name<br>
<br>
     .. note::<br>
+<br>
        Branch names are permanent and global. Use :hg:`bookmark` to create a<br>
        light-weight bookmark instead. See :hg:`help glossary` for more<br>
        information about named branches and bookmarks.<br>
@@ -2675,6 +2677,7 @@<br>
     Differences between files are shown using the unified diff format.<br>
<br>
     .. note::<br>
+<br>
        diff may generate unexpected results for merges, as it will<br>
        default to comparing against the working directory's first<br>
        parent changeset if no revisions are specified.<br>
@@ -2764,6 +2767,7 @@<br>
     comment.<br>
<br>
     .. note::<br>
+<br>
        export may generate unexpected diff output for merge<br>
        changesets, as it will compare the merge changeset against its<br>
        first parent only.<br>
@@ -2896,6 +2900,7 @@<br>
     continued with the -c/--continue option.<br>
<br>
     .. note::<br>
+<br>
       The -c/--continue option does not reapply earlier options.<br>
<br>
     .. container:: verbose<br>
@@ -3944,12 +3949,14 @@<br>
     changed files and full commit message are shown.<br>
<br>
     .. note::<br>
+<br>
        log -p/--patch may generate unexpected diff output for merge<br>
        changesets, as it will only compare the merge changeset against<br>
        its first parent. Also, only files different from BOTH parents<br>
        will appear in files:.<br>
<br>
     .. note::<br>
+<br>
        for performance reasons, log FILE may omit duplicate changes<br>
        made on branches and will not show deletions. To see all<br>
        changes including duplicates and deletions, use the --removed<br>
@@ -4934,6 +4941,7 @@<br>
     """restore files to their checkout state<br>
<br>
     .. note::<br>
+<br>
        To check out earlier revisions, you should use :hg:`update REV`.<br>
        To cancel an uncommitted merge (and lose your changes), use<br>
        :hg:`update --clean .`.<br>
@@ -5257,6 +5265,7 @@<br>
     unless explicitly requested with -u/--unknown or -i/--ignored.<br>
<br>
     .. note::<br>
+<br>
        status may appear to disagree with diff if permissions have<br>
        changed or a merge has occurred. The standard diff format does<br>
        not report permission changes and diff only reports changes<br>
<span class=""><font color="#888888"><br>
<br>
<br>
<br>
--<br>
Martin Geisler<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Takumi IINO
</div></div>