mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-29 03:15:27 +00:00
Fix admin editing instance language
Closes #976 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
19bf587dc9
commit
15d186cc25
1 changed files with 6 additions and 2 deletions
|
@ -433,18 +433,22 @@ export default class Settings extends Vue {
|
||||||
RouteName = RouteName;
|
RouteName = RouteName;
|
||||||
|
|
||||||
get instanceLanguages(): string[] {
|
get instanceLanguages(): string[] {
|
||||||
const languageCodes = this.adminSettings.instanceLanguages || [];
|
const languageCodes = [...this.adminSettings.instanceLanguages] || [];
|
||||||
return languageCodes
|
return languageCodes
|
||||||
.map((code) => this.languageForCode(code))
|
.map((code) => this.languageForCode(code))
|
||||||
.filter((language) => language) as string[];
|
.filter((language) => language) as string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
set instanceLanguages(instanceLanguages: string[]) {
|
set instanceLanguages(instanceLanguages: string[]) {
|
||||||
this.adminSettings.instanceLanguages = instanceLanguages
|
const newInstanceLanguages = instanceLanguages
|
||||||
.map((language) => {
|
.map((language) => {
|
||||||
return this.codeForLanguage(language);
|
return this.codeForLanguage(language);
|
||||||
})
|
})
|
||||||
.filter((code) => code !== undefined) as string[];
|
.filter((code) => code !== undefined) as string[];
|
||||||
|
this.adminSettings = {
|
||||||
|
...this.adminSettings,
|
||||||
|
instanceLanguages: newInstanceLanguages,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateSettings(): Promise<void> {
|
async updateSettings(): Promise<void> {
|
||||||
|
|
Loading…
Reference in a new issue