mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-31 18:27:30 +01:00
Show translation template if there aren't any content translations
This commit is contained in:
parent
80c3416ca7
commit
9c2ecd1e22
@ -458,6 +458,7 @@ def move_to_state(package):
|
|||||||
@is_package_page
|
@is_package_page
|
||||||
def translation(package):
|
def translation(package):
|
||||||
return render_template("packages/translation.html", package=package,
|
return render_template("packages/translation.html", package=package,
|
||||||
|
has_content_translations=any([x.title or x.short_desc for x in package.translations.all()]),
|
||||||
tabs=get_package_tabs(current_user, package), current_tab="translation")
|
tabs=get_package_tabs(current_user, package), current_tab="translation")
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,18 +26,6 @@
|
|||||||
{{ _("Translating content meta - lua_api.md") }}
|
{{ _("Translating content meta - lua_api.md") }}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<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:",
|
|
||||||
location="<code>locale/template.txt</code>"|safe) }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<pre><code># textdomain: {{ package.name }}
|
|
||||||
|
|
||||||
{{ package.title | replace("@", "@@") | replace("=", "@=") }} =
|
|
||||||
{{ package.short_desc | replace("@", "@@") | replace("=", "@=") }} =
|
|
||||||
</code></pre>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>
|
<p>
|
||||||
{{ _("%(title)s is available in %(num)d languages.", title=package.title, num=num) }}
|
{{ _("%(title)s is available in %(num)d languages.", title=package.title, num=num) }}
|
||||||
@ -89,5 +77,19 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not has_content_translations %}
|
||||||
|
<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:",
|
||||||
|
location="<code>locale/template.txt</code>"|safe) }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<pre><code># textdomain: {{ package.name }}
|
||||||
|
|
||||||
|
{{ package.title | replace("@", "@@") | replace("=", "@=") }} =
|
||||||
|
{{ package.short_desc | replace("@", "@@") | replace("=", "@=") }} =
|
||||||
|
</code></pre>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user