2024-02-25 18:50:33 +01:00
|
|
|
{% extends "packages/package_base.html" %}
|
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{{ _("Translation") }}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
{% set translations = package.translations.all() %}
|
|
|
|
{% set num = translations | length + 1 %}
|
|
|
|
|
|
|
|
<a class="btn btn-secondary float-end" href="https://api.minetest.net/translations/#translating-content-meta">
|
|
|
|
{{ _("Help") }}
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<h2 class="mt-0 mb-4">{{ self.title() }}</h2>
|
|
|
|
{% if num == 1 %}
|
|
|
|
<p>
|
2024-06-09 14:26:16 +02:00
|
|
|
{{ _("To provide translations for your package, you need to create .tr files and upload a new release.") }}
|
2024-02-25 18:50:33 +01:00
|
|
|
{{ _("For information on how to do this, see the modding book chapter and lua_api.md") }}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<a class="btn btn-primary me-2" href="https://rubenwardy.com/minetest_modding_book/en/quality/translations.html">
|
|
|
|
{{ _("Translation - Minetest Modding Book") }}
|
|
|
|
</a>
|
|
|
|
<a class="btn btn-primary" href="https://api.minetest.net/translations/#translating-content-meta">
|
|
|
|
{{ _("Translating content meta - lua_api.md") }}
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
{% else %}
|
|
|
|
<p>
|
|
|
|
{{ _("%(title)s is available in %(num)d languages.", title=package.title, num=num) }}
|
|
|
|
{{ _("ContentDB reads translations from locale files (.tr) in your package.") }}
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<div class="list-group">
|
|
|
|
<div class="list-group-item">
|
|
|
|
<div class="row text-muted">
|
|
|
|
<div class="col-sm-2">
|
|
|
|
{{ _("Language") }}
|
|
|
|
</div>
|
|
|
|
<div class="col-sm">
|
|
|
|
{{ _("Title") }}
|
|
|
|
</div>
|
|
|
|
<div class="col-sm">
|
|
|
|
{{ _("Short Description") }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="list-group-item">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2">
|
|
|
|
English
|
|
|
|
</div>
|
|
|
|
<div class="col-sm">
|
|
|
|
{{ package.title }}
|
|
|
|
</div>
|
|
|
|
<div class="col-sm">
|
|
|
|
{{ package.short_desc }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% for translation in translations %}
|
|
|
|
<div class="list-group-item">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-2">
|
|
|
|
{{ translation.language.title }}
|
|
|
|
</div>
|
|
|
|
<div class="col-sm">
|
|
|
|
{{ translation.title or "" }}
|
|
|
|
</div>
|
|
|
|
<div class="col-sm">
|
|
|
|
{{ translation.short_desc or "" }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2024-07-18 08:25:32 +02:00
|
|
|
|
|
|
|
{% if not has_content_translations %}
|
2024-07-18 09:01:46 +02:00
|
|
|
{% set translation_template_path %}
|
|
|
|
{% if package.type == package.type.GAME %}
|
|
|
|
<code>mods/mymod/locale/template.txt</code>
|
|
|
|
{% else %}
|
|
|
|
<code>locale/template.txt</code>
|
|
|
|
{% endif %}
|
|
|
|
{% endset %}
|
2024-07-18 08:25:32 +02:00
|
|
|
<h3 id="template">{{ _("Translation template") }}</h3>
|
|
|
|
<p>
|
|
|
|
{{ _("To quickly add support for ContentDB package translation, create a file at %(location)s with the following content:",
|
2024-07-18 09:01:46 +02:00
|
|
|
location=translation_template_path) }}
|
2024-07-18 08:25:32 +02:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<pre><code># textdomain: {{ package.name }}
|
|
|
|
|
|
|
|
{{ package.title | replace("@", "@@") | replace("=", "@=") }} =
|
|
|
|
{{ package.short_desc | replace("@", "@@") | replace("=", "@=") }} =
|
|
|
|
</code></pre>
|
2024-07-18 09:01:46 +02:00
|
|
|
|
|
|
|
{% if package.type == package.type.GAME %}
|
|
|
|
<p>{{ _("With games, you also need to name the textdomain in game.conf:") }}</p>
|
|
|
|
|
|
|
|
<pre><code>textdomain = mymod</code></pre>
|
|
|
|
|
|
|
|
<p>{{ _("Replace mymod with the name of mod / textdomain you chose.") }}</p>
|
|
|
|
{% endif %}
|
2024-07-18 08:25:32 +02:00
|
|
|
{% endif %}
|
2024-02-25 18:50:33 +01:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|