<?xml version="1.0" encoding="utf-8"?>
<s1 title="HelpOnDictionaries"><p><p></p>
<s2 id="Dictionaries" title="Dictionaries">
<p><p>Contents</p>
<ol><li>
<link anchor="D">Dictionaries</link><ol><li>
<link anchor="W">Wiki Dicts</link><ol><li>
<link anchor="D-1">Defining them</link></li>
<li>
<link anchor="U">Using them</link><ol><li>
<link anchor="T">Translation</link></li>
<li>
<link anchor="V">Variables</link></li>
</ol>
</li>
<li>
<link anchor="P">Protecting them</link></li>
</ol>
</li>
<li>
<link anchor="O">Other ways to define dicts / access dict definitions</link></li>
</ol>
</li>
</ol>
<p> A dictionary is a simple data structure that maps a dictionary name to a set of key/value pairs. It can be used e.g. to provide additional translations. </p>
<p>The dictionary name usually is something like <code>GermanDict</code> (some word ending with <code>Dict</code>). This default pattern can be changed (e.g. for non-english languages etc.), see page_dict_regex on <jump href="/wiki/HelpOnConfiguration">HelpOnConfiguration</jump>. </p>
<p>The dict members are key/value pairs (both unicode strings). </p>
<p></p>
<s3 id="Wiki Dicts" title="Wiki Dicts">
<p></p>
<s4 id="Defining them" title="Defining them">
<p>You can create a dict definition for a dict named <code>GermanDict</code> by creating a page called <code>GermanDict</code> with this content: </p>
<p></p>
<source><![CDATA[#format wiki
This translates some words from English to German:
 dog:: Hund
 cat:: Katze
 mouse: Maus]]></source><p>Important: </p>
<ul><li><p>Dict members have to be on a first-level definition list (see <jump href="/wiki/HelpOnLists">HelpOnLists</jump>). </p>
<ul><li><p>/!\ The leading space and the space after &apos;::&apos; are important. </p>
</li>
</ul>
</li>
<li>Everything else (other text, second-level items, etc.) is ignored. </li>
</ul>
<p></p>
</s4>
<s4 id="Using them" title="Using them">
<p></p>
<s5 id="Translation" title="Translation">
<p><jump href="/wiki/MoinMoin">MoinMoin</jump> uses <code>&lt;Language&gt;Dict</code> additionally to the builtin gettext based translations. E.g. if it wants to translate <code>cat</code> to German and doesn&apos;t find it in the .po file, it will try to look it up on <code>GermanDict</code> (and find <code>Katze</code> there, see the example above). </p>
<p></p>
</s5>
<s5 id="Variables" title="Variables">
<p>See also <jump href="/wiki/HelpOnVariables">HelpOnVariables</jump>. </p>
<p></p>
</s5>
</s4>
<s4 id="Protecting them" title="Protecting them">
<p>You can use ACLs as usual to protect your dict pages. </p>
<p></p>
</s4>
</s3>
<s3 id="Other ways to define dicts / access dict definitions" title="Other ways to define dicts / access dict definitions">
<p>MoinMoin can also use dict definitions from other sources, but this needs to be configured in your wiki config. See <code>dicts</code> on <jump href="/wiki/HelpOnConfiguration">HelpOnConfiguration</jump>. </p>
</s3></s2></s1>