From 075ce71f621f45924f55b49a3604bb1bc8b8f5ff Mon Sep 17 00:00:00 2001 From: Candid Dauth Date: Thu, 26 Dec 2024 13:10:00 +0300 Subject: [PATCH] Add Tamil language --- frontend/src/lib/utils/i18n.ts | 3 +++ leaflet/src/utils/i18n.ts | 3 +++ server/src/i18n.ts | 2 ++ utils/src/i18n-utils.ts | 2 +- utils/src/i18n.ts | 4 ++++ utils/src/i18n/de.json | 1 + utils/src/i18n/en.json | 1 + utils/src/i18n/ta.json | 6 +++++- 8 files changed, 20 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/utils/i18n.ts b/frontend/src/lib/utils/i18n.ts index ebf1ee51..23d444a9 100644 --- a/frontend/src/lib/utils/i18n.ts +++ b/frontend/src/lib/utils/i18n.ts @@ -8,6 +8,7 @@ import messagesEs from "../../i18n/es.json"; import messagesFr from "../../i18n/fr.json"; import messagesNbNo from "../../i18n/nb-NO.json"; import messagesRu from "../../i18n/ru.json"; +import messagesTa from "../../i18n/ta.json"; import messagesZhHant from "../../i18n/zh-Hant.json"; import { LANG_COOKIE, LANG_QUERY, decodeQueryString, getAcceptHotI18n, getCurrentLanguage, getRawI18n, onI18nReady, setCurrentUnitsGetter } from "facilmap-utils"; import { cookies } from "./cookies"; @@ -23,6 +24,7 @@ onI18nReady((i18n) => { i18n.addResourceBundle("fr", namespace, messagesFr); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); + i18n.addResourceBundle("ta", namespace, messagesTa); i18n.addResourceBundle("zh-Hant", namespace, messagesZhHant); }); @@ -34,6 +36,7 @@ if (import.meta.hot) { import.meta.hot!.accept(`../../i18n/fr.json`, getAcceptHotI18n("fr", namespace)); import.meta.hot!.accept(`../../i18n/nb-NO.json`, getAcceptHotI18n("nb-NO", namespace)); import.meta.hot!.accept(`../../i18n/ru.json`, getAcceptHotI18n("ru", namespace)); + import.meta.hot!.accept(`../../i18n/ta.json`, getAcceptHotI18n("ta", namespace)); import.meta.hot!.accept(`../../i18n/zh-Hant.json`, getAcceptHotI18n("zh-Hant", namespace)); } diff --git a/leaflet/src/utils/i18n.ts b/leaflet/src/utils/i18n.ts index efeabdb5..44bcd79e 100644 --- a/leaflet/src/utils/i18n.ts +++ b/leaflet/src/utils/i18n.ts @@ -7,6 +7,7 @@ import messagesEs from "../i18n/es.json"; import messagesFr from "../i18n/fr.json"; import messagesNbNo from "../i18n/nb-NO.json"; import messagesRu from "../i18n/ru.json"; +import messagesTa from "../i18n/ta.json"; import messagesZhHant from "../i18n/zh-Hant.json"; import { getAcceptHotI18n, getRawI18n, onI18nReady } from "facilmap-utils"; @@ -20,6 +21,7 @@ onI18nReady((i18n) => { i18n.addResourceBundle("fr", namespace, messagesFr); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); + i18n.addResourceBundle("ta", namespace, messagesTa); i18n.addResourceBundle("zh-Hant", namespace, messagesZhHant); }); @@ -32,6 +34,7 @@ if (import.meta.hot) { import.meta.hot!.accept(`../i18n/fr.json`, getAcceptHotI18n("fr", namespace)); import.meta.hot!.accept(`../i18n/nb-NO.json`, getAcceptHotI18n("nb-NO", namespace)); import.meta.hot!.accept(`../i18n/ru.json`, getAcceptHotI18n("ru", namespace)); + import.meta.hot!.accept(`../i18n/ta.json`, getAcceptHotI18n("ta", namespace)); import.meta.hot!.accept(`../i18n/zh-Hant.json`, getAcceptHotI18n("zh-Hant", namespace)); } } diff --git a/server/src/i18n.ts b/server/src/i18n.ts index db312037..44d7d80f 100644 --- a/server/src/i18n.ts +++ b/server/src/i18n.ts @@ -6,6 +6,7 @@ import messagesEs from "./i18n/es.json"; import messagesFr from "./i18n/fr.json"; import messagesNbNo from "./i18n/nb-NO.json"; import messagesRu from "./i18n/ru.json"; +import messagesTa from "./i18n/ta.json"; import messagesZhHant from "./i18n/zh-Hant.json"; import type { i18n } from "i18next"; import type { Domain } from "domain"; @@ -48,6 +49,7 @@ onI18nReady((i18n) => { i18n.addResourceBundle("fr", namespace, messagesFr); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); + i18n.addResourceBundle("ta", namespace, messagesTa); i18n.addResourceBundle("zh-Hant", namespace, messagesZhHant); }); diff --git a/utils/src/i18n-utils.ts b/utils/src/i18n-utils.ts index 736f5d79..b89842b6 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", "cs", "de", "es", "fr", "nb-NO", "ru", "zh-Hant"]; +export const LANGUAGES = ["en", "cs", "de", "es", "fr", "nb-NO", "ru", "ta", "zh-Hant"]; export const DEFAULT_LANGUAGE = "en"; diff --git a/utils/src/i18n.ts b/utils/src/i18n.ts index 3b920b83..1abf8dbe 100644 --- a/utils/src/i18n.ts +++ b/utils/src/i18n.ts @@ -8,6 +8,7 @@ import messagesEs from "./i18n/es.json"; import messagesFr from "./i18n/fr.json"; import messagesNbNo from "./i18n/nb-NO.json"; import messagesRu from "./i18n/ru.json"; +import messagesTa from "./i18n/ta.json"; import messagesZhHant from "./i18n/zh-Hant.json"; const namespace = "facilmap-utils"; @@ -20,6 +21,7 @@ onI18nReady((i18n) => { i18n.addResourceBundle("fr", namespace, messagesFr); i18n.addResourceBundle("nb-NO", namespace, messagesNbNo); i18n.addResourceBundle("ru", namespace, messagesRu); + i18n.addResourceBundle("ta", namespace, messagesTa); i18n.addResourceBundle("zh-Hant", namespace, messagesZhHant); }); @@ -32,6 +34,7 @@ if (import.meta.hot) { import.meta.hot!.accept(`./i18n/fr.json`, getAcceptHotI18n("fr", namespace)); import.meta.hot!.accept(`./i18n/nb-NO.json`, getAcceptHotI18n("nb-NO", namespace)); import.meta.hot!.accept(`./i18n/ru.json`, getAcceptHotI18n("ru", namespace)); + import.meta.hot!.accept(`./i18n/ta.json`, getAcceptHotI18n("ta", namespace)); import.meta.hot!.accept(`./i18n/zh-Hant.json`, getAcceptHotI18n("zh-Hant", namespace)); } } @@ -54,6 +57,7 @@ export function getLocalizedLanguageList(): Record { "fr": getI18n().t("i18n.language-fr", { lng: "fr" }), "nb-NO": getI18n().t("i18n.language-nb-no", { lng: "nb-NO" }), "ru": getI18n().t("i18n.language-ru", { lng: "ru" }), + "ta": getI18n().t("i18n.language-ta", { lng: "ta" }), "zh-Hant": getI18n().t("i18n.language-zh-hant", { lng: "zh-Hant" }) }; }; \ No newline at end of file diff --git a/utils/src/i18n/de.json b/utils/src/i18n/de.json index 9359b5d1..941db63d 100644 --- a/utils/src/i18n/de.json +++ b/utils/src/i18n/de.json @@ -22,6 +22,7 @@ "language-fr": "Französisch", "language-nb-no": "Norwegisch Bokmål (Norwegen)", "language-ru": "Russian", + "language-ta": "Tamil", "language-zh-hant": "Chinesisch (traditionell)" }, "objects": { diff --git a/utils/src/i18n/en.json b/utils/src/i18n/en.json index 60e6ef4d..32a3954e 100644 --- a/utils/src/i18n/en.json +++ b/utils/src/i18n/en.json @@ -22,6 +22,7 @@ "language-fr": "French", "language-nb-no": "Norwegian Bokmål (Norway)", "language-ru": "Russian", + "language-ta": "Tamil", "language-zh-hant": "Chinese (Traditional)" }, "objects": { diff --git a/utils/src/i18n/ta.json b/utils/src/i18n/ta.json index 0967ef42..22496361 100644 --- a/utils/src/i18n/ta.json +++ b/utils/src/i18n/ta.json @@ -1 +1,5 @@ -{} +{ + "i18n": { + "language-ta": "தமிழ்" + } +}