mirror of https://gitlab.com/bashrc2/epicyon
Don't require understood languages to be in the translations list
parent
d6864e9ee3
commit
738cece2e9
12
languages.py
12
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,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()
|
||||
|
|
Loading…
Reference in New Issue