git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/7] Document translation with po4a.

From
Junio C Hamano <gitster@pobox.com>
Date
May 13, 2011, 16:48 UTC
Message-ID
<7v39ki8s2r.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1305292458-3920-1-git-send-email-okano.osamu@gmail.com>
Osamu OKANO <okano.osamu@gmail.com> writes:
> 1 Document translation with po4a. 
> ---------------------------------
> I tried to translate Docmentation with po4a.
> Please relive my translation flow.
Thanks for a fun read.

Do I understand correctly that this "patchset" is primarily for you to request comments on, and it is not about adding it literally as "this gives a good framework for documentation i18n and demonstrates l10n with a sample page translated to Japanese"?

I have a few comments on the overall structure.

First of all, I would prefer to have these in "po" subdirectory of Documentation.

Something like:
     Documentation/
                  /Makefile
                  /asciidoc.conf
                  /git-stash.txt
                  /po/ (new directory)
                  /po/.gitignore
                  /po/Makefile
                  /po/pot/git-stash.pot
                  /po/ja/git-stash.po
                  /po/ko/git-stash.po
                  /po/ru/git-stash.po

Then from the end-user's point of view (not from the translators), I would like to see Documentation/po/Makefile that lets me say

	cd Documentation/po && make html man install

which would first create Documentation/po/*/*.txt files using the corresponding .po files and the base documentation, and then run asciidoc to format them into Documentation/po/*/*.{html,[1-8]}, and install them to their final destination (e.g. /usr/share/man/$lang/man[1-8], but it is likely that you have to make it configurable).

When all of the above works solidly, Documentation/Makefile can learn a new rule to make "cd Documentation && make (man|html|install)" would descend to Documentation/po and run a corresponding make there.

Broadly, there are four kinds of things to keep l10n up-to-date.
 - Starting a new documentation page
   . add Documentation/po/pot/$newpage.pot for Documentation/$newpage.txt
   . commit the addition of Documentation/po/pot/$newpage.pot
 - Updating the .pot from documentation
 - Starting a new language
   . create a subdirectory in Documentation/po/$lang
   . copy Documentation/po/*.pot to Documentation/po/$lang/ and translate
   . test with the above "end-user" procedure.
   . commit the addition of Documentation/po/$lang/*.po
 - Updating an existing documentation page
   . edit Documentation/po/$lang/$page.po
   . test with the above "end-user" procedure.
   . commit the resulting Documentation/po/$lang/$page.po
 - Keeping your Documentation/po/$lang/*.pot up-to-date
   . find Documentation/po/pot/$page.pot without Documentation/po/$lang/$page.po
   . update Documentation/po/$lang/*.po from corresponding Documentation/pot/*.pot

We may want to have a rule in Documentation/po/.gitignore to ignore everything except a select few, namely Makefile, pot/*.pot, po/*/*.po, in order to avoid mistakes.

We also may want to have targets in Documentation/po/Makefile to help the translators carrying out the above set of tasks. "make lang=ja update" may do the following (just thinking aloud):

 - create Documentation/po/$(lang)/, if the directory does not exist.
 - for all Documentation/po/pot/%.pot,
   . if Documentation/po/$(lang)/%.po does not exist, copy po/pot/%.pot to
     po/$(lang)/%.po, and optionally "git add -N" the latter
   . otherwise, update po/$(lang)/%.po with po/pot/%.pot using po4a-updatepo
 - for all Documentation/po/$(lang)/%.po,
   . "git rm --cached" it if Documentation/po/pot/%.pot does not exist.

I deliberately left the management of *.pot (i.e. the first two tasks in the above list)outside the scope of "make update" run in Documentation/po/ directory. It often is easier for the i18n coordinators to manage if everybody works on translating the same version of documentation strings.

I would expect the overall project workflow to be:
 - A developer can add or modify Documentation/*.txt to document new
   commands any time without having to worry about documentation i18n.
 - A translator may tweak wording in Documentation/po/$(lang)/*.po any
   time.
 - From time to time Documentation/po/pot/*.pot files are updated from
   Documentation/*.txt by the i18n coordinator.  The translators are asked
   to update their translation when this happens.
 - A translator gets update to Documentation/po/pot/*.pot, performsn
   msgmerge^Wpo4a-updatepo to update Documentaiton/po/$(lang)/*.po and
   commits the fixed-up version.

You may want to help the i18n coordinator by supporting "make pot-update" target in Documentation/po/Makefile to be run "from time to time".

Previous: Osamu OKANONext: Ævar Arnfjörð Bjarmason
Message 21 of 22 in “Document translation with po4a.”
  1. 0/7 Document translation with po4a.Osamu OKANO, May 13, 2011
  2. 1/7 Add new target pot in MakefileOsamu OKANO, May 13, 2011
  3. 2/7 add make(shell) scriptsOsamu OKANO, May 13, 2011
  4. 3/7 cp git-stage.pot ja/git-stage.poOsamu OKANO, May 13, 2011
  5. 4/7 translate ja/git-stage.poOsamu OKANO, May 13, 2011
  6. 5/7 your fileOsamu OKANO, May 13, 2011
  7. Junio C HamanoMay 13, 2011
  8. Drew NorthupMay 13, 2011
  9. 6/7 update git-stage.poOsamu OKANO, May 13, 2011
  10. Junio C HamanoMay 13, 2011
  11. Osamu OKANOMay 14, 2011
  12. Jonathan NiederMay 14, 2011
  13. Junio C HamanoMay 15, 2011
  14. Jonathan NiederMay 15, 2011
  15. Ævar Arnfjörð BjarmasonMay 15, 2011
  16. Jonathan NiederMay 15, 2011
  17. Jonathan NiederMay 15, 2011
  18. Ævar Arnfjörð BjarmasonMay 15, 2011
  19. Jonathan NiederMay 15, 2011
  20. 7/7 translate and remove fazzyOsamu OKANO, May 13, 2011
  21. Junio C HamanoMay 13, 2011
  22. Ævar Arnfjörð BjarmasonMay 14, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.