mirror of https://gitlab.com/bashrc2/epicyon
Sort languages list
parent
0690c6d844
commit
1c75c14a6a
2
utils.py
2
utils.py
|
@ -2579,7 +2579,7 @@ def getActorLanguagesList(actorJson: {}) -> []:
|
||||||
if not isinstance(propertyValue['value'], list):
|
if not isinstance(propertyValue['value'], list):
|
||||||
continue
|
continue
|
||||||
if propertyValue['type'] != 'PropertyValue':
|
if propertyValue['type'] != 'PropertyValue':
|
||||||
continue
|
continue
|
||||||
return propertyValue['value']
|
return propertyValue['value']
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
|
@ -1779,7 +1779,7 @@ def _htmlEditProfileOptions(manuallyApprovesFollowers: str,
|
||||||
def _getSupportedLanguages(baseDir: str) -> str:
|
def _getSupportedLanguages(baseDir: str) -> str:
|
||||||
"""Returns a list of supported languages
|
"""Returns a list of supported languages
|
||||||
"""
|
"""
|
||||||
languagesStr = ''
|
langList = []
|
||||||
for subdir, dirs, files in os.walk(baseDir + '/translations'):
|
for subdir, dirs, files in os.walk(baseDir + '/translations'):
|
||||||
for f in files:
|
for f in files:
|
||||||
if not f.endswith('.json'):
|
if not f.endswith('.json'):
|
||||||
|
@ -1787,11 +1787,17 @@ def _getSupportedLanguages(baseDir: str) -> str:
|
||||||
langStr = f.split('.')[0]
|
langStr = f.split('.')[0]
|
||||||
if len(langStr) != 2:
|
if len(langStr) != 2:
|
||||||
continue
|
continue
|
||||||
if languagesStr:
|
langList.append(langStr)
|
||||||
languagesStr += ' / ' + langStr
|
|
||||||
else:
|
|
||||||
languagesStr = langStr
|
|
||||||
break
|
break
|
||||||
|
if not langList:
|
||||||
|
return ''
|
||||||
|
langList.sort()
|
||||||
|
languagesStr = ''
|
||||||
|
for lang in langList:
|
||||||
|
if languagesStr:
|
||||||
|
languagesStr += ' / ' + lang
|
||||||
|
else:
|
||||||
|
languagesStr = lang
|
||||||
return languagesStr
|
return languagesStr
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue