[GRASS-dev] Re: more translation - manual pages

Hi Maxim,

(discussion how to translate the manual pages)

On Thu, Oct 9, 2008 at 4:53 PM, Maxim Dubinin <sim@gis-lab.info> wrote:
...

We can simply take all the *.htmls and start translating, but I was
thinking, that if we know how they are generated automatically,

well... what's happening:

1. compiler does its work and generates binary of a module;
2. module is immediately run in a fake session, it prints the header
  of the man page
(try: d.rast --html-description)
  This is done the language to what the computer was set (so, the .po files
  are used if present);
3. the description.html file of the module (English) is attached to that;
4. the now complete man page is moved into the right place.

Missing:
- store translated description.html somewhere
- Makefile should pick the right description.html for a non-english language
  if .po file is present

we can
tweak the process to save some work for us, like for example make
word substitution for repeating phrases or export not in html but in
rtf etc.

I would suggest to to RFT/whatever format from the resulting manual page.
HTML is for many years the best format to deal with module documentation
in GRASS as it can be edited with an ASCII editor (less so with RTF).
Also "svn diff" works on HTML but not reasonably on RTF. There are
many converters to make an RTF from HTML.

Finally looked in the source... so each module has a description file,
from which the html is generated during compilation. Do I understand
right, that these description files are maintained by the module
authors and not stored centrally somewhere?

They are stored centrally along with the source code. Maintainers are
the module authors in the first place (if still around) or any other developer
or power user, or our documentation manager (Eric).
...

--
Maxim mailto:sim@gis-lab.info

Action item for us:
- understand how to support multi-language manual pages. this is
  a request which is on the plate for years meanwhile... Cannot be so hard!

Markus

Markus Neteler wrote:

Action item for us:
- understand how to support multi-language manual pages. this is
  a request which is on the plate for years meanwhile... Cannot be so hard!

Making them in the first place isn't hard. Ensuring that the
translations get updated whenever the original is updated may be
harder to achieve.

In terms of technical changes, the main problem is that you can't have
multiple wildcards (%) in a pattern rule, and the wildcard is already
being used for the module name, so we would need to repeat the
HTML-related Makefile rules for each locale.

This could be done using $(foreach ... $(eval $(call ...))), but that
can be quite hard to read (see include/Make/Multi.make or
locale/Makefile for examples).

It can be simplified if you only want to generate a single language
from each run (although package maintainers won't be very happy with
this), by just adding $(LANG) to the rules, e.g.:

  -$(HTMLDIR)/%.html: %.html %.tmp.html $(HTMLSRC)
  +$(HTMLDIR)/$(LANG)/%.html: %.$(LANG).html %.$(LANG).tmp.html $(HTMLSRC)

Even so, you'll probably still need at least two rules, one for the
untranslated (i.e. English) version and one for the translated
version, unless you're assuming that all translations will be complete
(i.e. every file will have a translated version), rather than having
only the most important pages translated.

--
Glynn Clements <glynn@gclements.plus.com>

(discussion how to translate the manual pages)

there is also this idea on how to do live online translations:
  http://grass.osgeo.org/wiki/Updating_GRASS_Documentation#Translations

+ always current
+ prototype already functional
- tied to internet
- tied to 3rd party
- automatic translations often "creative"
- inflexible

Hamish