<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>HelpOnDictionaries</title></articleinfo><section><title>Dictionaries</title><para><!--The macro TableOfContents doesn't work with the DocBook formatter.--> 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. </para><para>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 <ulink url="http://ei-www.hyogo-dai.ac.jp/%7Eetsuo/moin.cgi/HelpOnDictionaries/~etsuo/moin.cgi/HelpOnConfiguration#">HelpOnConfiguration</ulink>. </para><para>The dict members are key/value pairs (both unicode strings). </para><section><title>Wiki Dicts</title><section><title>Defining them</title><para>You can create a dict definition for a dict named <code>GermanDict</code> by creating a page called <code>GermanDict</code> with this content: </para><screen><![CDATA[#format wiki
This translates some words from English to German:
 dog:: Hund
 cat:: Katze
 mouse: Maus]]></screen><para>Important: </para><itemizedlist><listitem><para>Dict members have to be on a first-level definition list (see <ulink url="http://ei-www.hyogo-dai.ac.jp/%7Eetsuo/moin.cgi/HelpOnDictionaries/~etsuo/moin.cgi/HelpOnLists#">HelpOnLists</ulink>). </para><itemizedlist><listitem><para><inlinemediaobject><imageobject><imagedata depth="16" fileref="http://ei-www.hyogo-dai.ac.jp/~etsuo/moin_static198/moniker/img/alert.png" width="16"/></imageobject><textobject><phrase>/!\</phrase></textobject></inlinemediaobject> The leading space and the space after '::' are important. </para></listitem></itemizedlist></listitem><listitem><para>Everything else (other text, second-level items, etc.) is ignored. </para></listitem></itemizedlist></section><section><title>Using them</title><section><title>Translation</title><para><ulink url="http://ei-www.hyogo-dai.ac.jp/%7Eetsuo/moin.cgi/HelpOnDictionaries/~etsuo/moin.cgi/MoinMoin#">MoinMoin</ulink> 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'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). </para><para>For the dictionary to work, the language name in <code>&lt;Language&gt;Dict</code> must match the value of the <code>x-language-in-english</code> header field, without spaces, which is found in the translation catalog for each language in <code>MoinMoin/i18n/</code> directory. For example, in <code>MoinMoin/i18n/pt-br.MoinMoin.po</code> you will find <code>&quot;X-Language-in-English: Brazilian Portuguese\n&quot;</code>. If you want to provide additional translations for that language, you create a page called <code>BrazilianPortugueseDict</code>. </para></section><section><title>Variables</title><para>See also <ulink url="http://ei-www.hyogo-dai.ac.jp/%7Eetsuo/moin.cgi/HelpOnDictionaries/~etsuo/moin.cgi/HelpOnVariables#">HelpOnVariables</ulink>. </para></section></section><section><title>Protecting them</title><para>You can use ACLs as usual to protect your dict pages. </para></section></section><section><title>Other ways to define dicts / access dict definitions</title><para>MoinMoin can also use dict definitions from other sources, but this needs to be configured in your wiki config. See <code>dicts</code> on <ulink url="http://ei-www.hyogo-dai.ac.jp/%7Eetsuo/moin.cgi/HelpOnDictionaries/~etsuo/moin.cgi/HelpOnConfiguration#">HelpOnConfiguration</ulink>. </para></section></section></article>