mirror of
https://github.com/zadam/trilium.git
synced 2025-12-01 04:54:25 +01:00
feat(i18n): add English (United Kingdom)
This commit is contained in:
parent
ba980aa93f
commit
030582b2d5
@ -77,6 +77,7 @@ export const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, (() => Promise<{ de
|
|||||||
"pt_br": () => import("@fullcalendar/core/locales/pt-br"),
|
"pt_br": () => import("@fullcalendar/core/locales/pt-br"),
|
||||||
uk: () => import("@fullcalendar/core/locales/uk"),
|
uk: () => import("@fullcalendar/core/locales/uk"),
|
||||||
en: null,
|
en: null,
|
||||||
|
"en-GB": () => import("@fullcalendar/core/locales/en-gb"),
|
||||||
"en_rtl": null,
|
"en_rtl": null,
|
||||||
ar: () => import("@fullcalendar/core/locales/ar")
|
ar: () => import("@fullcalendar/core/locales/ar")
|
||||||
};
|
};
|
||||||
|
|||||||
@ -28,6 +28,7 @@ const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, Options["locale"] | null>
|
|||||||
de: null,
|
de: null,
|
||||||
en: "en",
|
en: "en",
|
||||||
en_rtl: "en",
|
en_rtl: "en",
|
||||||
|
"en-GB": "en",
|
||||||
es: "es",
|
es: "es",
|
||||||
fr: "fr",
|
fr: "fr",
|
||||||
it: "it",
|
it: "it",
|
||||||
|
|||||||
@ -22,6 +22,7 @@ describe("Canvas i18n", () => {
|
|||||||
if (locale.contentOnly || locale.devOnly) continue;
|
if (locale.contentOnly || locale.devOnly) continue;
|
||||||
const languageCode = LANGUAGE_MAPPINGS[locale.id];
|
const languageCode = LANGUAGE_MAPPINGS[locale.id];
|
||||||
if (!supportedLanguageCodes.has(languageCode)) {
|
if (!supportedLanguageCodes.has(languageCode)) {
|
||||||
|
console.log("Supported locales:", Array.from(supportedLanguageCodes.values()).join(", "));
|
||||||
expect.fail(`Unable to find locale for ${locale.id} -> ${languageCode}.`)
|
expect.fail(`Unable to find locale for ${locale.id} -> ${languageCode}.`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
|
import { Language } from "@excalidraw/excalidraw/i18n";
|
||||||
import type { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
|
import type { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";
|
||||||
|
|
||||||
export const LANGUAGE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, string | null> = {
|
export const LANGUAGE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, Language["code"] | null> = {
|
||||||
ar: "ar-SA",
|
ar: "ar-SA",
|
||||||
cn: "zh-CN",
|
cn: "zh-CN",
|
||||||
de: "de-DE",
|
de: "de-DE",
|
||||||
en: "en",
|
en: "en",
|
||||||
|
"en-GB": "en",
|
||||||
en_rtl: "en",
|
en_rtl: "en",
|
||||||
es: "es-ES",
|
es: "es-ES",
|
||||||
fr: "fr-FR",
|
fr: "fr-FR",
|
||||||
|
|||||||
@ -7,11 +7,13 @@ import hidden_subtree from "./hidden_subtree.js";
|
|||||||
import { LOCALES, type Locale, type LOCALE_IDS } from "@triliumnext/commons";
|
import { LOCALES, type Locale, type LOCALE_IDS } from "@triliumnext/commons";
|
||||||
import dayjs, { Dayjs } from "dayjs";
|
import dayjs, { Dayjs } from "dayjs";
|
||||||
|
|
||||||
|
// When adding a new locale, prefer the version with hyphen instead of underscore.
|
||||||
export const DAYJS_LOADER: Record<LOCALE_IDS, () => Promise<typeof import("dayjs/locale/en.js")>> = {
|
export const DAYJS_LOADER: Record<LOCALE_IDS, () => Promise<typeof import("dayjs/locale/en.js")>> = {
|
||||||
"ar": () => import("dayjs/locale/ar.js"),
|
"ar": () => import("dayjs/locale/ar.js"),
|
||||||
"cn": () => import("dayjs/locale/zh-cn.js"),
|
"cn": () => import("dayjs/locale/zh-cn.js"),
|
||||||
"de": () => import("dayjs/locale/de.js"),
|
"de": () => import("dayjs/locale/de.js"),
|
||||||
"en": () => import("dayjs/locale/en.js"),
|
"en": () => import("dayjs/locale/en.js"),
|
||||||
|
"en-GB": () => import("dayjs/locale/en-gb.js"),
|
||||||
"en_rtl": () => import("dayjs/locale/en.js"),
|
"en_rtl": () => import("dayjs/locale/en.js"),
|
||||||
"es": () => import("dayjs/locale/es.js"),
|
"es": () => import("dayjs/locale/es.js"),
|
||||||
"fa": () => import("dayjs/locale/fa.js"),
|
"fa": () => import("dayjs/locale/fa.js"),
|
||||||
|
|||||||
@ -10,6 +10,11 @@ interface LocaleMapping {
|
|||||||
const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, LocaleMapping | null> = {
|
const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, LocaleMapping | null> = {
|
||||||
en: null,
|
en: null,
|
||||||
en_rtl: null,
|
en_rtl: null,
|
||||||
|
"en-GB": {
|
||||||
|
languageCode: "en-GB",
|
||||||
|
coreTranslation: () => import("ckeditor5/translations/en-gb.js"),
|
||||||
|
premiumFeaturesTranslation: () => import("ckeditor5-premium-features/translations/en-gb.js"),
|
||||||
|
},
|
||||||
ar: {
|
ar: {
|
||||||
languageCode: "ar",
|
languageCode: "ar",
|
||||||
coreTranslation: () => import("ckeditor5/translations/ar.js"),
|
coreTranslation: () => import("ckeditor5/translations/ar.js"),
|
||||||
|
|||||||
@ -15,6 +15,7 @@ const UNSORTED_LOCALES = [
|
|||||||
{ id: "cn", name: "简体中文", electronLocale: "zh_CN" },
|
{ id: "cn", name: "简体中文", electronLocale: "zh_CN" },
|
||||||
{ id: "de", name: "Deutsch", electronLocale: "de" },
|
{ id: "de", name: "Deutsch", electronLocale: "de" },
|
||||||
{ id: "en", name: "English", electronLocale: "en" },
|
{ id: "en", name: "English", electronLocale: "en" },
|
||||||
|
{ id: "en-GB", name: "English (United Kingdom)", electronLocale: "en_GB" },
|
||||||
{ id: "es", name: "Español", electronLocale: "es" },
|
{ id: "es", name: "Español", electronLocale: "es" },
|
||||||
{ id: "fr", name: "Français", electronLocale: "fr" },
|
{ id: "fr", name: "Français", electronLocale: "fr" },
|
||||||
{ id: "it", name: "Italiano", electronLocale: "it" },
|
{ id: "it", name: "Italiano", electronLocale: "it" },
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user