mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-21 23:29:39 +00:00
Update get_supported_locales to return a JSON serializable result
This commit is contained in:
parent
edf65a8768
commit
4ef2e20b4f
@ -89,10 +89,12 @@ def get_supported_locales():
|
|||||||
"""
|
"""
|
||||||
Returns a list of Locale objects that the Web Interfaces supports
|
Returns a list of Locale objects that the Web Interfaces supports
|
||||||
"""
|
"""
|
||||||
locales = BABEL.list_translations()
|
locales = [
|
||||||
locales.append(Locale("en"))
|
{"language": x.language, "display_name": x.display_name}
|
||||||
sorted_locales = sorted(locales, key=lambda x: x.language)
|
for x in [*BABEL.list_translations(), Locale("en")]
|
||||||
return sorted_locales
|
]
|
||||||
|
|
||||||
|
return sorted(locales, key=lambda x: x["language"])
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals
|
||||||
|
Loading…
Reference in New Issue
Block a user