Compare commits

...

25 Commits

Author SHA1 Message Date
Elian Doran
161238ca11
fix(windows script): add -command flag (#7513)
Some checks are pending
Checks / main (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Dev / Test development (push) Waiting to run
Dev / Build Docker image (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile) (push) Blocked by required conditions
Dev / Check Docker build (Dockerfile.alpine) (push) Blocked by required conditions
/ Check Docker build (Dockerfile) (push) Waiting to run
/ Check Docker build (Dockerfile.alpine) (push) Waiting to run
/ Build Docker images (Dockerfile, ubuntu-24.04-arm, linux/arm/v7) (push) Blocked by required conditions
/ Build Docker images (Dockerfile, ubuntu-24.04-arm, linux/arm/v8) (push) Blocked by required conditions
/ Build Docker images (Dockerfile, ubuntu-24.04-arm, linux/arm64) (push) Blocked by required conditions
/ Build Docker images (Dockerfile.alpine, ubuntu-latest, linux/amd64) (push) Blocked by required conditions
/ Merge manifest lists (push) Blocked by required conditions
playwright / main (push) Waiting to run
Deploy website / Build & deploy website (push) Waiting to run
2025-10-27 18:47:03 +02:00
Elian Doran
4d5267e18b
fix (empty tab): recent notes not showing when creating a empty tab (#7523) 2025-10-27 18:43:31 +02:00
Elian Doran
0fa52907b3
Website static fixes (#7525) 2025-10-27 18:39:20 +02:00
Elian Doran
c4f57f3d15
refactor(website): simplify loop 2025-10-27 18:34:26 +02:00
Elian Doran
6bde264156
fix(website): lang/dir not updating after switching language 2025-10-27 18:31:03 +02:00
Elian Doran
4f72f81a95
chore(website): fix typecheck issues 2025-10-27 18:19:35 +02:00
Elian Doran
c212c5d6ff
Merge remote-tracking branch 'origin/main' into fix/website_static 2025-10-27 18:11:39 +02:00
Elian Doran
f24880d42c
fix(website): incorrect default language 2025-10-27 18:10:21 +02:00
Elian Doran
ee9bf1d47b
fix(website): incorrect lang tag 2025-10-27 18:04:49 +02:00
Elian Doran
b069fab82f
chore(website): use static loading of translations 2025-10-27 17:17:37 +02:00
Elian Doran
d5ce01a65b
Revert "fix(website): missing suspense"
This reverts commit dbfa94a9ee45a7fef43cd97c90df35f85d7bad34.
2025-10-27 16:45:52 +02:00
Elian Doran
dbfa94a9ee
fix(website): missing suspense 2025-10-27 16:35:26 +02:00
Elian Doran
86aaa97809
fix(website): language-specific pages not properly determined 2025-10-27 16:30:03 +02:00
Elian Doran
c4c8fe23a9
fix(website): pages not prerendered 2025-10-27 16:29:44 +02:00
Elian Doran
715fe77db3
Translations update from Hosted Weblate (#7519) 2025-10-27 16:20:42 +02:00
Francis C
40f5abd6e3
Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 100.0% (152 of 152 strings)

Translation: Trilium Notes/Website
Translate-URL: https://hosted.weblate.org/projects/trilium/website/zh_Hant/
2025-10-27 14:18:09 +00:00
Giovi
f3f7e5900b
Translated using Weblate (Italian)
Currently translated at 100.0% (152 of 152 strings)

Translation: Trilium Notes/Website
Translate-URL: https://hosted.weblate.org/projects/trilium/website/it/
2025-10-27 14:18:08 +00:00
green
f4402a6d81
Translated using Weblate (Japanese)
Currently translated at 100.0% (152 of 152 strings)

Translation: Trilium Notes/Website
Translate-URL: https://hosted.weblate.org/projects/trilium/website/ja/
2025-10-27 14:18:08 +00:00
green
6966efd374
Translated using Weblate (Japanese)
Currently translated at 98.0% (149 of 152 strings)

Translation: Trilium Notes/Website
Translate-URL: https://hosted.weblate.org/projects/trilium/website/ja/
2025-10-27 14:18:07 +00:00
Hosted Weblate
cd3e025fdc
Update translation files
Updated by "Cleanup translation files" add-on in Weblate.

Translation: Trilium Notes/Website
Translate-URL: https://hosted.weblate.org/projects/trilium/website/
2025-10-27 14:18:06 +00:00
marc hooijschuur
a224b774d3
Translated using Weblate (Dutch)
Currently translated at 2.9% (48 of 1621 strings)

Translation: Trilium Notes/Client
Translate-URL: https://hosted.weblate.org/projects/trilium/client/nl/
2025-10-27 14:18:05 +00:00
Elian Doran
f20078f3b0
fix(print): some images not loading 2025-10-27 16:17:51 +02:00
SiriusXT
56019e5449 fix (empty tab): recent notes not showing when creating a empty tab 2025-10-27 16:59:28 +08:00
SiriusXT
7dd517d8f7 fix (empty tab): recent notes not showing when creating a empty tab 2025-10-27 14:42:22 +08:00
Ryan Keane
1a68bdfe02
fix(windows script): add -command flag
I don't know why if I replace old, system builtin powershell executable
with powershell 7, scripts fail with this error:

The argument 'Set-Item -Path ...' is not recognized as the name of a
script file. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.

Adding -Command at the end of flags just fixed it.

Signed-off-by: Ryan Keane <the.ra2.ifv@gmail.com>
2025-10-25 01:07:28 -07:00
43 changed files with 141 additions and 55 deletions

View File

@ -56,7 +56,20 @@ function SingleNoteRenderer({ note, onReady }: RendererProps) {
await import("@triliumnext/ckeditor5/src/theme/ck-content.css");
}
const { $renderedContent } = await content_renderer.getRenderedContent(note, { noChildrenList: true });
containerRef.current?.replaceChildren(...$renderedContent);
const container = containerRef.current!;
container.replaceChildren(...$renderedContent);
// Wait for all images to load.
const images = Array.from(container.querySelectorAll("img"));
await Promise.all(
images.map(img => {
if (img.complete) return Promise.resolve();
return new Promise<void>(resolve => {
img.addEventListener("load", () => resolve(), { once: true });
img.addEventListener("error", () => resolve(), { once: true });
});
})
);
}
load().then(() => requestAnimationFrame(onReady))

View File

@ -13,6 +13,13 @@
"critical-error": {
"title": "Kritische Error",
"message": "Een kritieke fout heeft plaatsgevonden waardoor de cliënt zich aanmeldt vanaf het begin:\n\n84X\n\nDit is waarschijnlijk veroorzaakt door een script dat op een onverwachte manier faalt. Probeer de sollicitatie in veilige modus te starten en de kwestie aan te spreken."
},
"widget-error": {
"title": "Starten widget mislukt",
"message-unknown": "Onbekende widget kan niet gestart worden omdat:\n\n{{message}}"
},
"bundle-error": {
"title": "Custom script laden mislukt"
}
},
"add_link": {

View File

@ -155,6 +155,11 @@ export default class PopupEditorDialog extends Container<BasicWidget> {
return Promise.resolve();
}
// Avoid not showing recent notes when creating a new empty tab.
if ("noteContext" in data && data.noteContext.ntxId !== "_popup-editor") {
return Promise.resolve();
}
return super.handleEventInChildren(name, data);
}

View File

@ -6,7 +6,7 @@ WHERE powershell.exe > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
:POWERSHELL
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo "Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0; ./trilium.exe"
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo -Command "Set-Item -Path Env:NODE_TLS_REJECT_UNAUTHORIZED -Value 0; ./trilium.exe"
GOTO END
:BATCH

View File

@ -6,7 +6,7 @@ WHERE powershell.exe > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
:POWERSHELL
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo "Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'; ./trilium.exe"
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo -Command "Set-Item -Path Env:TRILIUM_DATA_DIR -Value './trilium-data'; ./trilium.exe"
GOTO END
:BATCH

View File

@ -6,7 +6,7 @@ WHERE powershell.exe > NUL 2>&1
IF %ERRORLEVEL% NEQ 0 GOTO BATCH ELSE GOTO POWERSHELL
:POWERSHELL
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo "Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1; ./trilium.exe --disable-gpu"
powershell -ExecutionPolicy Bypass -NonInteractive -NoLogo -Command "Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1; ./trilium.exe --disable-gpu"
GOTO END
:BATCH

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/assets/favicon.ico" />

View File

@ -19,6 +19,7 @@ describe("swapLocale", () => {
expect(swapLocaleInUrl("/ro/get-started", "ro")).toStrictEqual("/ro/get-started");
expect(swapLocaleInUrl("/en/get-started", "ro")).toStrictEqual("/ro/get-started");
expect(swapLocaleInUrl("/ro/", "en")).toStrictEqual("/en/");
expect(swapLocaleInUrl("/ro", "en")).toStrictEqual("/en");
});
});

View File

@ -1,9 +1,36 @@
import i18next from "i18next";
import { initReactI18next } from "react-i18next";
interface Locale {
id: string;
name: string;
rtl?: boolean;
}
i18next.use(initReactI18next);
const localeFiles = import.meta.glob("./translations/*/translation.json", { eager: true });
const resources: Record<string, Record<string, Record<string, string>>> = {};
for (const [path, module] of Object.entries(localeFiles)) {
const id = path.split("/").at(-2);
if (!id) continue;
const translations = (module as any).default ?? module;
resources[id] = { translation: translations };
}
export function initTranslations(lng: string) {
i18next.init({
fallbackLng: "en",
lng,
returnEmptyString: false,
resources,
initAsync: false,
react: {
useSuspense: false
}
});
}
export const LOCALES: Locale[] = [
{ id: "en", name: "English" },
{ id: "ro", name: "Română" },
@ -35,7 +62,13 @@ export function mapLocale(locale: string) {
export function swapLocaleInUrl(url: string, newLocale: string) {
const components = url.split("/");
if (components.length === 2) {
return `/${newLocale}${url}`;
const potentialLocale = components[1];
const correspondingLocale = LOCALES.find(l => l.id === potentialLocale);
if (correspondingLocale) {
return `/${newLocale}`;
} else {
return `/${newLocale}${url}`;
}
} else {
components[1] = newLocale;
return components.join("/");

View File

@ -8,11 +8,9 @@ import Footer from './components/Footer.js';
import GetStarted from './pages/GetStarted/get-started.js';
import SupportUs from './pages/SupportUs/SupportUs.js';
import { createContext } from 'preact';
import { useLayoutEffect, useState } from 'preact/hooks';
import { default as i18next, changeLanguage } from 'i18next';
import { extractLocaleFromUrl, LOCALES, mapLocale } from './i18n';
import HttpApi from 'i18next-http-backend';
import { initReactI18next } from "react-i18next";
import { useLayoutEffect, useRef } from 'preact/hooks';
import { changeLanguage } from 'i18next';
import { extractLocaleFromUrl, initTranslations, LOCALES, mapLocale } from './i18n';
export const LocaleContext = createContext('en');
@ -42,34 +40,26 @@ export function App(props: {repoStargazersCount: number}) {
export function LocaleProvider({ children }) {
const { path } = useLocation();
const localeId = mapLocale(extractLocaleFromUrl(path) || navigator.language);
const [ loaded, setLoaded ] = useState(false);
const localeId = getLocaleId(path);
const loadedRef = useRef(false);
useLayoutEffect(() => {
i18next
.use(HttpApi)
.use(initReactI18next);
i18next.init({
lng: localeId,
fallbackLng: "en",
backend: {
loadPath: "/translations/{{lng}}/{{ns}}.json",
},
returnEmptyString: false
}).then(() => setLoaded(true))
}, []);
useLayoutEffect(() => {
if (!loaded) return;
if (!loadedRef.current) {
initTranslations(localeId);
loadedRef.current = true;
} else {
changeLanguage(localeId);
}
// Update html lang and dir attributes
useLayoutEffect(() => {
const correspondingLocale = LOCALES.find(l => l.id === localeId);
document.documentElement.lang = localeId;
document.documentElement.dir = correspondingLocale?.rtl ? "rtl" : "ltr";
}, [ loaded, localeId ]);
}, [localeId]);
return (
<LocaleContext.Provider value={localeId}>
{loaded && children}
{children}
</LocaleContext.Provider>
);
}
@ -78,12 +68,26 @@ if (typeof window !== 'undefined') {
hydrate(<App repoStargazersCount={FALLBACK_STARGAZERS_COUNT} />, document.getElementById('app')!);
}
function getLocaleId(path: string) {
const extractedLocale = extractLocaleFromUrl(path);
if (extractedLocale) return mapLocale(extractedLocale);
if (typeof window === "undefined") return 'en';
return mapLocale(navigator.language);
}
export async function prerender(data) {
// Fetch the stargazer count of the Trilium's GitHub repo on prerender to pass
// it to the App component for SSR.
// This ensures the GitHub API is not called on every page load in the client.
const stargazersCount = await getRepoStargazersCount();
return await ssr(<App repoStargazersCount={stargazersCount} {...data} />);
const { html, links } = await ssr(<App repoStargazersCount={stargazersCount} {...data} />);
return {
html,
links,
head: {
lang: extractLocaleFromUrl(data.url) ?? "en"
}
}
}

View File

@ -95,8 +95,7 @@
"get_started": "Comenzar"
},
"components": {
"link_learn_more": "Saber más…",
"list_with_screenshot_alt": "Captura de pantalla de la función seleccionada"
"link_learn_more": "Saber más…"
},
"download_now": {
"text": "Descarga ahora ",

View File

@ -74,8 +74,7 @@
"get_started": "Commencer"
},
"components": {
"link_learn_more": "En savoir plus...",
"list_with_screenshot_alt": "Capture d'écran de la fonctionnalité sélectionnée"
"link_learn_more": "En savoir plus..."
},
"support_us": {
"financial_donations_title": "Dons financiers",

View File

@ -51,7 +51,8 @@
"mermaid_description": "Crea diagrammi come diagrammi di flusso, diagrammi di classe e sequenza, diagrammi di Gantt e molti altri, utilizzando la sintassi Mermaid.",
"mindmap_title": "Mappe mentali",
"mindmap_description": "Organizza i tuoi pensieri visivamente o fai una sessione di brainstorming.",
"others_list": "e altri: <0>mappa delle note</0>, <1>mappa delle relazioni</1>, <2>ricerche salvate</2>, <3>renderizza nota</3> e <4>visualizzazioni web</4>."
"others_list": "e altri: <0>mappa delle note</0>, <1>mappa delle relazioni</1>, <2>ricerche salvate</2>, <3>renderizza nota</3> e <4>visualizzazioni web</4>.",
"title": "Diversi modi per rappresentare le tue informazioni"
},
"extensibility_benefits": {
"title": "Condivisione ed estensibilità",
@ -72,7 +73,10 @@
"board_title": "Board",
"board_description": "Organizza le tue attività o lo stato dei tuoi progetti in una lavagna Kanban con un modo semplice per creare nuovi elementi e colonne e modificare facilmente il loro stato trascinandoli sulla lavagna.",
"geomap_title": "Geomappa",
"geomap_description": "Pianifica le tue vacanze o segna i tuoi punti di interesse direttamente su una mappa geografica utilizzando indicatori personalizzabili. Visualizza le tracce GPX registrate per seguire gli itinerari."
"geomap_description": "Pianifica le tue vacanze o segna i tuoi punti di interesse direttamente su una mappa geografica utilizzando indicatori personalizzabili. Visualizza le tracce GPX registrate per seguire gli itinerari.",
"title": "Collezioni",
"presentation_title": "Presentazione",
"presentation_description": "Organizza le informazioni in diapositive e presentale a schermo intero con transizioni fluide. Le diapositive possono anche essere esportate in formato PDF per una facile condivisione."
},
"faq": {
"title": "Domande frequenti",
@ -95,8 +99,7 @@
"get_started": "Inizia ora"
},
"components": {
"link_learn_more": "Per saperne di più...",
"list_with_screenshot_alt": "Screenshot della funzione selezionata"
"link_learn_more": "Per saperne di più..."
},
"download_now": {
"text": "Scarica ora ",
@ -188,5 +191,10 @@
"description": "Trilium Notes è ospitato su PikaPods, un servizio a pagamento che consente un facile accesso e una semplice gestione. Non è direttamente affiliato al team Trilium.",
"download_pikapod": "Configurazione su PikaPods",
"download_triliumcc": "In alternativa, consultare trilium.cc"
},
"header": {
"get-started": "Inizia",
"documentation": "Documentazione",
"support-us": "Sostienici"
}
}

View File

@ -51,7 +51,8 @@
"mermaid_description": "Mermaid 構文を使用して、フローチャート、クラス図、シーケンス図、ガント チャートなどの図を作成します。",
"mindmap_title": "マインドマップ",
"mindmap_description": "考えを視覚的に整理したり、ブレインストーミング セッションを行ったりします。",
"others_list": "その他: <0>ノートマップ</0>、<1>リレーションマップ</1>、<2>保存された検索</2>、<3>レンダリングノート</3>、<4>Web ビュー</4>。"
"others_list": "その他: <0>ノートマップ</0>、<1>リレーションマップ</1>、<2>保存された検索</2>、<3>レンダリングノート</3>、<4>Web ビュー</4>。",
"title": "情報を表現するための複数の方法"
},
"extensibility_benefits": {
"title": "共有と拡張性",
@ -72,7 +73,10 @@
"board_title": "ボード",
"board_description": "新しい項目や列を簡単に作成し、ボード上でドラッグするだけでステータスを変更できるカンバン ボードで、タスクやプロジェクトのステータスを整理できます。",
"geomap_title": "ジオマップ",
"geomap_description": "カスタマイズ可能なマーカーを使って、休暇を計画したり、興味のある場所を地図上に直接マークしたりできます。記録されたGPXトラックを表示して、旅程を追跡できます。"
"geomap_description": "カスタマイズ可能なマーカーを使って、休暇を計画したり、興味のある場所を地図上に直接マークしたりできます。記録されたGPXトラックを表示して、旅程を追跡できます。",
"title": "コレクション",
"presentation_title": "プレゼンテーション",
"presentation_description": "情報をスライドに整理し、スムーズな遷移で全画面表示できます。スライドはPDFにエクスポートできるので、簡単に共有できます。"
},
"faq": {
"title": "よくある質問",
@ -95,8 +99,7 @@
"get_started": "はじめる"
},
"components": {
"link_learn_more": "さらに詳しく...",
"list_with_screenshot_alt": "選択中の機能のスクリーンショット"
"link_learn_more": "さらに詳しく..."
},
"download_now": {
"text": "今すぐダウンロード ",
@ -188,5 +191,10 @@
"description": "Trilium Notesは、アクセスと管理を容易にする有料サービス PikaPods でホストされています。Trilium チームとは直接関係ありません。",
"download_pikapod": "PikaPods にセットアップする",
"download_triliumcc": "または、trilium.cc を参照してください"
},
"header": {
"get-started": "はじめる",
"documentation": "ドキュメント",
"support-us": "サポート"
}
}

View File

@ -95,8 +95,7 @@
"get_started": "Start"
},
"components": {
"link_learn_more": "Dowiedz się więcej....",
"list_with_screenshot_alt": "Zrzut ekranu wybranej funkcji"
"link_learn_more": "Dowiedz się więcej...."
},
"download_now": {
"text": "Pobierz teraz ",

View File

@ -95,8 +95,7 @@
"get_started": "Începe"
},
"components": {
"link_learn_more": "Mai multe detalii...",
"list_with_screenshot_alt": "Captură de ecran a funcției selectate"
"link_learn_more": "Mai multe detalii..."
},
"download_now": {
"text": "Descărcați acum ",
@ -107,9 +106,9 @@
"more_platforms": "Mai multe platforme și instalarea server-ului"
},
"header": {
"get-started": "Primii pași",
"documentation": "Documentație",
"support-us": "Sprijină-ne"
"get-started": "Primii pași",
"documentation": "Documentație",
"support-us": "Sprijină-ne"
},
"footer": {
"copyright_and_the": " și ",

View File

@ -51,7 +51,8 @@
"mermaid_description": "使用 Mermaid 語法繪製流程圖、類別圖與序列圖、甘特圖等多種圖表。",
"mindmap_title": "心智圖",
"mindmap_description": "以視覺方式整理思緒,或進行腦力激盪。",
"others_list": "及其他項目:<0>筆記地圖</0>、<1>關聯地圖</1>、<2>儲存搜尋</2>、<3>渲染筆記</3>,以及<4>網頁檢視</4>。"
"others_list": "及其他項目:<0>筆記地圖</0>、<1>關聯地圖</1>、<2>儲存搜尋</2>、<3>渲染筆記</3>,以及<4>網頁檢視</4>。",
"title": "多種方式呈現您的資訊"
},
"extensibility_benefits": {
"title": "分享及擴展性",
@ -72,7 +73,10 @@
"board_title": "看板",
"board_description": "將您的任務或專案狀態整理成看板,輕鬆建立新項目與欄位,並透過在看板上拖曳即可簡單變更狀態。",
"geomap_title": "地理地圖",
"geomap_description": "使用可自訂的標記直接在地圖上規劃您的假期行程或標記感興趣的地點。顯示已記錄的GPX軌跡以便追蹤行程路線。"
"geomap_description": "使用可自訂的標記直接在地圖上規劃您的假期行程或標記感興趣的地點。顯示已記錄的GPX軌跡以便追蹤行程路線。",
"title": "集合",
"presentation_title": "簡報",
"presentation_description": "將資訊整理成投影片,並以全螢幕模式及流暢的轉場效果呈現。投影片亦可匯出為 PDF 格式,方便分享。"
},
"faq": {
"title": "常見問題",
@ -95,8 +99,7 @@
"get_started": "上手指南"
},
"components": {
"link_learn_more": "了解更多…",
"list_with_screenshot_alt": "已選擇功能的螢幕截圖"
"link_learn_more": "了解更多…"
},
"download_now": {
"text": "馬上下載 ",
@ -188,5 +191,10 @@
"description": "Trilium Notes 託管於 PikaPods此為付費服務提供便捷存取與管理功能。與 Trilium 團隊無直接關聯。",
"download_pikapod": "在 PikaPods 上設定",
"download_triliumcc": "或參見 trilium.cc"
},
"header": {
"get-started": "上手指南",
"documentation": "文件",
"support-us": "支持我們"
}
}

View File

@ -9,6 +9,9 @@
"jsx": "react-jsx",
"jsxImportSource": "preact",
"skipLibCheck": true,
"types": [
"vite/client"
],
"paths": {
"react": ["../../node_modules/preact/compat/"],
"react-dom": ["../../node_modules/preact/compat/"]