mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server: Add endpoint to get list of locales
This commit is contained in:
parent
6871216649
commit
51afb63e25
@ -129,6 +129,20 @@ function getUserThemes() {
|
|||||||
return ret;
|
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) {
|
function isAllowed(name: string) {
|
||||||
return ALLOWED_OPTIONS.has(name)
|
return ALLOWED_OPTIONS.has(name)
|
||||||
|| name.startsWith("keyboardShortcuts")
|
|| name.startsWith("keyboardShortcuts")
|
||||||
@ -140,5 +154,6 @@ export default {
|
|||||||
getOptions,
|
getOptions,
|
||||||
updateOption,
|
updateOption,
|
||||||
updateOptions,
|
updateOptions,
|
||||||
getUserThemes
|
getUserThemes,
|
||||||
|
getSupportedLocales
|
||||||
};
|
};
|
||||||
|
@ -217,6 +217,7 @@ function register(app: express.Application) {
|
|||||||
apiRoute(PUT, '/api/options/:name/:value*', optionsApiRoute.updateOption);
|
apiRoute(PUT, '/api/options/:name/:value*', optionsApiRoute.updateOption);
|
||||||
apiRoute(PUT, '/api/options', optionsApiRoute.updateOptions);
|
apiRoute(PUT, '/api/options', optionsApiRoute.updateOptions);
|
||||||
apiRoute(GET, '/api/options/user-themes', optionsApiRoute.getUserThemes);
|
apiRoute(GET, '/api/options/user-themes', optionsApiRoute.getUserThemes);
|
||||||
|
apiRoute(GET, '/api/options/locales', optionsApiRoute.getSupportedLocales);
|
||||||
|
|
||||||
apiRoute(PST, '/api/password/change', passwordApiRoute.changePassword);
|
apiRoute(PST, '/api/password/change', passwordApiRoute.changePassword);
|
||||||
apiRoute(PST, '/api/password/reset', passwordApiRoute.resetPassword);
|
apiRoute(PST, '/api/password/reset', passwordApiRoute.resetPassword);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user