From 1a68bdfe026646f14aa999f76cd148088e63d685 Mon Sep 17 00:00:00 2001 From: Ryan Keane Date: Sat, 25 Oct 2025 01:00:14 -0700 Subject: [PATCH 01/21] 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 --- apps/desktop/electron-forge/trilium-no-cert-check.bat | 2 +- apps/desktop/electron-forge/trilium-portable.bat | 2 +- apps/desktop/electron-forge/trilium-safe-mode.bat | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/desktop/electron-forge/trilium-no-cert-check.bat b/apps/desktop/electron-forge/trilium-no-cert-check.bat index cfc345c42..d3405b497 100644 --- a/apps/desktop/electron-forge/trilium-no-cert-check.bat +++ b/apps/desktop/electron-forge/trilium-no-cert-check.bat @@ -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 diff --git a/apps/desktop/electron-forge/trilium-portable.bat b/apps/desktop/electron-forge/trilium-portable.bat index b6eeb853f..5b71c9cf2 100644 --- a/apps/desktop/electron-forge/trilium-portable.bat +++ b/apps/desktop/electron-forge/trilium-portable.bat @@ -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 diff --git a/apps/desktop/electron-forge/trilium-safe-mode.bat b/apps/desktop/electron-forge/trilium-safe-mode.bat index 7e0fafa99..e112896f7 100644 --- a/apps/desktop/electron-forge/trilium-safe-mode.bat +++ b/apps/desktop/electron-forge/trilium-safe-mode.bat @@ -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 From 7dd517d8f7b66a268423c72639d33a737eab3a85 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Mon, 27 Oct 2025 14:42:22 +0800 Subject: [PATCH 02/21] fix (empty tab): recent notes not showing when creating a empty tab --- apps/client/src/widgets/dialogs/popup_editor.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts index 1deb584d9..fed105515 100644 --- a/apps/client/src/widgets/dialogs/popup_editor.ts +++ b/apps/client/src/widgets/dialogs/popup_editor.ts @@ -150,6 +150,11 @@ export default class PopupEditorDialog extends Container { } handleEventInChildren(name: T, data: EventData): Promise | null { + // Avoid not showing recent notes when creating a new empty tab. + if (name === 'activeContextChanged' && "noteContext" in data && data.noteContext.isEmpty()) { + return Promise.resolve(); + } + // Avoid events related to the current tab interfere with our popup. if (["noteSwitched", "noteSwitchedAndActivated", "exportAsPdf", "printActiveNote"].includes(name)) { return Promise.resolve(); From 56019e544981d3aa58eb8629e6a7ad9f6c4246c6 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Mon, 27 Oct 2025 16:59:28 +0800 Subject: [PATCH 03/21] fix (empty tab): recent notes not showing when creating a empty tab --- apps/client/src/widgets/dialogs/popup_editor.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/client/src/widgets/dialogs/popup_editor.ts b/apps/client/src/widgets/dialogs/popup_editor.ts index fed105515..f08719a93 100644 --- a/apps/client/src/widgets/dialogs/popup_editor.ts +++ b/apps/client/src/widgets/dialogs/popup_editor.ts @@ -150,13 +150,13 @@ export default class PopupEditorDialog extends Container { } handleEventInChildren(name: T, data: EventData): Promise | null { - // Avoid not showing recent notes when creating a new empty tab. - if (name === 'activeContextChanged' && "noteContext" in data && data.noteContext.isEmpty()) { + // Avoid events related to the current tab interfere with our popup. + if (["noteSwitched", "noteSwitchedAndActivated", "exportAsPdf", "printActiveNote"].includes(name)) { return Promise.resolve(); } - // Avoid events related to the current tab interfere with our popup. - if (["noteSwitched", "noteSwitchedAndActivated", "exportAsPdf", "printActiveNote"].includes(name)) { + // Avoid not showing recent notes when creating a new empty tab. + if ("noteContext" in data && data.noteContext.ntxId !== "_popup-editor") { return Promise.resolve(); } From f20078f3b0a8f406a7a53e67e177c6fdeeef3e0a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 27 Oct 2025 16:17:51 +0200 Subject: [PATCH 04/21] fix(print): some images not loading --- apps/client/src/print.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/client/src/print.tsx b/apps/client/src/print.tsx index de11d581a..3dbdf1de0 100644 --- a/apps/client/src/print.tsx +++ b/apps/client/src/print.tsx @@ -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(resolve => { + img.addEventListener("load", () => resolve(), { once: true }); + img.addEventListener("error", () => resolve(), { once: true }); + }); + }) + ); } load().then(() => requestAnimationFrame(onReady)) From a224b774d3dd92ac7dca05ab04bea08a8a286093 Mon Sep 17 00:00:00 2001 From: marc hooijschuur Date: Sun, 26 Oct 2025 14:41:03 +0100 Subject: [PATCH 05/21] 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/ --- apps/client/src/translations/nl/translation.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/client/src/translations/nl/translation.json b/apps/client/src/translations/nl/translation.json index d07df69e5..de5cfb6c7 100644 --- a/apps/client/src/translations/nl/translation.json +++ b/apps/client/src/translations/nl/translation.json @@ -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": { From cd3e025fdcfea05ee756efd9e9185bc2d603c6ae Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sun, 26 Oct 2025 22:03:34 +0100 Subject: [PATCH 06/21] 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/ --- apps/website/public/translations/es/translation.json | 3 +-- apps/website/public/translations/fr/translation.json | 3 +-- apps/website/public/translations/it/translation.json | 3 +-- apps/website/public/translations/ja/translation.json | 3 +-- apps/website/public/translations/pl/translation.json | 3 +-- apps/website/public/translations/ro/translation.json | 9 ++++----- .../website/public/translations/zh-Hant/translation.json | 3 +-- 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/apps/website/public/translations/es/translation.json b/apps/website/public/translations/es/translation.json index 2f7316d5e..cba0aba90 100644 --- a/apps/website/public/translations/es/translation.json +++ b/apps/website/public/translations/es/translation.json @@ -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 ", diff --git a/apps/website/public/translations/fr/translation.json b/apps/website/public/translations/fr/translation.json index 0b7fe98bf..b464b2d71 100644 --- a/apps/website/public/translations/fr/translation.json +++ b/apps/website/public/translations/fr/translation.json @@ -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", diff --git a/apps/website/public/translations/it/translation.json b/apps/website/public/translations/it/translation.json index 2ffc45a94..d8634a78c 100644 --- a/apps/website/public/translations/it/translation.json +++ b/apps/website/public/translations/it/translation.json @@ -95,8 +95,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 ", diff --git a/apps/website/public/translations/ja/translation.json b/apps/website/public/translations/ja/translation.json index 96115d80e..eae21a8bf 100644 --- a/apps/website/public/translations/ja/translation.json +++ b/apps/website/public/translations/ja/translation.json @@ -95,8 +95,7 @@ "get_started": "はじめる" }, "components": { - "link_learn_more": "さらに詳しく...", - "list_with_screenshot_alt": "選択中の機能のスクリーンショット" + "link_learn_more": "さらに詳しく..." }, "download_now": { "text": "今すぐダウンロード ", diff --git a/apps/website/public/translations/pl/translation.json b/apps/website/public/translations/pl/translation.json index 4d4c5df02..b4ddd8e13 100644 --- a/apps/website/public/translations/pl/translation.json +++ b/apps/website/public/translations/pl/translation.json @@ -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 ", diff --git a/apps/website/public/translations/ro/translation.json b/apps/website/public/translations/ro/translation.json index ca836e1a8..5cb462254 100644 --- a/apps/website/public/translations/ro/translation.json +++ b/apps/website/public/translations/ro/translation.json @@ -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 ", diff --git a/apps/website/public/translations/zh-Hant/translation.json b/apps/website/public/translations/zh-Hant/translation.json index 580c54fba..a941e5686 100644 --- a/apps/website/public/translations/zh-Hant/translation.json +++ b/apps/website/public/translations/zh-Hant/translation.json @@ -95,8 +95,7 @@ "get_started": "上手指南" }, "components": { - "link_learn_more": "了解更多…", - "list_with_screenshot_alt": "已選擇功能的螢幕截圖" + "link_learn_more": "了解更多…" }, "download_now": { "text": "馬上下載 ", From 6966efd37426aa05f3f5d9f72dce7eea3a9fb569 Mon Sep 17 00:00:00 2001 From: green Date: Mon, 27 Oct 2025 05:29:00 +0100 Subject: [PATCH 07/21] 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/ --- apps/website/public/translations/ja/translation.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/website/public/translations/ja/translation.json b/apps/website/public/translations/ja/translation.json index eae21a8bf..3507db121 100644 --- a/apps/website/public/translations/ja/translation.json +++ b/apps/website/public/translations/ja/translation.json @@ -51,7 +51,8 @@ "mermaid_description": "Mermaid 構文を使用して、フローチャート、クラス図、シーケンス図、ガント チャートなどの図を作成します。", "mindmap_title": "マインドマップ", "mindmap_description": "考えを視覚的に整理したり、ブレインストーミング セッションを行ったりします。", - "others_list": "その他: <0>ノートマップ、<1>リレーションマップ、<2>保存された検索、<3>レンダリングノート、<4>Web ビュー。" + "others_list": "その他: <0>ノートマップ、<1>リレーションマップ、<2>保存された検索、<3>レンダリングノート、<4>Web ビュー。", + "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": "よくある質問", From f4402a6d810a1f121d2719c27c11ba5e5eba8c43 Mon Sep 17 00:00:00 2001 From: green Date: Mon, 27 Oct 2025 08:52:19 +0100 Subject: [PATCH 08/21] 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/ --- apps/website/public/translations/ja/translation.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/website/public/translations/ja/translation.json b/apps/website/public/translations/ja/translation.json index 3507db121..d7cb3f599 100644 --- a/apps/website/public/translations/ja/translation.json +++ b/apps/website/public/translations/ja/translation.json @@ -191,5 +191,10 @@ "description": "Trilium Notesは、アクセスと管理を容易にする有料サービス PikaPods でホストされています。Trilium チームとは直接関係ありません。", "download_pikapod": "PikaPods にセットアップする", "download_triliumcc": "または、trilium.cc を参照してください" + }, + "header": { + "get-started": "はじめる", + "documentation": "ドキュメント", + "support-us": "サポート" } } From f3f7e5900b5bbf53dfd0c6ffcbcd1821b9010e08 Mon Sep 17 00:00:00 2001 From: Giovi Date: Mon, 27 Oct 2025 09:29:13 +0100 Subject: [PATCH 09/21] 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/ --- .../website/public/translations/it/translation.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/website/public/translations/it/translation.json b/apps/website/public/translations/it/translation.json index d8634a78c..03792e5ed 100644 --- a/apps/website/public/translations/it/translation.json +++ b/apps/website/public/translations/it/translation.json @@ -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, <1>mappa delle relazioni, <2>ricerche salvate, <3>renderizza nota e <4>visualizzazioni web." + "others_list": "e altri: <0>mappa delle note, <1>mappa delle relazioni, <2>ricerche salvate, <3>renderizza nota e <4>visualizzazioni web.", + "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", @@ -187,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" } } From 40f5abd6e36b1350a65248bbe9138c7feb3482e7 Mon Sep 17 00:00:00 2001 From: Francis C Date: Mon, 27 Oct 2025 09:47:34 +0100 Subject: [PATCH 10/21] 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/ --- .../public/translations/zh-Hant/translation.json | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/website/public/translations/zh-Hant/translation.json b/apps/website/public/translations/zh-Hant/translation.json index a941e5686..80929ce94 100644 --- a/apps/website/public/translations/zh-Hant/translation.json +++ b/apps/website/public/translations/zh-Hant/translation.json @@ -51,7 +51,8 @@ "mermaid_description": "使用 Mermaid 語法繪製流程圖、類別圖與序列圖、甘特圖等多種圖表。", "mindmap_title": "心智圖", "mindmap_description": "以視覺方式整理思緒,或進行腦力激盪。", - "others_list": "及其他項目:<0>筆記地圖、<1>關聯地圖、<2>儲存搜尋、<3>渲染筆記,以及<4>網頁檢視。" + "others_list": "及其他項目:<0>筆記地圖、<1>關聯地圖、<2>儲存搜尋、<3>渲染筆記,以及<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": "常見問題", @@ -187,5 +191,10 @@ "description": "Trilium Notes 託管於 PikaPods,此為付費服務,提供便捷存取與管理功能。與 Trilium 團隊無直接關聯。", "download_pikapod": "在 PikaPods 上設定", "download_triliumcc": "或參見 trilium.cc" + }, + "header": { + "get-started": "上手指南", + "documentation": "文件", + "support-us": "支持我們" } } From c4c8fe23a9999f29685d58729b01334965130120 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 27 Oct 2025 16:29:44 +0200 Subject: [PATCH 11/21] fix(website): pages not prerendered --- apps/website/src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/website/src/index.tsx b/apps/website/src/index.tsx index 8cbea3d0e..92455792a 100644 --- a/apps/website/src/index.tsx +++ b/apps/website/src/index.tsx @@ -69,7 +69,7 @@ export function LocaleProvider({ children }) { return ( - {loaded && children} + {children} ); } From 86aaa97809b90f72ffabadad79cdd103f653fae1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 27 Oct 2025 16:30:03 +0200 Subject: [PATCH 12/21] fix(website): language-specific pages not properly determined --- apps/website/src/i18n.spec.ts | 1 + apps/website/src/i18n.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/website/src/i18n.spec.ts b/apps/website/src/i18n.spec.ts index eab06ba5a..fcc8d790a 100644 --- a/apps/website/src/i18n.spec.ts +++ b/apps/website/src/i18n.spec.ts @@ -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"); }); }); diff --git a/apps/website/src/i18n.ts b/apps/website/src/i18n.ts index 435245217..10608e571 100644 --- a/apps/website/src/i18n.ts +++ b/apps/website/src/i18n.ts @@ -35,7 +35,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("/"); From dbfa94a9ee45a7fef43cd97c90df35f85d7bad34 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 27 Oct 2025 16:35:26 +0200 Subject: [PATCH 13/21] fix(website): missing suspense --- apps/website/src/components/Header.tsx | 5 +++- apps/website/src/index.tsx | 37 ++++++++++++++------------ apps/website/src/pages/Home/index.tsx | 5 +++- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/apps/website/src/components/Header.tsx b/apps/website/src/components/Header.tsx index 352e52fba..ce28ffd49 100644 --- a/apps/website/src/components/Header.tsx +++ b/apps/website/src/components/Header.tsx @@ -11,6 +11,7 @@ import menuIcon from "../assets/boxicons/bx-menu.svg?raw"; import { LocaleContext } from ".."; import { useTranslation } from "react-i18next"; import { swapLocaleInUrl } from "../i18n"; +import { Suspense } from "preact/compat"; interface HeaderLink { url: string; @@ -78,7 +79,9 @@ export function Header(props: {repoStargazersCount: number}) { /> - + Loading...}> + + diff --git a/apps/website/src/index.tsx b/apps/website/src/index.tsx index 92455792a..1aafe8367 100644 --- a/apps/website/src/index.tsx +++ b/apps/website/src/index.tsx @@ -13,30 +13,33 @@ 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 { Suspense } from 'preact/compat'; export const LocaleContext = createContext('en'); export function App(props: {repoStargazersCount: number}) { return ( - - -
-
- - - - + + + Loading...}> +
+
+ + + + - - - + + + - - -
-
- - + + +
+
+ + + ); } diff --git a/apps/website/src/pages/Home/index.tsx b/apps/website/src/pages/Home/index.tsx index b26d43621..02b97bbdc 100644 --- a/apps/website/src/pages/Home/index.tsx +++ b/apps/website/src/pages/Home/index.tsx @@ -33,6 +33,7 @@ import presentationIcon from "../../assets/boxicons/bx-slideshow.svg?raw"; import { getPlatform } from '../../download-helper.js'; import { useEffect, useState } from 'preact/hooks'; import { Trans, useTranslation } from 'react-i18next'; +import { Suspense } from 'preact/compat'; export function Home() { usePageTitle(""); @@ -79,7 +80,9 @@ function HeroSection() {

{t("hero_section.subtitle")}

- + Loading...
}> + +
diff --git a/apps/website/src/index.tsx b/apps/website/src/index.tsx index 1aafe8367..92455792a 100644 --- a/apps/website/src/index.tsx +++ b/apps/website/src/index.tsx @@ -13,33 +13,30 @@ 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 { Suspense } from 'preact/compat'; export const LocaleContext = createContext('en'); export function App(props: {repoStargazersCount: number}) { return ( - - - Loading...}> -
-
- - - - + + +
+
+ + + + - - - + + + - - -
-
- - - + + +
+