Don't require understood languages to be in the translations list

main
Bob Mottram 2022-02-26 13:41:48 +00:00
parent d6864e9ee3
commit 738cece2e9
1 changed files with 5 additions and 13 deletions

View File

@ -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,15 +71,8 @@ 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 not in lang_list2:
lang_list2 += ', ' + lang.strip()
else:
lang_list2 += lang.strip()