mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 14:02:24 +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
|
||||
def translation(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")
|
||||
|
||||
|
||||
|
@ -26,18 +26,6 @@
|
||||
{{ _("Translating content meta - lua_api.md") }}
|
||||
</a>
|
||||
</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 %}
|
||||
<p>
|
||||
{{ _("%(title)s is available in %(num)d languages.", title=package.title, num=num) }}
|
||||
@ -89,5 +77,19 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% 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>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user