Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(i18n): add Polish
Elian Doran6c2afc086c52
diff --git a/apps/client/src/widgets/collections/calendar/index.tsx b/apps/client/src/widgets/collections/calendar/index.tsxindex 493640d25c..9d1721a97a 100644--- a/apps/client/src/widgets/collections/calendar/index.tsx+++ b/apps/client/src/widgets/collections/calendar/index.tsx@@ -1,27 +1,29 @@-import { DateSelectArg, EventChangeArg, EventMountArg, EventSourceFuncArg, LocaleInput, PluginDef } from "@fullcalendar/core/index.js";-import { ViewModeProps } from "../interface";-import Calendar from "./calendar";-import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";import "./index.css";-import { useNoteLabel, useNoteLabelBoolean, useResizeObserver, useSpacedUpdate, useTriliumEvent, useTriliumOption, useTriliumOptionInt } from "../../react/hooks";-import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";+import { Calendar as FullCalendar } from "@fullcalendar/core";-import { parseStartEndDateFromEvent, parseStartEndTimeFromEvent } from "./utils";-import dialog from "../../../services/dialog";-import { t } from "../../../services/i18n";-import { buildEvents, buildEventsForCalendar } from "./event_builder";-import { changeEvent, newEvent } from "./api";-import froca from "../../../services/froca";-import date_notes from "../../../services/date_notes";-import appContext from "../../../components/app_context";+import { DateSelectArg, EventChangeArg, EventMountArg, EventSourceFuncArg, LocaleInput, PluginDef } from "@fullcalendar/core/index.js";import { DateClickArg } from "@fullcalendar/interaction";+import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";+import { RefObject } from "preact";+import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";++import appContext from "../../../components/app_context";import FNote from "../../../entities/fnote";-import Button, { ButtonGroup } from "../../react/Button";+import date_notes from "../../../services/date_notes";+import dialog from "../../../services/dialog";+import froca from "../../../services/froca";+import { t } from "../../../services/i18n";+import { isMobile } from "../../../services/utils";import ActionButton from "../../react/ActionButton";-import { RefObject } from "preact";+import Button, { ButtonGroup } from "../../react/Button";+import { useNoteLabel, useNoteLabelBoolean, useResizeObserver, useSpacedUpdate, useTriliumEvent, useTriliumOption, useTriliumOptionInt } from "../../react/hooks";import TouchBar, { TouchBarButton, TouchBarLabel, TouchBarSegmentedControl, TouchBarSpacer } from "../../react/TouchBar";+import { ViewModeProps } from "../interface";+import { changeEvent, newEvent } from "./api";+import Calendar from "./calendar";import { openCalendarContextMenu } from "./context_menu";-import { isMobile } from "../../../services/utils";+import { buildEvents, buildEventsForCalendar } from "./event_builder";+import { parseStartEndDateFromEvent, parseStartEndTimeFromEvent } from "./utils";interface CalendarViewData {@@ -59,7 +61,7 @@ const CALENDAR_VIEWS = [previousText: t("calendar.month_previous"),nextText: t("calendar.month_next")}-]+];const SUPPORTED_CALENDAR_VIEW_TYPE = CALENDAR_VIEWS.map(v => v.type);@@ -75,6 +77,7 @@ export const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, (() => Promise<{ deru: () => import("@fullcalendar/core/locales/ru"),ja: () => import("@fullcalendar/core/locales/ja"),pt: () => import("@fullcalendar/core/locales/pt"),+ pl: () => import("@fullcalendar/core/locales/pl"),"pt_br": () => import("@fullcalendar/core/locales/pt-br"),uk: () => import("@fullcalendar/core/locales/uk"),en: null,@@ -102,9 +105,9 @@ export default function CalendarView({ note, noteIds }: ViewModeProps<CalendarViconst eventBuilder = useMemo(() => {if (!isCalendarRoot) {return async () => await buildEvents(noteIds);- } else {- return async (e: EventSourceFuncArg) => await buildEventsForCalendar(note, e);- }+ }+ return async (e: EventSourceFuncArg) => await buildEventsForCalendar(note, e);+}, [isCalendarRoot, noteIds]);const plugins = usePlugins(isEditable, isCalendarRoot);@@ -178,7 +181,7 @@ function CalendarHeader({ calendarRef }: { calendarRef: RefObject<FullCalendar><ActionButton icon="bx bx-chevron-right" text={currentViewData?.nextText ?? ""} frame onClick={() => calendarRef.current?.next()} /></ButtonGroup></div>- )+ );}function usePlugins(isEditable: boolean, isCalendarRoot: boolean) {@@ -293,7 +296,7 @@ function useEventDisplayCustomization(parentNote: FNote) {if (promotedAttributes) {let promotedAttributesHtml = "";for (const [name, value] of promotedAttributes) {- promotedAttributesHtml = promotedAttributesHtml + /*html*/`\+ promotedAttributesHtml = `${promotedAttributesHtml /*html*/}\<div class="promoted-attribute"><span class="promoted-attribute-name">${name}</span>: <span class="promoted-attribute-value">${value}</span></div>`;diff --git a/apps/client/src/widgets/type_widgets/MindMap.tsx b/apps/client/src/widgets/type_widgets/MindMap.tsxindex 3b56313385..8c6b36eb7a 100644--- a/apps/client/src/widgets/type_widgets/MindMap.tsx+++ b/apps/client/src/widgets/type_widgets/MindMap.tsx@@ -37,6 +37,7 @@ const LOCALE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, Options["locale"] | null>it: "it",ja: "ja",pt: "pt",+ pl: null,pt_br: "pt",ro: "ro",ru: "ru",diff --git a/apps/client/src/widgets/type_widgets/canvas/i18n.ts b/apps/client/src/widgets/type_widgets/canvas/i18n.tsindex 47324abfcf..ba044032b4 100644--- a/apps/client/src/widgets/type_widgets/canvas/i18n.ts+++ b/apps/client/src/widgets/type_widgets/canvas/i18n.ts@@ -13,6 +13,7 @@ export const LANGUAGE_MAPPINGS: Record<DISPLAYABLE_LOCALE_IDS, Language["code"]it: "it-IT",ja: "ja-JP",pt: "pt-PT",+ pl: "pl-PL",pt_br: "pt-BR",ro: "ro-RO",ru: "ru-RU",diff --git a/apps/server-e2e/src/note_types/pdf.spec.ts b/apps/server-e2e/src/note_types/pdf.spec.tsindex 99fe02173f..4d5543fda7 100644--- a/apps/server-e2e/src/note_types/pdf.spec.ts+++ b/apps/server-e2e/src/note_types/pdf.spec.ts@@ -70,6 +70,20 @@ test("Attachments listing works", async ({ page, context }) => {await expect(attachmentsList.locator(".pdf-attachment-item")).toHaveCount(0);});+test("Download original PDF works", async ({ page, context }) => {+ const app = new App(page, context);+ await app.goto();+ await app.goToNoteInNewTab("Dacia Logan.pdf");+ const pdfHelper = new PdfHelper(app);+ await pdfHelper.toBeInitialized();++ const [ download ] = await Promise.all([+ page.waitForEvent("download"),+ app.currentNoteSplit.locator(".icon-action.bx.bx-download").click()+ ]);+ expect(download).toBeDefined();+});+test("Layers listing works", async ({ page, context }) => {const app = new App(page, context);await app.goto();@@ -108,4 +122,8 @@ class PdfHelper {async expectPageToBe(expectedPageNumber: number) {await expect(this.contentFrame.locator("#pageNumber")).toHaveValue(`${expectedPageNumber}`);}++ async toBeInitialized() {+ await expect(this.contentFrame.locator("#pageNumber")).toBeVisible();+ }}diff --git a/packages/commons/src/lib/dayjs.ts b/packages/commons/src/lib/dayjs.tsindex fd9de68428..7ed1d85513 100644--- a/packages/commons/src/lib/dayjs.ts+++ b/packages/commons/src/lib/dayjs.ts@@ -47,6 +47,7 @@ export const DAYJS_LOADER: Record<LOCALE_IDS, () => Promise<typeof import("dayjs"ku": () => import("dayjs/locale/ku.js"),"pt_br": () => import("dayjs/locale/pt-br.js"),"pt": () => import("dayjs/locale/pt.js"),+ "pl": () => import("dayjs/locale/pl.js"),"ro": () => import("dayjs/locale/ro.js"),"ru": () => import("dayjs/locale/ru.js"),"tw": () => import("dayjs/locale/zh-tw.js"),diff --git a/packages/commons/src/lib/i18n.ts b/packages/commons/src/lib/i18n.tsindex 9003ae786e..ac005c6456 100644--- a/packages/commons/src/lib/i18n.ts+++ b/packages/commons/src/lib/i18n.ts@@ -23,6 +23,7 @@ const UNSORTED_LOCALES = [{ id: "ja", name: "日本語", electronLocale: "ja" },{ id: "pt_br", name: "Português (Brasil)", electronLocale: "pt_BR" },{ id: "pt", name: "Português (Portugal)", electronLocale: "pt_PT" },+ { id: "pl", name: "Polski", electronLocale: "pl" },{ id: "ro", name: "Română", electronLocale: "ro" },{ id: "ru", name: "Русский", electronLocale: "ru" },{ id: "tw", name: "繁體中文", electronLocale: "zh_TW" },