diff --git a/languages.py b/languages.py index 1dc2fcb82..88a33c58a 100644 --- a/languages.py +++ b/languages.py @@ -7,7 +7,6 @@ __email__ = "bob@libreserver.org" __status__ = "Production" __module_group__ = "Core" -import os import json from urllib import request, parse from utils import get_actor_languages_list @@ -49,7 +48,7 @@ def get_understood_languages(base_dir: str, http_prefix: str, def set_actor_languages(base_dir: str, actor_json: {}, languages_str: str) -> None: - """Sets the languages used by the given actor + """Sets the languages understood by the given actor """ languages_str = languages_str.strip() separator = None @@ -72,18 +71,11 @@ def set_actor_languages(base_dir: str, actor_json: {}, lang_list2 = '' for lang in lang_list: lang = lang.strip() - if base_dir: - language_filename = base_dir + '/translations/' + lang + '.json' - if os.path.isfile(language_filename): - if lang_list2: - lang_list2 += ', ' + lang.strip() - else: - lang_list2 += lang.strip() - else: - if lang_list2: + if lang_list2: + if ' ' + lang not in lang_list2: lang_list2 += ', ' + lang.strip() - else: - lang_list2 += lang.strip() + else: + lang_list2 += lang.strip() # remove any existing value property_found = None