feat(i18n): add support for Hindi

This commit is contained in:
Elian Doran 2026-02-22 21:35:14 +02:00
parent 83fc82a615
commit f380df9c01
No known key found for this signature in database
8 changed files with 14 additions and 3 deletions

View File

@ -79,6 +79,7 @@ export const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, (() => Promise<{ de
es: () => import("@fullcalendar/core/locales/es"),
fr: () => import("@fullcalendar/core/locales/fr"),
it: () => import("@fullcalendar/core/locales/it"),
hi: () => import("@fullcalendar/core/locales/hi"),
ga: null,
cn: () => import("@fullcalendar/core/locales/zh-cn"),
tw: () => import("@fullcalendar/core/locales/zh-tw"),

View File

@ -36,6 +36,7 @@ const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, Options["locale"] | null>
fr: "fr",
ga: null,
it: "it",
hi: null,
ja: "ja",
pt: "pt",
pl: null,

View File

@ -23,8 +23,8 @@ describe("Canvas i18n", () => {
if (locale.contentOnly || locale.devOnly) continue;
const languageCode = LANGUAGE_MAPPINGS[locale.id];
if (languageCode && !supportedLanguageCodes.has(languageCode)) {
console.log("Supported locales:", Array.from(supportedLanguageCodes.values()).join(", "));
expect.fail(`Unable to find locale for ${locale.id} -> ${languageCode}.`);
const supportdLocales = Array.from(supportedLanguageCodes.values()).join(", ");
expect.fail(`Unable to find locale for ${locale.id} -> ${languageCode}, supported locales: ${supportdLocales}`);
}
}
});

View File

@ -12,6 +12,7 @@ export const LANGUAGE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, Language["code"]
fr: "fr-FR",
ga: null,
it: "it-IT",
hi: "hi-IN",
ja: "ja-JP",
pt: "pt-PT",
pl: "pl-PL",

View File

@ -46,6 +46,11 @@ const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, LocaleMapping | null> = {
coreTranslation: () => import("ckeditor5/translations/it.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/it.js"),
},
hi: {
languageCode: "hi",
coreTranslation: () => import("ckeditor5/translations/hi.js"),
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/hi.js"),
},
ja: {
languageCode: "ja",
coreTranslation: () => import("ckeditor5/translations/ja.js"),

View File

@ -44,6 +44,7 @@ export const DAYJS_LOADER: Record<LOCALE_IDS, () => Promise<typeof import("dayjs
"ga": () => import("dayjs/locale/ga.js"),
"it": () => import("dayjs/locale/it.js"),
"he": () => import("dayjs/locale/he.js"),
"hi": () => import("dayjs/locale/hi.js"),
"ja": () => import("dayjs/locale/ja.js"),
"ku": () => import("dayjs/locale/ku.js"),
"pt_br": () => import("dayjs/locale/pt-br.js"),

View File

@ -21,6 +21,7 @@ const UNSORTED_LOCALES = [
{ id: "fr", name: "Français", electronLocale: "fr" },
{ id: "ga", name: "Gaeilge", electronLocale: "en" },
{ id: "it", name: "Italiano", electronLocale: "it" },
{ id: "hi", name: "हिन्दी", electronLocale: "hi" },
{ id: "ja", name: "日本語", electronLocale: "ja" },
{ id: "pt_br", name: "Português (Brasil)", electronLocale: "pt_BR" },
{ id: "pt", name: "Português (Portugal)", electronLocale: "pt_PT" },

View File

@ -11,7 +11,8 @@ const watchMode = process.argv.includes("--watch");
const LOCALE_MAPPINGS: Record<string, string> = {
"es": "es-ES",
"ga": "ga-IE"
"ga": "ga-IE",
"hi": "hi-IN"
};
async function main() {