Add language control parameter

This commit is contained in:
Pieter Vander Vennet 2021-08-21 20:25:36 +02:00
parent 40c1366ad0
commit 327649c040
2 changed files with 9 additions and 0 deletions

View file

@ -1,6 +1,7 @@
import {UIEventSource} from "../../Logic/UIEventSource";
import {LocalStorageSource} from "../../Logic/Web/LocalStorageSource";
import {Utils} from "../../Utils";
import {QueryParameters} from "../../Logic/Web/QueryParameters";
export default class Locale {
@ -14,6 +15,10 @@ export default class Locale {
window.setLanguage = function (language: string) {
source.setData(language)
}
source.syncWith(
QueryParameters.GetQueryParameter("language", undefined,"The language to display mapcomplete in. Will be ignored in case a logged-in-user did set their language before. If the specified language does not exist, it will default to the first language in the theme."),
true
)
}
return source;
}