mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-04-30 13:11:37 +03:00
Request language from server
This commit is contained in:
parent
83544ab0f6
commit
63f20bc397
5 changed files with 81 additions and 1 deletions
client/src/api
|
@ -284,4 +284,22 @@ export default class Api {
|
|||
const { path, method } = this.SAFESEARCH_DISABLE;
|
||||
return this.makeRequest(path, method);
|
||||
}
|
||||
|
||||
// Language
|
||||
CURRENT_LANGUAGE = { path: 'i18n/current_language', method: 'GET' };
|
||||
CHANGE_LANGUAGE = { path: 'i18n/change_language', method: 'POST' };
|
||||
|
||||
getCurrentLanguage() {
|
||||
const { path, method } = this.CURRENT_LANGUAGE;
|
||||
return this.makeRequest(path, method);
|
||||
}
|
||||
|
||||
changeLanguage(lang) {
|
||||
const { path, method } = this.CHANGE_LANGUAGE;
|
||||
const parameters = {
|
||||
data: lang,
|
||||
headers: { 'Content-Type': 'text/plain' },
|
||||
};
|
||||
return this.makeRequest(path, method, parameters);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue