diff --git a/blog.py b/blog.py index 63c9478e7..33498f54d 100644 --- a/blog.py +++ b/blog.py @@ -268,11 +268,11 @@ def _htmlBlogPostContent(debug: bool, session, authorized: bool, personUrl = local_actor_url(http_prefix, nickname, domain_full) actor_json = \ getPersonFromCache(base_dir, personUrl, person_cache, False) - languagesUnderstood = [] + languages_understood = [] if actor_json: - languagesUnderstood = get_actor_languages_list(actor_json) + languages_understood = get_actor_languages_list(actor_json) jsonContent = get_content_from_post(post_json_object, system_language, - languagesUnderstood) + languages_understood) if jsonContent: contentStr = addEmbeddedElements(translate, jsonContent, peertube_instances) diff --git a/languages.py b/languages.py index 2de0ad7ea..108700c99 100644 --- a/languages.py +++ b/languages.py @@ -111,10 +111,10 @@ def understoodPostLanguage(base_dir: str, nickname: str, domain: str, if not actor_json: print('WARN: unable to load actor to check languages ' + personUrl) return False - languagesUnderstood = get_actor_languages_list(actor_json) - if not languagesUnderstood: + languages_understood = get_actor_languages_list(actor_json) + if not languages_understood: return True - for lang in languagesUnderstood: + for lang in languages_understood: if msgObject['contentMap'].get(lang): return True # is the language for this post supported by libretranslate? diff --git a/utils.py b/utils.py index 33fd85f7e..6bc579f8c 100644 --- a/utils.py +++ b/utils.py @@ -78,7 +78,7 @@ def get_actor_languages_list(actor_json: {}) -> []: def get_content_from_post(post_json_object: {}, system_language: str, - languagesUnderstood: []) -> str: + languages_understood: []) -> str: """Returns the content from the post in the given language including searching for a matching entry within contentMap """ @@ -97,7 +97,7 @@ def get_content_from_post(post_json_object: {}, system_language: str, else: # is there a contentMap entry for one of # the understood languages? - for lang in languagesUnderstood: + for lang in languages_understood: if thisPostJson['contentMap'].get(lang): return thisPostJson['contentMap'][lang] else: diff --git a/webapp_post.py b/webapp_post.py index 2000688f8..544a0af36 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -1852,11 +1852,11 @@ def individualPostAsHtml(signing_priv_key_pem: str, personUrl = local_actor_url(http_prefix, nickname, domain_full) actor_json = \ getPersonFromCache(base_dir, personUrl, person_cache, False) - languagesUnderstood = [] + languages_understood = [] if actor_json: - languagesUnderstood = get_actor_languages_list(actor_json) + languages_understood = get_actor_languages_list(actor_json) contentStr = get_content_from_post(post_json_object, system_language, - languagesUnderstood) + languages_understood) if not contentStr: contentStr = \ autoTranslatePost(base_dir, post_json_object,