<p>Change language by adding the following to your <codeclass="docutils literal notranslate"><spanclass="pre">mygame/server/conf/settings.py</span></code>
<div><p>Windows Note: 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,
<p>Evennia offers translations of hard-coded strings in the server, things like
“Connection closed” or “Server restarted”, strings that end users will see and
which game devs are not supposed to change on their own. Text you see in the log
file or on the command line (like error messages) are generally <em>not</em> translated
(this is a part of Python).</p>
<p>In addition, text in default Commands and in default Typeclasses will <em>not</em> be
translated by switching <em>i18n</em> language. To translate Commands and Typeclass
hooks you must overload them in your game directory and translate their returns
to the language you want. This is because from Evennia’s perspective, adding
<em>i18n</em> code to commands tend to add complexity to code that is <em>meant</em> to be
changed anyway. One of the goals of Evennia is to keep the user-changeable code
as clean and easy- to-read as possible.</p>
</div>
<p>Translations are found in the core <codeclass="docutils literal notranslate"><spanclass="pre">evennia/</span></code> library, under
<codeclass="docutils literal notranslate"><spanclass="pre">evennia/evennia/locale/</span></code>. You must make sure to have cloned this repository
from <aclass="reference external"href="https://github.com/evennia/evennia/blob/master/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 noone has
translated it yet. Alternatively you might have the language but find the
translation bad … You are welcome to help improve the situation!</p>
<p>To start a new translation you need to first have cloned the Evennia repositry
with GIT and activated a python virtualenv as described on the <aclass="reference internal"href="../Setup/Setup-Quickstart.html"><spanclass="doc">Setup
Quickstart</span></a> page.</p>
<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>
<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”
for many free alternatives).</p>
<p>The concept of translating is simple, it’s just a matter of taking the english
strings you find in the <codeclass="docutils literal notranslate"><spanclass="pre">**.po</span></code> file and add your language’s translation best
you can. The <codeclass="docutils literal notranslate"><spanclass="pre">**.po</span></code> format (and many supporting editors) allow you to mark
translations as “fuzzy”. This tells the system (and future translators) that you
are unsure about the translation, or that you couldn’t find a translation that
exactly matched the intention of the original text. Other translators will see
this and might be able to improve it later. Finally, you need to compile your
translation into a more efficient form. Do so from the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> folder again:</p>
<p>This will go through all languages and create/update compiled files (<codeclass="docutils literal notranslate"><spanclass="pre">**.mo</span></code>)
for them. This needs to be done whenever a <codeclass="docutils literal notranslate"><spanclass="pre">**.po</span></code> file is updated.</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> and <codeclass="docutils literal notranslate"><spanclass="pre">*.mo</span></code> files. Less
ideally (if git is not your thing) you can also attach them to a new post in our