diff --git a/utils.py b/utils.py index 9d2dabce9..602bf5417 100644 --- a/utils.py +++ b/utils.py @@ -2579,7 +2579,7 @@ def getActorLanguagesList(actorJson: {}) -> []: if not isinstance(propertyValue['value'], list): continue if propertyValue['type'] != 'PropertyValue': - continue + continue return propertyValue['value'] return [] diff --git a/webapp_profile.py b/webapp_profile.py index f95827046..3572decfd 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -1779,7 +1779,7 @@ def _htmlEditProfileOptions(manuallyApprovesFollowers: str, def _getSupportedLanguages(baseDir: str) -> str: """Returns a list of supported languages """ - languagesStr = '' + langList = [] for subdir, dirs, files in os.walk(baseDir + '/translations'): for f in files: if not f.endswith('.json'): @@ -1787,11 +1787,17 @@ def _getSupportedLanguages(baseDir: str) -> str: langStr = f.split('.')[0] if len(langStr) != 2: continue - if languagesStr: - languagesStr += ' / ' + langStr - else: - languagesStr = langStr + langList.append(langStr) break + if not langList: + return '' + langList.sort() + languagesStr = '' + for lang in langList: + if languagesStr: + languagesStr += ' / ' + lang + else: + languagesStr = lang return languagesStr