feat(i18n): add support for Brazilian Portuguese

This commit is contained in:
Elian Doran 2025-08-24 11:05:52 +03:00
parent 9f93d30b99
commit 5a767dae34
No known key found for this signature in database
3 changed files with 18 additions and 52 deletions

View File

@ -676,6 +676,8 @@ export async function getFullCalendarLocale(locale: string) {
return (await import("@fullcalendar/core/locales/ru")).default;
case "ja":
return (await import("@fullcalendar/core/locales/ja")).default;
case "pt_BR":
return (await import("@fullcalendar/core/locales/pt-br")).default;
case "uk":
return (await import("@fullcalendar/core/locales/uk")).default;
case "en":

View File

@ -18,6 +18,7 @@ const DAYJS_LOADER: Record<LOCALE_IDS, () => Promise<typeof import("dayjs/locale
"he": () => import("dayjs/locale/he.js"),
"ja": () => import("dayjs/locale/ja.js"),
"ku": () => import("dayjs/locale/ku.js"),
"pt_BR": () => import("dayjs/locale/pt_BR.js"),
"ro": () => import("dayjs/locale/ro.js"),
"ru": () => import("dayjs/locale/ru.js"),
"tw": () => import("dayjs/locale/zh-tw.js"),
@ -40,8 +41,10 @@ export async function initializeTranslations() {
});
// Initialize dayjs locale.
const dayjsLocale = await DAYJS_LOADER[locale]();
dayjs.locale(dayjsLocale);
const dayjsLocale = DAYJS_LOADER[locale];
if (dayjsLocale) {
dayjs.locale(await dayjsLocale());
}
}
export function ordinal(date: Dayjs) {

View File

@ -10,56 +10,17 @@ export interface Locale {
}
const UNSORTED_LOCALES: Locale[] = [
{
id: "en",
name: "English",
electronLocale: "en"
},
{
id: "de",
name: "Deutsch",
electronLocale: "de"
},
{
id: "es",
name: "Español",
electronLocale: "es"
},
{
id: "fr",
name: "Français",
electronLocale: "fr"
},
{
id: "cn",
name: "简体中文",
electronLocale: "zh_CN"
},
{
id: "tw",
name: "繁體中文",
electronLocale: "zh_TW"
},
{
id: "ro",
name: "Română",
electronLocale: "ro"
},
{
id: "ru",
name: "Русский",
electronLocale: "ru"
},
{
id: "uk",
name: "Українська",
electronLocale: "uk"
},
{
id: "ja",
name: "日本語",
electronLocale: "ja"
},
{ id: "cn", name: "简体中文", electronLocale: "zh_CN" },
{ id: "de", name: "Deutsch", electronLocale: "de" },
{ id: "en", name: "English", electronLocale: "en" },
{ id: "es", name: "Español", electronLocale: "es" },
{ id: "fr", name: "Français", electronLocale: "fr" },
{ id: "ja", name: "日本語", electronLocale: "ja" },
{ id: "pt_BR", name: "Português (Brasil)", electronLocale: "pt-BR" },
{ id: "ro", name: "Română", electronLocale: "ro" },
{ id: "ru", name: "Русский", electronLocale: "ru" },
{ id: "tw", name: "繁體中文", electronLocale: "zh_TW" },
{ id: "uk", name: "Українська", electronLocale: "uk" },
/*
* Right to left languages