<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" style="xslt-mode" id="l10n.format.mode">
 <info>
  <link type="guide" xref="l10n" group="modes"/>
  <link type="guide" xref="modes" group="l10n"/>
  <desc>Process format strings from <code xref="l10n.gettext">l10n.gettext</code>.</desc>
  <revision version="3.18" date="2015-08-13" status="final"/>
 </info>
 <title>l10n.format.mode</title>
 <synopsis>
  <title>Parameters</title>
  <terms>
   <item>
    <title><code>$node</code></title>
    <p>The node being processed in the original document.</p>
   </item>
   <item>
    <title><code>$string</code></title>
    <p>String content to use for certain message format nodes.</p>
   </item>
  </terms>
 </synopsis>
 <p>This mode is called by <code xref="l10n.gettext">l10n.gettext</code> when its <sys>format</sys> parameter is set to
 true. It is applied to the elements and text children of the translated message
 that <code xref="l10n.gettext">l10n.gettext</code> finds. This allows you to insert content in format strings,
 rather than concatenating multiple translations to create a translated message.</p>
 <p>By default, this stylesheet provides matching templates in this mode for the
 elements <sys>node</sys> and <sys>string</sys>. The template for <sys>node</sys> applies templates with
 no mode to the <code>$node</code> parameter passed to <code xref="l10n.gettext">l10n.gettext</code>. The template for
 <sys>string</sys> copies the text in the <code>$string</code> parameter passed to <code xref="l10n.gettext">l10n.gettext</code>.
 Both parameters are passed to templates in this mode. Templates matching this
 mode should pass those parameters to child content if they process child
 content in <code xref="l10n.format.mode">l10n.format.mode</code>.</p>
 <p>To use format strings in your own translations, use elements with names of
 your choosing in your message. You can use the <sys>node</sys> and <sys>string</sys> elements
 without further implementation, if they fit your needs. Otherwise, take care
 to use element names that are unlikely to conflict with other templates using
 this mode.</p>
</page>
