Reformat all files with prettier

This commit is contained in:
Pieter Vander Vennet 2022-09-08 21:40:48 +02:00
parent e22d189376
commit b541d3eab4
382 changed files with 50893 additions and 35566 deletions

View file

@ -1,16 +1,14 @@
import {UIEventSource} from "../../Logic/UIEventSource";
import {LocalStorageSource} from "../../Logic/Web/LocalStorageSource";
import {Utils} from "../../Utils";
import {QueryParameters} from "../../Logic/Web/QueryParameters";
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 {
public static showLinkToWeblate: UIEventSource<boolean> = new UIEventSource<boolean>(false)
public static language: UIEventSource<string> = Locale.setup()
public static showLinkToWeblate: UIEventSource<boolean> = new UIEventSource<boolean>(false);
public static language: UIEventSource<string> = Locale.setup();
private static setup() {
const source = LocalStorageSource.Get('language', "en");
const source = LocalStorageSource.Get("language", "en")
if (!Utils.runningFromConsole) {
// @ts-ignore
window.setLanguage = function (language: string) {
@ -18,17 +16,21 @@ export default class Locale {
}
}
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."),
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
)
QueryParameters.GetBooleanQueryParameter("fs-translation-mode",false,"If set, will show a translation button next to every string.")
.addCallbackAndRunD(tr => {
Locale.showLinkToWeblate.setData(Locale.showLinkToWeblate.data || tr);
QueryParameters.GetBooleanQueryParameter(
"fs-translation-mode",
false,
"If set, will show a translation button next to every string."
).addCallbackAndRunD((tr) => {
Locale.showLinkToWeblate.setData(Locale.showLinkToWeblate.data || tr)
})
return source;
return source
}
}