diff --git a/frontend/src/lib/utils/i18n.ts b/frontend/src/lib/utils/i18n.ts index 487bafe8..45440514 100644 --- a/frontend/src/lib/utils/i18n.ts +++ b/frontend/src/lib/utils/i18n.ts @@ -3,6 +3,7 @@ import { type i18n } from "i18next"; import { defineComponent, ref, type Directive } from "vue"; import messagesEn from "../../i18n/en.json"; import messagesDe from "../../i18n/de.json"; +import messagesEs from "../../i18n/es.json"; import messagesNbNo from "../../i18n/nb-NO.json"; import messagesRu from "../../i18n/ru.json"; import { LANG_COOKIE, LANG_QUERY, decodeQueryString, getAcceptHotI18n, getRawI18n, onI18nReady, setCurrentUnitsGetter } from "facilmap-utils"; @@ -14,6 +15,7 @@ const namespace = "facilmap-frontend"; onI18nReady((i18n) => { i18n.addResourceBundle("en", namespace, messagesEn); i18n.addResourceBundle("de", namespace, messagesDe); + i18n.addResourceBundle("es", namespace, messagesEs); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); }); @@ -21,6 +23,7 @@ onI18nReady((i18n) => { if (import.meta.hot) { import.meta.hot!.accept(`../../i18n/en.json`, getAcceptHotI18n("en", namespace)); import.meta.hot!.accept(`../../i18n/de.json`, getAcceptHotI18n("de", namespace)); + import.meta.hot!.accept(`../../i18n/es.json`, getAcceptHotI18n("es", namespace)); import.meta.hot!.accept(`../../i18n/nb-NO.json`, getAcceptHotI18n("nb-NO", namespace)); import.meta.hot!.accept(`../../i18n/ru.json`, getAcceptHotI18n("ru", namespace)); } diff --git a/leaflet/src/utils/i18n.ts b/leaflet/src/utils/i18n.ts index 4a3198a1..83e4d112 100644 --- a/leaflet/src/utils/i18n.ts +++ b/leaflet/src/utils/i18n.ts @@ -2,6 +2,7 @@ import type { i18n } from "i18next"; import messagesDe from "../i18n/de.json"; import messagesEn from "../i18n/en.json"; +import messagesEs from "../i18n/es.json"; import messagesNbNo from "../i18n/nb-NO.json"; import messagesRu from "../i18n/ru.json"; import { getAcceptHotI18n, getRawI18n, onI18nReady } from "facilmap-utils"; @@ -11,6 +12,7 @@ const namespace = "facilmap-leaflet"; onI18nReady((i18n) => { i18n.addResourceBundle("en", namespace, messagesEn); i18n.addResourceBundle("de", namespace, messagesDe); + i18n.addResourceBundle("es", namespace, messagesEs); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); }); @@ -19,6 +21,7 @@ if (import.meta.hot) { if (import.meta.hot) { import.meta.hot!.accept(`../i18n/en.json`, getAcceptHotI18n("en", namespace)); import.meta.hot!.accept(`../i18n/de.json`, getAcceptHotI18n("de", namespace)); + import.meta.hot!.accept(`../i18n/es.json`, getAcceptHotI18n("es", namespace)); import.meta.hot!.accept(`../i18n/nb-NO.json`, getAcceptHotI18n("nb-NO", namespace)); import.meta.hot!.accept(`../i18n/ru.json`, getAcceptHotI18n("ru", namespace)); } diff --git a/server/src/i18n.ts b/server/src/i18n.ts index 6e16eed0..eba260b6 100644 --- a/server/src/i18n.ts +++ b/server/src/i18n.ts @@ -1,6 +1,7 @@ import { defaultI18nGetter, getRawI18n, onI18nReady, setLanguageDetector, setI18nGetter, isCustomLanguageDetector, isCustomI18nGetter, LANG_QUERY, LANG_COOKIE, setCurrentUnitsGetter } from "facilmap-utils"; import messagesEn from "./i18n/en.json"; import messagesDe from "./i18n/de.json"; +import messagesEs from "./i18n/es.json"; import messagesNbNo from "./i18n/nb-NO.json"; import messagesRu from "./i18n/ru.json"; import type { i18n } from "i18next"; @@ -39,6 +40,7 @@ declare module 'domain' { onI18nReady((i18n) => { i18n.addResourceBundle("en", namespace, messagesEn); i18n.addResourceBundle("de", namespace, messagesDe); + i18n.addResourceBundle("es", namespace, messagesEs); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); }); diff --git a/utils/src/i18n-utils.ts b/utils/src/i18n-utils.ts index 6f3747d0..c0e071bd 100644 --- a/utils/src/i18n-utils.ts +++ b/utils/src/i18n-utils.ts @@ -2,7 +2,7 @@ import { Units } from "facilmap-types"; import i18next, { type CustomPluginOptions, type Module, type Newable, type i18n } from "i18next"; import LanguageDetector from "i18next-browser-languagedetector"; -export const LANGUAGES = ["en", "de", "nb-NO", "ru"]; +export const LANGUAGES = ["en", "de", "es", "nb-NO", "ru"]; export const DEFAULT_LANGUAGE = "en"; diff --git a/utils/src/i18n.ts b/utils/src/i18n.ts index ffa16bdb..3f2c66f3 100644 --- a/utils/src/i18n.ts +++ b/utils/src/i18n.ts @@ -3,6 +3,7 @@ import type { i18n } from "i18next"; import { getAcceptHotI18n, getRawI18n, onI18nReady } from "./i18n-utils"; import messagesDe from "./i18n/de.json"; import messagesEn from "./i18n/en.json"; +import messagesEs from "./i18n/es.json"; import messagesNbNo from "./i18n/nb-NO.json"; import messagesRu from "./i18n/ru.json"; @@ -11,6 +12,7 @@ const namespace = "facilmap-utils"; onI18nReady((i18n) => { i18n.addResourceBundle("en", namespace, messagesEn); i18n.addResourceBundle("de", namespace, messagesDe); + i18n.addResourceBundle("es", namespace, messagesEs); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); }); @@ -19,6 +21,7 @@ if (import.meta.hot) { if (import.meta.hot) { import.meta.hot!.accept(`./i18n/en.json`, getAcceptHotI18n("en", namespace)); import.meta.hot!.accept(`./i18n/de.json`, getAcceptHotI18n("de", namespace)); + import.meta.hot!.accept(`./i18n/es.json`, getAcceptHotI18n("es", namespace)); import.meta.hot!.accept(`./i18n/nb-NO.json`, getAcceptHotI18n("nb-NO", namespace)); import.meta.hot!.accept(`./i18n/ru.json`, getAcceptHotI18n("ru", namespace)); } @@ -37,6 +40,7 @@ export function getLocalizedLanguageList(): Record { return { "en": getI18n().t("i18n.language-en", { lng: "en" }), "de": getI18n().t("i18n.language-de", { lng: "de" }), + "es": getI18n().t("i18n.language-es", { lng: "es" }), "nb-NO": getI18n().t("i18n.language-nb-no", { lng: "nb-NO" }), "ru": getI18n().t("i18n.language-ru", { lng: "ru" }) }; diff --git a/utils/src/i18n/de.json b/utils/src/i18n/de.json index 7bb754af..dd36dfef 100644 --- a/utils/src/i18n/de.json +++ b/utils/src/i18n/de.json @@ -17,6 +17,7 @@ "i18n": { "language-en": "Englisch", "language-de": "Deutsch", + "language-es": "Spanisch", "language-nb-no": "Norwegisch Bokmål (Norwegen)", "language-ru": "Russian" }, diff --git a/utils/src/i18n/en.json b/utils/src/i18n/en.json index e3cf0b32..2b7be860 100644 --- a/utils/src/i18n/en.json +++ b/utils/src/i18n/en.json @@ -17,6 +17,7 @@ "i18n": { "language-en": "English", "language-de": "German", + "language-es": "Spanish", "language-nb-no": "Norwegian Bokmål (Norway)", "language-ru": "Russian" },