mirror of
https://github.com/akuker/RASCSI.git
synced 2025-02-16 19:31:09 +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
|
||||
"""
|
||||
locales = BABEL.list_translations()
|
||||
locales.append(Locale("en"))
|
||||
sorted_locales = sorted(locales, key=lambda x: x.language)
|
||||
return sorted_locales
|
||||
locales = [
|
||||
{"language": x.language, "display_name": x.display_name}
|
||||
for x in [*BABEL.list_translations(), Locale("en")]
|
||||
]
|
||||
|
||||
return sorted(locales, key=lambda x: x["language"])
|
||||
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
|
Loading…
x
Reference in New Issue
Block a user