forked from MapComplete/MapComplete
Add language control parameter
This commit is contained in:
parent
40c1366ad0
commit
327649c040
2 changed files with 9 additions and 0 deletions
|
@ -19,6 +19,10 @@ the URL-parameters are stated in the part between the `?` and the `#`. There are
|
||||||
|
|
||||||
Finally, the URL-hash is the part after the `#`. It is `node/1234` in this case.
|
Finally, the URL-hash is the part after the `#`. It is `node/1234` in this case.
|
||||||
|
|
||||||
|
language
|
||||||
|
----------
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
download-control-toggle
|
download-control-toggle
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {UIEventSource} from "../../Logic/UIEventSource";
|
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||||
import {LocalStorageSource} from "../../Logic/Web/LocalStorageSource";
|
import {LocalStorageSource} from "../../Logic/Web/LocalStorageSource";
|
||||||
import {Utils} from "../../Utils";
|
import {Utils} from "../../Utils";
|
||||||
|
import {QueryParameters} from "../../Logic/Web/QueryParameters";
|
||||||
|
|
||||||
|
|
||||||
export default class Locale {
|
export default class Locale {
|
||||||
|
@ -14,6 +15,10 @@ export default class Locale {
|
||||||
window.setLanguage = function (language: string) {
|
window.setLanguage = function (language: string) {
|
||||||
source.setData(language)
|
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;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue