diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index 7eebd676..7cdee97a 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -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") diff --git a/app/templates/packages/translation.html b/app/templates/packages/translation.html index 354dc92b..92876df4 100644 --- a/app/templates/packages/translation.html +++ b/app/templates/packages/translation.html @@ -26,18 +26,6 @@ {{ _("Translating content meta - lua_api.md") }}

- -

{{ _("Translation template") }}

-

- {{ _("To quickly add support for ContentDB package translation, create a file at %(location)s with the following content:", - location="locale/template.txt"|safe) }} -

- -
# textdomain: {{ package.name }}
-
-{{ package.title | replace("@", "@@") | replace("=", "@=") }} =
-{{ package.short_desc | replace("@", "@@") | replace("=", "@=") }} =
-
{% else %}

{{ _("%(title)s is available in %(num)d languages.", title=package.title, num=num) }} @@ -89,5 +77,19 @@ {% endfor %} {% endif %} + + {% if not has_content_translations %} +

{{ _("Translation template") }}

+

+ {{ _("To quickly add support for ContentDB package translation, create a file at %(location)s with the following content:", + location="locale/template.txt"|safe) }} +

+ +
# textdomain: {{ package.name }}
+
+{{ package.title | replace("@", "@@") | replace("=", "@=") }} =
+{{ package.short_desc | replace("@", "@@") | replace("=", "@=") }} =
+
+ {% endif %} {% endblock %}