Skip to content

Commit

Permalink
Add Tamil language
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Dec 26, 2024
1 parent e3f7a39 commit 075ce71
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions frontend/src/lib/utils/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
});

Expand All @@ -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));
}

Expand Down
3 changes: 3 additions & 0 deletions leaflet/src/utils/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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);
});

Expand All @@ -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));
}
}
Expand Down
2 changes: 2 additions & 0 deletions server/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion utils/src/i18n-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
4 changes: 4 additions & 0 deletions utils/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
});

Expand All @@ -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));
}
}
Expand All @@ -54,6 +57,7 @@ export function getLocalizedLanguageList(): Record<string, string> {
"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" })
};
};
1 change: 1 addition & 0 deletions utils/src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions utils/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 5 additions & 1 deletion utils/src/i18n/ta.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"i18n": {
"language-ta": "தமிழ்"
}
}

0 comments on commit 075ce71

Please sign in to comment.