Re: gnome-devel-docs on

On Fri, 2014-05-09 at 21:08 +0200, Ask Hjorth Larsen wrote:
Hello everyone

First of all I am very willing to implement a mode in gtxml
specifically for this.

Fixing the translator-credits issue is obviously very easy.

I can make it so that gtxml will only complain about syntax errors,
i.e. strings that are not accepted by the xml parser.  This requires
that all msgids and msgstrs - except the header and translator-credits
- can be assumed to be XML.

The files also contain "media" links to images/videos with their md5
hashes.  Perhaps a special check should be made for those, since they
are probably not required to be legal XML.  Are there other classes of
strings to be aware of?  Is all this acceptable?  Also, who could
actually approve this and make it run on the server?

For any special strings that don't correspond directly to some content,
itstool always uses msgctxt "_". So at least for itstool-generated PO
files, you could ignore any messages with msgctxt "_".

Right now gtxml can to various extents be "smarter" and detect more
errors - e.g. whether unexpected XML tags are used.  But some
translators tend to insert their own little xml things when they want,
which is fine by itself, but can lead to false positives when
attempting to be too smart.

What happens with placeholder tags (such as _:ulink-1, _:ulink-2 and
so on), how bad is it if those are messed up?

For any placeholder tags, itstool always uses the namespace prefix "_".
(It does an internal mapping of this to a namespace URI, which nobody
should bother caring about (and yes, a known limitation of itstool is
that it will do bad things if you use "_" as a namespace prefix in your
source documents.))

Messages with placeholders should always be well-formed. It would be
nice to check that the placeholder elements in the source message line
up with those in the translated message.

Other XML->PO tools could do things completely differently. xml2po does
not use a special msgctxt or namespace prefix for anything. But people
should stop using xml2po anyway. I think KDE has their own tool. They
should probably just use itstool too. I'm not sure what Okapi does, but
it's targeted at XLIFF anyway, and its PO exporter is a bonus feature
that I'm not sure many people use.

There are probably other tools I don't know about. I saw a svg2po once
somewhere. They should really just use itstool too.

Extra bonus side note: I've asked the gettext maintainers before about
adding a flag to identify XML content, like:

#, xml-fragment

It's been a while since I bugged them about that. Then tools like gtxml
could just look for messages with that flag.


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