[Po4a-devel] [RFC] [Docbook] Add 'translator-credits' support

Nicolas François nicolas.francois at centraliens.net
Wed Mar 4 10:23:21 UTC 2009


On Wed, Mar 04, 2009 at 09:56:54AM +0800, dongsheng.song at gmail.com wrote:
> 2009/3/3 Nicolas François <nicolas.francois at centraliens.net>:
> > On Tue, Mar 03, 2009 at 11:29:07AM +0800, dongsheng.song at gmail.com wrote:
> >> Hello,
> >>
> >> As a competition, I suggest po4a add 'translator-credits' support.
> >>
> >> po4a-updatepo will generate 'translator-credits':
> >>
> >>     #: ../source/book.xml:0
> >>     msgid "translator-credits"
> >>     msgstr ""
> >>     "alice <alice at example.com>, 2005-2008\n"
> >>     "bob <bob at example.com>, 2005,2008"
> >>
> >> if the source xml have info (bookinfo|articleinfo|info) element,
> >> po4a-translate will
> >> add 'othercredit' and 'copyright' like this:
> >>
> >>     <othercredit class="translator">
> >>       <firstname>alice</firstname>
> >>       <email>alice at example.com</email>
> >>     </othercredit>
> >>     <othercredit class="translator">
> >>       <firstname>bob</firstname>
> >>       <email>bob at example.com</email>
> >>     </othercredit>
> >>
> >>     <copyright>
> >>       <year>2005</year>
> >>       <year>2006</year>
> >>       <year>2007</year>
> >>       <year>2008</year>
> >>       <holder>alice <alice at example.com></holder>
> >>     </copyright>
> >
> > I would prefer that the translator string contains the information and the
> > formating tags.
> >
> > Otherwise, I will have to parse and support too many things.
> > (what is a year, a firstname, a surname, a company, etc.)
> >
> 
> I don't think so, as xml2po has implement this, and translator like it.

I will have a look, but at least for my name (Nicolas and François are
both very common firstnames or surnames in France), it would be impossible
to identify the first name. (And compound names or firstnames could make
it even more surprising (Pierre Jean François).

I don't know what the Berne Convention specifies about copyright, but
dates could maybe also be written in non-latin glyphs. This would make it
very hard to differentiate between names and dates.

An option could be to support both a very strict syntax (all lines using a
"Name <email>\n" syntax) and a more liberal syntax (if a line does not
match [^<]+\s+<[^>]+@[^>]+>(\\n)? 

> > Then I would prefer to have it as an option since it is not always wanted
> > and might be fragile (there might be an <info> tag that does not refer to
> > the document.
> >
> > Also, only the first <info> should receive this extra information.
> >
> > Otherwise, it looks feasible. But requires changes in the Xml module and
> > in the Docbook module.
> > This will have to be configurable from the Xml module point of view
> > because different format may want to use this for different tags.
> >
> > Also for Docbook, multiple tags will require this to support different
> > versions of Docbook (looking at the history, the <*info> tags have never
> > been really stable)
> >
> 
> No, a valid Docbook document has only one qualified <*info>, we can only do
> the  process at the following xpath:
>     /article/articleinfo (DocBook 4.x)
>     /book/bookinfo (DocBook 4.x)
>     /article/info (DocBook 5.x)
>     /book/info (DocBook 5.x)

I think it is possible to put an info quite everywhere, even inside a
para:
http://www.docbook.org/tdg5/en/html/para.html

You can also have an article (or chapter) with an info, inside a book with
an info.

Adding a translator credit inside each info looks too much. Adding a
translator credit to the first <info> may be better, but may require the
usage of options to define which of these files have to add a translator
credit.

Best Regards,
-- 
Nekral



More information about the Po4a-devel mailing list