bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do not translate <placeholder-X/> tags (xml2po)


From: Chusslove Illich
Subject: Re: Do not translate <placeholder-X/> tags (xml2po)
Date: Thu, 2 Oct 2008 00:43:22 +0200
User-agent: KMail/1.9.9

> [: Karl Eichwalder :]
> I'd rather say enhancing "msgfmt --check" resp. "--check-format" would be
> the way to go. Thus all projects can make use of it. [...] make sure
> translators do not translate the <placeholder-X/> tags incidentally.
> <placeholder-X/> must occur in the msgstr, too.

While it certainly makes sense that any check becomes available to as wide
audience as possible, I see two problems with having it on msgfmt -c.
(Problems in the sense of requiring non-trivial design and implementation if
we take the "clean, thorough solution" perspective, which I'll venture to
assert is Bruno's default.)

Firstly, msgfmt performs a format check only if there is an appropriate
format flag, so the message would have to be rather like:

  #: help-boot.html:102(li)
  #, ???-format
  msgid "<placeholder-1/> -- switch off APM completely"
  msgstr ""

where it is not entirely clear what ???-format should be. One possibility
would be xml2po-format, but that would prevent a logical follow-up,
validating the rest of the markup. On the other hand, html-format or
docbook-format would be good markup-wise, but placeholder-X is not a tag in
either. Something like html-xml2po-format should cover it, but perhaps it's
overfocused; while taking "reasonable assumptions", as adding placeholder-X
to any XML-like markup is not exactly "clean".

Secondly, whatever the format flag, there would have to be some coordination
between xml2po, as external extraction tool in place of xgettext, and
Gettext. To make sure that what is a certain format and valid for one, is
also for the other. Not to say that it is not a good thing to try, but it'd
be breaking new ground for Gettext. Whereas within-limits solution would be
to incorporate extraction of XML-like markups into xgettext (which I
personally would rejoice, but does not seem like a small feat, in particular
not a clearly-defined one).

One could also take the following stance: msgfmt checks formats only in
"dynamic" POs, those from which messages are sourced by a running program,
because there a malformed translated message which rarely occurs will cause
loss of information to the user or even make the program crash. Whereas
format errors in "static" POs, such as those converted to HTML or Docbook,
are discovered on conversion before the content is released. In effect, that
it is the conversion to/from PO tool that should be the arbiter of
correctness for static POs it processes. And that it is the matter of
organization how to put it in a feedback loop with translators.

-- 
Chusslove Illich (Часлав Илић)

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]