From cea466973a4886721a790610a2d4d88929f0675b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sat, 6 Nov 2021 19:55:02 +0000 Subject: [PATCH] Check if language has enough translations Fixes #2257 --- InvenTree/templates/InvenTree/settings/user.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/InvenTree/templates/InvenTree/settings/user.html b/InvenTree/templates/InvenTree/settings/user.html index 867c8ef733..2692d11c02 100644 --- a/InvenTree/templates/InvenTree/settings/user.html +++ b/InvenTree/templates/InvenTree/settings/user.html @@ -216,9 +216,12 @@ {% get_current_language as LANGUAGE_CODE %} {% get_available_languages as LANGUAGES %} {% get_language_info_list for LANGUAGES as languages %} + {% define 'alllang' in request.GET as ALL_LANG %} {% for language in languages %} {% define language.code as lang_code %} {% define locale_stats|keyvalue:lang_code as lang_translated %} + {% define lang_translated > 10 or lang_code == 'en' as use_lang %} + {% if ALL_LANG or use_lang %} + {% endif %} {% endfor %}
+

{% trans "Some languages are have a low translation percentage." %} + {% if ALL_LANG %} + {% trans "Show only sufficent" %} + {% else %} + {% trans "Show them too" %} + {% endif %} +