<p>Language translations are found in the <aclass="reference external"href="https://github.com/evennia/evennia/blob/master/evennia/locale">evennia/locale</a>
folder. Read below if you want to help improve an existing translation of
<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 <cite>gettext</cite> or <cite>xgettext</cite> on Windows,
see the <aclass="reference external"href="https://docs.djangoproject.com/en/3.2/topics/i18n/translation/#gettext-on-windows">Django documentation</a>
<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
<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
<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>
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>
<spanclass="n">Swedish</span><spanclass="p">:</span><spanclass="s2">"</span><spanclass="se">\n</span><spanclass="s2">Misslyckades med att nå '</span><spanclass="si">{path}</span><spanclass="s2">')."</span>
</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. Even though the result is a mix of your language and
English, clarity is more important. Many languages may also use the English term
normally and reaching for a translation may make the result sound awkward
instead.</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="n">Original</span><spanclass="p">:</span><spanclass="s2">"</span><spanclass="se">\n</span><spanclass="s2">Error loading cmdset: No cmdset class '</span><spanclass="si">{classname}</span><spanclass="s2">' in '</span><spanclass="si">{path}</span><spanclass="s2">'.</span>
<spanclass="n">Swedish</span><spanclass="p">:</span><spanclass="s2">"Fel medan cmdset laddades: Ingen cmdset-klass med namn '</span><spanclass="si">{classname}</span><spanclass="s2">' i </span><spanclass="si">{path}</span><spanclass="s2">.</span>