mirror of
https://github.com/zadam/trilium.git
synced 2025-10-19 22:58:52 +02:00
feat(i18n): add support for Brazilian Portuguese
This commit is contained in:
parent
9f93d30b99
commit
5a767dae34
@ -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":
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user