[publican-list] conditionally exclude a paragraph
Jeff Fearn
jfearn at redhat.com
Tue Nov 8 04:47:48 UTC 2011
On 11/08/2011 02:01 PM, Domingo Becker wrote:
> 2011/11/7 Jeff Fearn<jfearn at redhat.com>:
>> On 11/08/2011 09:40 AM, Joshua Wulf wrote:
>>>
>>> == The brute force method ==
>>>
>>>
>>> <section lang="de-DE" lang="es-ES" lang="pt-BR" ...>
>>
>> <section lang="de-DE,es-ES,pt-BR" ...>
>>
>
> This seems to be the best way by now.
>
> But perhaps, a Publican RFE: if Publican interprpets the ',' (comma)
> operator in a string, then it would be possible to add a negation
> operator like '!' in C++ inside the string.
The current functionality is built in to DocBook, specialising it for
Publican would mean books could no longer be built properly with other
DocBook tool chains.
> The problem I want to solve is the one being discussed in [1].
>
> Then Petr Kovar asked me if the paragraph including
> "translator-credits" string would appear in the source language of the
> manual [2]. And it's reasonable to exclude it when building the book
> for the source language.
Why not have an XML file for each language and put the condition on the
xi:include?
e.g.
en-US/es-ES_translators.xml would contain a list of Spanish translators,
you could probably automate generating it.
Then at the end of en-US/Author_Group.xml
<xi:include lang="es-ES" href="es-ES_translators.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include lang="fr-FR "href="fr-FR_translators.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
... etc
</authorgroup>
That list of xi:includes only needs to be updated when a new translation
is added, so the overhead for writers is small.
FYI Publican 3 will have the ability to have a per language Author_Group
file [1], it could take a while to get released though.
Cheers, Jeff.
1: https://bugzilla.redhat.com/show_bug.cgi?id=697371
--
"Reply All" why you shouldn't use it:
http://www.emailreplies.com/#12replytoall
More information about the publican-list
mailing list