OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] How to mark a programlisting non-translatable


On 19.05.2023 5:37, a.savchkov@postgrespro.ru wrote:
<pre class="programlisting highlight-shell notranslate">
some program lines
</pre>

Please note that in HTML5 there is special attribute translate to indicate whether content should be translated or not:

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/translate

<pre class="programlisting highlight-shell" translate="no">
some program lines
</pre>

in the declaration of the entire document. Could you please advice me how to command docbook to produce the HTML I need i.e. the pure <pre class="programlisting highlight-shell notranslate">? Or maybe there's another way of marking a programlisting in docbook non-translatable?

If you would like to prevent translation of all programlisting then the easiet is to modify stylesheets to emit translate="no" for each programlisting element transformed to <pre>.

If you need fine grained control over each programlisting you can use its:translate attribute defined in ITS 2.0 (https://www.w3.org/TR/its20/):

<programlisting xmlns:its="http://www.w3.org/2005/11/its";
		its:translate="on">

</programlisting>

There is schema dbits.rng/rnc you could use instead of docbook.rng/rnc that included definitions of additional ITS elements/attributes.

However I think that stylesheets currently doesn't support ITS attributes and they will not be propagated to HTML output.



--
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
     Professional XML and Web consulting and training services
DocBook/DITA customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------

Attachment: OpenPGP_signature
Description: OpenPGP digital signature



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]