svelte-i18n dem Projekt hinzugefügt für die Möglichkeit, statische Texte sauberer an einer zentralen Stelle zu pflegen. Über den Language-Chooser wird die aktuelle locale der Übersetzungen auch gleich mit umgeschaltet.

This commit is contained in:
2022-06-01 08:02:50 +02:00
parent 87aa1689f3
commit aaf2860714
9 changed files with 147 additions and 10 deletions

View File

@@ -2,6 +2,8 @@ import App from "./components/App.svelte"
import { location } from "./store"
import { apiBaseURL } from "./config"
import "./i18n"
console.log("API Base: ", apiBaseURL)
// update location store
@@ -32,9 +34,7 @@ if (typeof history !== "undefined") {
if (typeof Proxy !== "undefined") {
// modern browser
const historyApply = (target, thisArg, argumentsList) => {
publishLocation(
argumentsList && argumentsList.length >= 2 && argumentsList[2]
)
publishLocation(argumentsList && argumentsList.length >= 2 && argumentsList[2])
Reflect.apply(target, thisArg, argumentsList)
}
@@ -54,11 +54,7 @@ if (typeof history !== "undefined") {
publishLocation(url)
return pushStateFn.apply(history, arguments)
}
history.replaceState = function (
data: any,
title: string,
url?: string
) {
history.replaceState = function (data: any, title: string, url?: string) {
publishLocation(url)
return replaceStateFn.apply(history, arguments)
}