server: Add endpoint to get list of locales

This commit is contained in:
Elian Doran
2024-08-11 07:36:09 +03:00
parent 6871216649
commit 51afb63e25
2 changed files with 17 additions and 1 deletions

View File

@@ -129,6 +129,20 @@ function getUserThemes() {
return ret;
}
function getSupportedLocales() {
// TODO: Currently hardcoded, needs to read the lits of available languages.
return [
{
"id": "en",
"name": "English"
},
{
"id": "cn",
"name": "Chinese"
}
];
}
function isAllowed(name: string) {
return ALLOWED_OPTIONS.has(name)
|| name.startsWith("keyboardShortcuts")
@@ -140,5 +154,6 @@ export default {
getOptions,
updateOption,
updateOptions,
getUserThemes
getUserThemes,
getSupportedLocales
};