Now supports running under a sub path

Just set the SPOOLMAN_BASE_PATH environment variable and it should work.

Resolves #95
This commit is contained in:
Donkie
2024-05-10 11:36:33 +02:00
parent fc532ff697
commit bc32f1e890
18 changed files with 158 additions and 43 deletions

View File

@@ -2,6 +2,7 @@ import i18n from "i18next";
import detector from "i18next-browser-languagedetector";
import Backend from "i18next-xhr-backend";
import { initReactI18next } from "react-i18next";
import { getBasePath } from "./utils/url";
interface Language {
name: string;
@@ -106,7 +107,7 @@ i18n
.init({
supportedLngs: Object.keys(languages),
backend: {
loadPath: "/locales/{{lng}}/{{ns}}.json",
loadPath: getBasePath() + "/locales/{{lng}}/{{ns}}.json",
},
defaultNS: "common",
fallbackLng: "en",