[fix] languages: show country name even if there is only one country

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
Markus Heiser 2022-03-19 16:45:14 +01:00
parent a25e3767d4
commit 2e4557f3f3
2 changed files with 18 additions and 20 deletions

View file

@ -224,9 +224,7 @@ def filter_language_list(all_languages):
if len(filtered_countries) > 1:
filtered_countries[lang] = _copy_lang_data(lang, None)
elif len(filtered_countries) == 1:
# if there's only one country per language, it's not necessary to show country name
lang_country = next(iter(filtered_countries))
filtered_countries[lang_country]['country_name'] = None
# if no country has enough engines try to get most likely country code from babel
if not filtered_countries: