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:
12
src/index.ts
12
src/index.ts
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user