{% load i18n %}

<p>{% trans "The regular expression to match translation files has to contain two named groups to match component and language, some examples:" %}</p>

<table class="table table-striped">
<thead>
<tr>
    <th>{% trans "Regular expression" %}</th>
    <th>{% trans "Example matched files" %}</th>
    <th>{% trans "Description" %}</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>(?P&lt;language&gt;[^/.]*)/(?P&lt;component&gt;[^/]*)\.po</code></td>
<td>
    <code>cs/application.po</code><br />
    <code>cs/website.po</code><br />
    <code>de/application.po</code><br />
    <code>de/website.po</code>
</td>
<td>{% trans "One folder per language containing translation files for components." %}</td>
</tr>
<tr>
<td><code>locale/(?P&lt;language&gt;[^/.]*)/LC_MESSAGES/(?P&lt;component&gt;[^/]*)\.po</code></td>
<td>
    <code>locale/cs/LC_MESSAGES/application.po</code><br />
    <code>locale/cs/LC_MESSAGES/website.po</code><br />
    <code>locale/de/LC_MESSAGES/application.po</code><br />
    <code>locale/de/LC_MESSAGES/website.po</code>
</td>
<td>{% trans "Usual structure for storing gettext PO files." %}</td>
</tr>
<tr>
<td><code>src/locale/(?P&lt;component&gt;[^/]*)\.(?P&lt;language&gt;[^/.]*)\.po</code></td>
<td>
    <code>src/locale/application.cs.po</code><br />
    <code>src/locale/website.cs.po</code><br />
    <code>src/locale/application.de.po</code><br />
    <code>src/locale/website.de.po</code>
</td>
<td>{% trans "Using both component and language name within filename." %}</td>
</tr>
<tr>
<td><code>locale/(?P&lt;language&gt;[^/.]*)/(?P&lt;component&gt;[^/]*)/(?P=language)\.po</code></td>
<td>
    <code>locale/cs/application/cs.po</code><br />
    <code>locale/cs/website/cs.po</code><br />
    <code>locale/de/application/de.po</code><br />
    <code>locale/de/website/de.po</code>
</td>
<td>{% trans "Using language in both path and filename." %}</td>
</tr>
<tr>
<td><code>res/values-(?P&lt;language&gt;[^/.]*)/strings-(?P&lt;component&gt;[^/]*)\.xml</code></td>
<td>
    <code>res/values-cs/strings-about.xml</code><br />
    <code>res/values-cs/strings-help.xml</code><br />
    <code>res/values-de/strings-about.xml</code><br />
    <code>res/values-de/strings-help.xml</code><br />
</td>
<td>{% trans "Android resource strings, split into several files." %}</td>
</tr>
<tr>
<td><code>(?P&lt;originalHierarchy&gt;.+/)(?P&lt;component&gt;[^/]*)/src/main/resources/ApplicationResources_(?P&lt;language&gt;[^/.]*)\.properties</code></td>
<td>
    <code>parent/module1/submodule/src/main/resources/ApplicationResources_fr.properties</code><br />
    <code>parent/module1/submodule/src/main/resources/ApplicationResource_es.properties</code><br />
    <code>parent/module2/src/main/resources/ApplicationResource_de.properties</code><br />
    <code>parent/module2/src/main/resources/ApplicationResource_ro.properties</code><br />
</td>
<td>{% trans "Multi-module Maven project with Java properties translations." %}</td>
</tr>
</tbody>
</table>

<p>{% trans "You can use Django template markup in both component name and the monolingual base filename, for example:" %}</p>

<dl>
<dt><code>{% verbatim %}{{ component }}{% endverbatim %}</code></dt>
<dd>{% trans "Component filename match" %}</dd>
<dt><code>{% verbatim %}{{ component|title }}{% endverbatim %}</code></dt>
<dd>{% trans "Component filename with upper case first letter" %}</dd>
</dl>
