<p>Language translations are found in the <aclass="reference external"href="https://github.com/evennia/evennia/blob/main/evennia/locale/">evennia/locale</a>
folder. Read below if you want to help improve an existing translation of
contribute a new one.</p>
<sectionid="changing-server-language">
<h2>Changing server language<aclass="headerlink"href="#changing-server-language"title="Permalink to this headline">¶</a></h2>
<p>Change language by adding the following to your <codeclass="docutils literal notranslate"><spanclass="pre">mygame/server/conf/settings.py</span></code>
<p>Here <codeclass="docutils literal notranslate"><spanclass="pre">'en'</span></code> (the default English) should be changed to the abbreviation for one
of the supported languages found in <codeclass="docutils literal notranslate"><spanclass="pre">locale/</span></code> (and in the list above). Restart
the server to activate i18n.</p>
<divclass="admonition important">
<pclass="admonition-title">Important</p>
<p>Even for a ‘fully translated’ language you will still see English text
in many places when you start Evennia. This is because we expect you (the
developer) to know English (you are reading this manual after all). So we
translate <em>hard-coded strings that the end player may see</em> - things you
can’t easily change from your mygame/ folder. Outputs from Commands and
Typeclasses are generally <em>not</em> translated, nor are console/log outputs.</p>
</div>
<asideclass="sidebar">
<pclass="sidebar-title">Windows users</p>
<p>If you get errors concerning <codeclass="docutils literal notranslate"><spanclass="pre">gettext</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">xgettext</span></code> on Windows,
from <aclass="reference external"href="https://github.com/evennia/evennia/blob/main/evennia">Evennia’s github</a> before you can proceed.</p>
<p>If you cannot find your language in <codeclass="docutils literal notranslate"><spanclass="pre">evennia/evennia/locale/</span></code> it’s because no one
<p>Go to <codeclass="docutils literal notranslate"><spanclass="pre">evennia/evennia/</span></code> - that is, not your game dir, but inside the <codeclass="docutils literal notranslate"><spanclass="pre">evennia/</span></code>
repo itself. If you see the <codeclass="docutils literal notranslate"><spanclass="pre">locale/</span></code> folder you are in the right place. Make
sure your <codeclass="docutils literal notranslate"><spanclass="pre">virtualenv</span></code> is active so the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> command is available. Then run</p>
<p>where <codeclass="docutils literal notranslate"><spanclass="pre"><language-code></span></code> is the <aclass="reference external"href="http://www.science.co.il/Language/Codes.asp">two-letter locale code</a>
for the language you want to translate, like ‘sv’ for Swedish or ‘es’ for
Spanish. After a moment it will tell you the language has been processed. For
<p>If you started a new language, a new folder for that language will have emerged
in the <codeclass="docutils literal notranslate"><spanclass="pre">locale/</span></code> folder. Otherwise the system will just have updated the
existing translation with eventual new strings found in the server. Running this
command will not overwrite any existing strings so you can run it as much as you
want.</p>
<p>Next head to <codeclass="docutils literal notranslate"><spanclass="pre">locale/<language-code>/LC_MESSAGES</span></code> and edit the <codeclass="docutils literal notranslate"><spanclass="pre">**.po</span></code> file you
find there. You can edit this with a normal text editor but it is easiest if
you use a special po-file editor from the web (search the web for “po editor”
<p>This will compile all languages. Check your language and also check back to your
<codeclass="docutils literal notranslate"><spanclass="pre">.po</span></code> file in case the process updated it - you may need to fill in some missing
header fields and should usually note who did the translation.</p>
<p>When you are done, make sure that everyone can benefit from your translation!
Make a PR against Evennia with the updated <codeclass="docutils literal notranslate"><spanclass="pre">**.po</span></code> file. Less ideally (if git is
not your thing) you can also attach it to a new post in our forums.</p>
<sectionid="hints-on-translation">
<h3>Hints on translation<aclass="headerlink"href="#hints-on-translation"title="Permalink to this headline">¶</a></h3>
<p>Many of the translation strings use <codeclass="docutils literal notranslate"><spanclass="pre">{</span><spanclass="pre">...</span><spanclass="pre">}</span></code> placeholders. This is because they
are to be used in <codeclass="docutils literal notranslate"><spanclass="pre">.format()</span></code> python operations. While you can change the
<em>order</em> of these if it makes more sense in your language, you must <em>not</em>
translate the variables in these formatting tags - Python will look for them!</p>
Swedish: "\nMisslyckades med att nå '{path}')."
</pre></div>
</div>
<p>Finally, try to get a feel for who a string is for. If a special technical term
is used it may be more confusing than helpful to translate it, even if it’s
outside of a <codeclass="docutils literal notranslate"><spanclass="pre">{...}</span></code> tag. A mix of English and your language may be clearer
than you forcing some ad-hoc translation for a term everyone usually reads in
English anyway.</p>
<divclass="highlight-none notranslate"><divclass="highlight"><pre><span></span>Original: "\nError loading cmdset: No cmdset class '{classname}' in '{path}'.
\n(Traceback was logged {timestamp})"
Swedish: "Fel medan cmdset laddades: Ingen cmdset-klass med namn '{classname}' i {path}.