From 555bda98d729d8c91f5882c7b322de42d7124e4d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 14:19:07 +0300 Subject: [PATCH 01/15] docs(readme): add banner --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 1fb4e0b95..6817f4390 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) ![LiberaPay patrons](https://img.shields.io/liberapay/patrons/ElianDoran) From 7c618ff33bbd2601002b8861c8303ac8c721e802 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 14:24:44 +0300 Subject: [PATCH 02/15] docs(readme): fix tags in banner --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6817f4390..5b96a65d8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

From 140efce96fbd0489752c855b55bf5736dcc0734e Mon Sep 17 00:00:00 2001 From: Patric Siesing Date: Tue, 14 Oct 2025 08:24:33 +0200 Subject: [PATCH 03/15] Translated using Weblate (Swedish) Currently translated at 0.2% (4 of 1613 strings) Translation: Trilium Notes/Client Translate-URL: https://hosted.weblate.org/projects/trilium/client/sv/ --- apps/client/src/translations/sv/translation.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/client/src/translations/sv/translation.json b/apps/client/src/translations/sv/translation.json index 0967ef424..c5ec9a096 100644 --- a/apps/client/src/translations/sv/translation.json +++ b/apps/client/src/translations/sv/translation.json @@ -1 +1,8 @@ -{} +{ + "about": { + "title": "Om Trilium Notes", + "homepage": "Hemsida:", + "app_version": "App version:", + "db_version": "DB version:" + } +} From ae1c5ebe47c9db756064a2413df77c07d6f0be4d Mon Sep 17 00:00:00 2001 From: Patric Siesing Date: Tue, 14 Oct 2025 08:24:16 +0200 Subject: [PATCH 04/15] Translated using Weblate (Swedish) Currently translated at 0.7% (3 of 381 strings) Translation: Trilium Notes/Server Translate-URL: https://hosted.weblate.org/projects/trilium/server/sv/ --- apps/server/src/assets/translations/sv/server.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/server/src/assets/translations/sv/server.json b/apps/server/src/assets/translations/sv/server.json index 0967ef424..0fc334731 100644 --- a/apps/server/src/assets/translations/sv/server.json +++ b/apps/server/src/assets/translations/sv/server.json @@ -1 +1,7 @@ -{} +{ + "keyboard_actions": { + "back-in-note-history": "Gå till föregående anteckning i historiken", + "forward-in-note-history": "Gå till nästa anteckning i historiken", + "open-jump-to-note-dialog": "Öppna \"Hoppa till anteckning\" dialog" + } +} From f29b50ae41a2a1347ed4d18e65f2ed7d20e2eaea Mon Sep 17 00:00:00 2001 From: Patric Siesing Date: Tue, 14 Oct 2025 08:23:40 +0200 Subject: [PATCH 05/15] Translated using Weblate (Swedish) Currently translated at 2.0% (3 of 146 strings) Translation: Trilium Notes/Website Translate-URL: https://hosted.weblate.org/projects/trilium/website/sv/ --- apps/website/public/translations/sv/translation.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/website/public/translations/sv/translation.json b/apps/website/public/translations/sv/translation.json index 0967ef424..46df51fba 100644 --- a/apps/website/public/translations/sv/translation.json +++ b/apps/website/public/translations/sv/translation.json @@ -1 +1,7 @@ -{} +{ + "get-started": { + "title": "Kom igång", + "desktop_title": "Ladda ner skrivbordsprogrammet (v{{version}})", + "architecture": "Arkitektur:" + } +} From e992744101bd7849444ecfa83756a6e8a2880917 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 14 Oct 2025 13:19:44 +0200 Subject: [PATCH 06/15] Update translation files Updated by "Cleanup translation files" add-on in Weblate. Translation: Trilium Notes/README Translate-URL: https://hosted.weblate.org/projects/trilium/readme/ --- docs/README-ZH_CN.md | 14 ++++++++++++++ docs/README-ZH_TW.md | 14 ++++++++++++++ docs/README-ar.md | 14 ++++++++++++++ docs/README-ca.md | 14 ++++++++++++++ docs/README-cs.md | 14 ++++++++++++++ docs/README-de.md | 14 ++++++++++++++ docs/README-el.md | 14 ++++++++++++++ docs/README-es.md | 14 ++++++++++++++ docs/README-fa.md | 14 ++++++++++++++ docs/README-fi.md | 14 ++++++++++++++ docs/README-fr.md | 14 ++++++++++++++ docs/README-hr.md | 14 ++++++++++++++ docs/README-hu.md | 14 ++++++++++++++ docs/README-id.md | 14 ++++++++++++++ docs/README-it.md | 14 ++++++++++++++ docs/README-ja.md | 14 ++++++++++++++ docs/README-ko.md | 14 ++++++++++++++ docs/README-md.md | 14 ++++++++++++++ docs/README-nb_NO.md | 14 ++++++++++++++ docs/README-nl.md | 14 ++++++++++++++ docs/README-pl.md | 14 ++++++++++++++ docs/README-pt.md | 14 ++++++++++++++ docs/README-pt_BR.md | 14 ++++++++++++++ docs/README-ro.md | 14 ++++++++++++++ docs/README-ru.md | 14 ++++++++++++++ docs/README-sl.md | 14 ++++++++++++++ docs/README-sr.md | 14 ++++++++++++++ docs/README-sv.md | 14 ++++++++++++++ docs/README-tr.md | 14 ++++++++++++++ docs/README-uk.md | 14 ++++++++++++++ docs/README-vi.md | 14 ++++++++++++++ 31 files changed, 434 insertions(+) diff --git a/docs/README-ZH_CN.md b/docs/README-ZH_CN.md index 2efbd4f83..b42d165eb 100644 --- a/docs/README-ZH_CN.md +++ b/docs/README-ZH_CN.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-ZH_TW.md b/docs/README-ZH_TW.md index 4c1a21e3b..2f25b5de7 100644 --- a/docs/README-ZH_TW.md +++ b/docs/README-ZH_TW.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-ar.md b/docs/README-ar.md index 88d7e3616..d205684b8 100644 --- a/docs/README-ar.md +++ b/docs/README-ar.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # ملاحظات تريليوم ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-ca.md b/docs/README-ca.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-ca.md +++ b/docs/README-ca.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-cs.md b/docs/README-cs.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-cs.md +++ b/docs/README-cs.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-de.md b/docs/README-de.md index eb510193f..f504d0a09 100644 --- a/docs/README-de.md +++ b/docs/README-de.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-el.md b/docs/README-el.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-el.md +++ b/docs/README-el.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-es.md b/docs/README-es.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-es.md +++ b/docs/README-es.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-fa.md b/docs/README-fa.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-fa.md +++ b/docs/README-fa.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-fi.md b/docs/README-fi.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-fi.md +++ b/docs/README-fi.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-fr.md b/docs/README-fr.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-fr.md +++ b/docs/README-fr.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-hr.md b/docs/README-hr.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-hr.md +++ b/docs/README-hr.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-hu.md b/docs/README-hu.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-hu.md +++ b/docs/README-hu.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-id.md b/docs/README-id.md index fd392b472..d353602fd 100644 --- a/docs/README-id.md +++ b/docs/README-id.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-it.md b/docs/README-it.md index c24005f3e..b221b193f 100644 --- a/docs/README-it.md +++ b/docs/README-it.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-ja.md b/docs/README-ja.md index e6d048523..6c55a029f 100644 --- a/docs/README-ja.md +++ b/docs/README-ja.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-ko.md b/docs/README-ko.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-ko.md +++ b/docs/README-ko.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-md.md b/docs/README-md.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-md.md +++ b/docs/README-md.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-nb_NO.md b/docs/README-nb_NO.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-nb_NO.md +++ b/docs/README-nb_NO.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-nl.md b/docs/README-nl.md index 1f2141a28..ba85931c9 100644 --- a/docs/README-nl.md +++ b/docs/README-nl.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsoren](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-pl.md b/docs/README-pl.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-pl.md +++ b/docs/README-pl.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-pt.md b/docs/README-pt.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-pt.md +++ b/docs/README-pt.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-pt_BR.md b/docs/README-pt_BR.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-pt_BR.md +++ b/docs/README-pt_BR.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-ro.md b/docs/README-ro.md index 37a4f5683..8a8d7308c 100644 --- a/docs/README-ro.md +++ b/docs/README-ro.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![Sponsori prin GitHub](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-ru.md b/docs/README-ru.md index 40e79d56a..d5497fbbf 100644 --- a/docs/README-ru.md +++ b/docs/README-ru.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-sl.md b/docs/README-sl.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-sl.md +++ b/docs/README-sl.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-sr.md b/docs/README-sr.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-sr.md +++ b/docs/README-sr.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-sv.md b/docs/README-sv.md index b9195eb18..9ecbadaa7 100644 --- a/docs/README-sv.md +++ b/docs/README-sv.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-tr.md b/docs/README-tr.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-tr.md +++ b/docs/README-tr.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-uk.md b/docs/README-uk.md index 348eb9d3e..9c3b8e1b7 100644 --- a/docs/README-uk.md +++ b/docs/README-uk.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) diff --git a/docs/README-vi.md b/docs/README-vi.md index 67a70c0bf..57e368565 100644 --- a/docs/README-vi.md +++ b/docs/README-vi.md @@ -1,3 +1,17 @@ +
+ Special thanks to: + +
+ Warp sponsorship +
+ Warp, built for coding with multiple AI agents +
+
+ Available for macOS, Linux and Windows +
+ +
+ # Trilium Notes ![GitHub Sponsors](https://img.shields.io/github/sponsors/eliandoran) From 3c1f7baaae96e309003feb76cef18196acb0fe50 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 14 Oct 2025 13:25:16 +0200 Subject: [PATCH 07/15] Update translation files Updated by "Cleanup translation files" add-on in Weblate. Translation: Trilium Notes/README Translate-URL: https://hosted.weblate.org/projects/trilium/readme/ --- docs/README-ZH_CN.md | 13 +++++-------- docs/README-ZH_TW.md | 13 +++++-------- docs/README-ar.md | 13 +++++-------- docs/README-ca.md | 13 +++++-------- docs/README-cs.md | 13 +++++-------- docs/README-de.md | 13 +++++-------- docs/README-el.md | 13 +++++-------- docs/README-es.md | 13 +++++-------- docs/README-fa.md | 13 +++++-------- docs/README-fi.md | 13 +++++-------- docs/README-fr.md | 13 +++++-------- docs/README-hr.md | 13 +++++-------- docs/README-hu.md | 13 +++++-------- docs/README-id.md | 13 +++++-------- docs/README-it.md | 13 +++++-------- docs/README-ja.md | 13 +++++-------- docs/README-ko.md | 13 +++++-------- docs/README-md.md | 13 +++++-------- docs/README-nb_NO.md | 13 +++++-------- docs/README-nl.md | 13 +++++-------- docs/README-pl.md | 13 +++++-------- docs/README-pt.md | 13 +++++-------- docs/README-pt_BR.md | 13 +++++-------- docs/README-ro.md | 13 +++++-------- docs/README-ru.md | 13 +++++-------- docs/README-sl.md | 13 +++++-------- docs/README-sr.md | 13 +++++-------- docs/README-sv.md | 13 +++++-------- docs/README-tr.md | 13 +++++-------- docs/README-uk.md | 13 +++++-------- docs/README-vi.md | 13 +++++-------- 31 files changed, 155 insertions(+), 248 deletions(-) diff --git a/docs/README-ZH_CN.md b/docs/README-ZH_CN.md index b42d165eb..ea0609311 100644 --- a/docs/README-ZH_CN.md +++ b/docs/README-ZH_CN.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-ZH_TW.md b/docs/README-ZH_TW.md index 2f25b5de7..510945e78 100644 --- a/docs/README-ZH_TW.md +++ b/docs/README-ZH_TW.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-ar.md b/docs/README-ar.md index d205684b8..788884f36 100644 --- a/docs/README-ar.md +++ b/docs/README-ar.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-ca.md b/docs/README-ca.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-ca.md +++ b/docs/README-ca.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-cs.md b/docs/README-cs.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-cs.md +++ b/docs/README-cs.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-de.md b/docs/README-de.md index f504d0a09..fc4e6714b 100644 --- a/docs/README-de.md +++ b/docs/README-de.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-el.md b/docs/README-el.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-el.md +++ b/docs/README-el.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-es.md b/docs/README-es.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-es.md +++ b/docs/README-es.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-fa.md b/docs/README-fa.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-fa.md +++ b/docs/README-fa.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-fi.md b/docs/README-fi.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-fi.md +++ b/docs/README-fi.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-fr.md b/docs/README-fr.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-fr.md +++ b/docs/README-fr.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-hr.md b/docs/README-hr.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-hr.md +++ b/docs/README-hr.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-hu.md b/docs/README-hu.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-hu.md +++ b/docs/README-hu.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-id.md b/docs/README-id.md index d353602fd..77a947acf 100644 --- a/docs/README-id.md +++ b/docs/README-id.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-it.md b/docs/README-it.md index b221b193f..260cd3a72 100644 --- a/docs/README-it.md +++ b/docs/README-it.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-ja.md b/docs/README-ja.md index 6c55a029f..f5caa13c0 100644 --- a/docs/README-ja.md +++ b/docs/README-ja.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-ko.md b/docs/README-ko.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-ko.md +++ b/docs/README-ko.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-md.md b/docs/README-md.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-md.md +++ b/docs/README-md.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-nb_NO.md b/docs/README-nb_NO.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-nb_NO.md +++ b/docs/README-nb_NO.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-nl.md b/docs/README-nl.md index ba85931c9..933374ee3 100644 --- a/docs/README-nl.md +++ b/docs/README-nl.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-pl.md b/docs/README-pl.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-pl.md +++ b/docs/README-pl.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-pt.md b/docs/README-pt.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-pt.md +++ b/docs/README-pt.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-pt_BR.md b/docs/README-pt_BR.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-pt_BR.md +++ b/docs/README-pt_BR.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-ro.md b/docs/README-ro.md index 8a8d7308c..b46d9447a 100644 --- a/docs/README-ro.md +++ b/docs/README-ro.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-ru.md b/docs/README-ru.md index d5497fbbf..5796e023b 100644 --- a/docs/README-ru.md +++ b/docs/README-ru.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-sl.md b/docs/README-sl.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-sl.md +++ b/docs/README-sl.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-sr.md b/docs/README-sr.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-sr.md +++ b/docs/README-sr.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-sv.md b/docs/README-sv.md index 9ecbadaa7..daf23eb4b 100644 --- a/docs/README-sv.md +++ b/docs/README-sv.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-tr.md b/docs/README-tr.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-tr.md +++ b/docs/README-tr.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-uk.md b/docs/README-uk.md index 9c3b8e1b7..586045a29 100644 --- a/docs/README-uk.md +++ b/docs/README-uk.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

diff --git a/docs/README-vi.md b/docs/README-vi.md index 57e368565..0c3f5a796 100644 --- a/docs/README-vi.md +++ b/docs/README-vi.md @@ -1,13 +1,10 @@
- Special thanks to: - -
- Warp sponsorship -
- Warp, built for coding with multiple AI agents -
+ Special thanks to:
+
+ Warp sponsorship
+ Warp, built for coding with multiple AI agents
- Available for macOS, Linux and Windows + Available for macOS, Linux and Windows

From 7e871c3b04431c1f7d77c68c5ba413fbf0a77172 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 14:50:00 +0300 Subject: [PATCH 08/15] feat(i18n): enable Arabic as UI language --- packages/commons/src/lib/i18n.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/commons/src/lib/i18n.ts b/packages/commons/src/lib/i18n.ts index 8e408f2e6..f6a205d34 100644 --- a/packages/commons/src/lib/i18n.ts +++ b/packages/commons/src/lib/i18n.ts @@ -47,7 +47,6 @@ const UNSORTED_LOCALES = [ id: "ar", name: "اَلْعَرَبِيَّةُ", rtl: true, - devOnly: true, electronLocale: "ar" }, { // Hebrew From 067383a87d36bdb97c07523d4f8c1fdd3eec703f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 15:04:07 +0300 Subject: [PATCH 09/15] fix(desktop): window button alignment not corresponding OK if formatting locale is different --- apps/desktop/src/main.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index 52ebe458b..a94709107 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -12,6 +12,7 @@ import { deferred } from "@triliumnext/server/src/services/utils.js"; import { PRODUCT_NAME } from "./app-info"; import port from "@triliumnext/server/src/services/port.js"; import { join } from "path"; +import { LOCALES } from "../../../packages/commons/src"; async function main() { const userDataPath = getUserData(); @@ -30,7 +31,7 @@ async function main() { // needed for excalidraw export https://github.com/zadam/trilium/issues/4271 app.commandLine.appendSwitch("enable-experimental-web-platform-features"); - app.commandLine.appendSwitch("lang", options.getOptionOrNull("formattingLocale") || options.getOptionOrNull("locale") || "en"); + app.commandLine.appendSwitch("lang", getElectronLocale()); // Disable smooth scroll if the option is set const smoothScrollEnabled = options.getOptionOrNull("smoothScrollEnabled"); @@ -128,4 +129,15 @@ async function onReady() { await windowService.registerGlobalShortcuts(); } +function getElectronLocale() { + const uiLocale = options.getOptionOrNull("locale"); + const formattingLocale = options.getOptionOrNull("formattingLocale"); + const correspondingLocale = LOCALES.find(l => l.id === uiLocale); + + // For RTL, we have to force the UI locale to align the window buttons properly. + if (formattingLocale && !correspondingLocale?.rtl) return formattingLocale; + + return uiLocale || "en" +} + main(); From fa017fde6254a43d8ccf31f528d6e7ee5fdcf70a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 17:31:52 +0300 Subject: [PATCH 10/15] fix(desktop/rtl): native buttons overlapping on darwin --- apps/client/src/stylesheets/style.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index 44ed76997..a0d9ffa18 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -1978,6 +1978,10 @@ body.electron.platform-darwin:not(.native-titlebar) .tab-row-container { -webkit-app-region: drag; } +body.electron.platform-darwin:not(.native-titlebar) #tab-row-left-spacer { + width: 80px; +} + .tab-row-widget { padding-inline-end: calc(100vw - env(titlebar-area-width, 100vw)); } From 1cc0e686ea95801f3c2293c7f2e338ef9de1a920 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 17:53:33 +0300 Subject: [PATCH 11/15] fix(client/rtl): bad alignment of launcher container if no scroll --- apps/client/src/stylesheets/theme-next/shell.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.css index 7797e3a80..8e2f8a9a7 100644 --- a/apps/client/src/stylesheets/theme-next/shell.css +++ b/apps/client/src/stylesheets/theme-next/shell.css @@ -100,7 +100,7 @@ body.layout-horizontal > .horizontal { align-items: center; } -#launcher-container { +body[dir=ltr] #launcher-container { scrollbar-gutter: stable both-edges; } From 0c2b186e501d6089a6589bcac5bb79247ba5e449 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 18:10:54 +0300 Subject: [PATCH 12/15] refactor(options/i18n): use select for language selection --- .../options/components/OptionsRow.css | 8 +++++- .../src/widgets/type_widgets/options/i18n.tsx | 25 +++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css index 98778b96e..6eeaa1074 100644 --- a/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css +++ b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css @@ -10,10 +10,16 @@ margin-bottom: 0 !important; } -.option-row > select { +.option-row > select, +.option-row > .dropdown { width: 60%; } +.option-row > .dropdown button { + width: 100%; + text-align: start; +} + .option-row:last-of-type { border-bottom: unset; } diff --git a/apps/client/src/widgets/type_widgets/options/i18n.tsx b/apps/client/src/widgets/type_widgets/options/i18n.tsx index 4e6ec61e8..bd2c4c9e1 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n.tsx +++ b/apps/client/src/widgets/type_widgets/options/i18n.tsx @@ -1,4 +1,4 @@ -import { useMemo } from "preact/hooks"; +import { useMemo, useState } from "preact/hooks"; import { getAvailableLocales, t } from "../../../services/i18n"; import FormSelect from "../../react/FormSelect"; import OptionsRow from "./components/OptionsRow"; @@ -12,6 +12,9 @@ import RawHtml from "../../react/RawHtml"; import Admonition from "../../react/Admonition"; import Button from "../../react/Button"; import CheckboxList from "./components/CheckboxList"; +import FormDropdownList from "../../react/FormDropdownList"; +import Dropdown from "../../react/Dropdown"; +import { FormListItem } from "../../react/FormList"; export default function InternationalizationOptions() { return ( @@ -57,12 +60,20 @@ function LocalizationOptions() { } function LocaleSelector({ id, locales, currentValue, onChange }: { id?: string; locales: Locale[], currentValue: string, onChange: (newLocale: string) => void }) { - return ; + const [ activeLocale, setActiveLocale ] = useState(locales.find(l => l.id === currentValue)); + return ( + + {locales.map(locale => ( + { + setActiveLocale(locale); + onChange(locale.id); + }} + >{locale.name} + ))} + + ) } function DateSettings() { From 5693b593185c7ade6cfe3e4be8d89bf79b33e0e4 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 18:15:45 +0300 Subject: [PATCH 13/15] chore(options/i18n): fix click on label not working on select --- apps/client/src/widgets/react/Dropdown.tsx | 9 ++++----- apps/client/src/widgets/type_widgets/options/i18n.tsx | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/client/src/widgets/react/Dropdown.tsx b/apps/client/src/widgets/react/Dropdown.tsx index e35584422..866a138b8 100644 --- a/apps/client/src/widgets/react/Dropdown.tsx +++ b/apps/client/src/widgets/react/Dropdown.tsx @@ -1,11 +1,10 @@ import { Dropdown as BootstrapDropdown } from "bootstrap"; import { ComponentChildren } from "preact"; -import { CSSProperties } from "preact/compat"; +import { CSSProperties, HTMLProps } from "preact/compat"; import { useCallback, useEffect, useRef, useState } from "preact/hooks"; import { useUniqueName } from "./hooks"; -export interface DropdownProps { - className?: string; +export interface DropdownProps extends Pick, "id" | "className"> { buttonClassName?: string; isStatic?: boolean; children: ComponentChildren; @@ -22,7 +21,7 @@ export interface DropdownProps { forceShown?: boolean; } -export default function Dropdown({ className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle, noDropdownListStyle, forceShown }: DropdownProps) { +export default function Dropdown({ id, className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle, noDropdownListStyle, forceShown }: DropdownProps) { const dropdownRef = useRef(null); const triggerRef = useRef(null); @@ -74,7 +73,7 @@ export default function Dropdown({ className, buttonClassName, isStatic, childre aria-haspopup="true" aria-expanded="false" title={title} - id={ariaId} + id={id ?? ariaId} disabled={disabled} > {text} diff --git a/apps/client/src/widgets/type_widgets/options/i18n.tsx b/apps/client/src/widgets/type_widgets/options/i18n.tsx index bd2c4c9e1..a1f9e63df 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n.tsx +++ b/apps/client/src/widgets/type_widgets/options/i18n.tsx @@ -62,7 +62,7 @@ function LocalizationOptions() { function LocaleSelector({ id, locales, currentValue, onChange }: { id?: string; locales: Locale[], currentValue: string, onChange: (newLocale: string) => void }) { const [ activeLocale, setActiveLocale ] = useState(locales.find(l => l.id === currentValue)); return ( - + {locales.map(locale => ( Date: Tue, 14 Oct 2025 18:42:20 +0300 Subject: [PATCH 14/15] refactor(options/i18n): share locale selector with content language selector --- .../src/widgets/ribbon/BasicPropertiesTab.tsx | 67 +++++-------------- .../options/components/LocaleSelector.tsx | 63 +++++++++++++++++ .../src/widgets/type_widgets/options/i18n.tsx | 30 ++------- 3 files changed, 83 insertions(+), 77 deletions(-) create mode 100644 apps/client/src/widgets/type_widgets/options/components/LocaleSelector.tsx diff --git a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx index b7ef4fa0e..0202f46e4 100644 --- a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx +++ b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx @@ -5,7 +5,7 @@ import { FormDropdownDivider, FormListBadge, FormListItem } from "../react/FormL import { getAvailableLocales, t } from "../../services/i18n"; import { useNoteLabel, useNoteLabelBoolean, useNoteProperty, useTriliumEvent, useTriliumOption } from "../react/hooks"; import mime_types from "../../services/mime_types"; -import { Locale, NoteType, ToggleInParentResponse } from "@triliumnext/commons"; +import { Locale, LOCALES, NoteType, ToggleInParentResponse } from "@triliumnext/commons"; import server from "../../services/server"; import dialog from "../../services/dialog"; import FormToggle from "../react/FormToggle"; @@ -20,6 +20,7 @@ import { TabContext } from "./ribbon-interface"; import Modal from "../react/Modal"; import { CodeMimeTypesList } from "../type_widgets/options/code_notes"; import { ContentLanguagesList } from "../type_widgets/options/i18n"; +import { LocaleSelector } from "../type_widgets/options/components/LocaleSelector"; export default function BasicPropertiesTab({ note }: TabContext) { return ( @@ -290,68 +291,30 @@ function NoteLanguageSwitch({ note }: { note?: FNote | null }) { id: "", name: t("note_language.not_set") }; - const [ currentNoteLanguage, setCurrentNoteLanguage ] = useNoteLabel(note, "language"); const [ modalShown, setModalShown ] = useState(false); - const locales = useMemo(() => { const enabledLanguages = JSON.parse(languages ?? "[]") as string[]; const filteredLanguages = getAvailableLocales().filter((l) => typeof l !== "object" || enabledLanguages.includes(l.id)); - const leftToRightLanguages = filteredLanguages.filter((l) => !l.rtl); - const rightToLeftLanguages = filteredLanguages.filter((l) => l.rtl); - - let locales: ("---" | Locale)[] = [ - DEFAULT_LOCALE - ]; - - if (leftToRightLanguages.length > 0) { - locales = [ - ...locales, - "---", - ...leftToRightLanguages - ]; - } - - if (rightToLeftLanguages.length > 0) { - locales = [ - ...locales, - "---", - ...rightToLeftLanguages - ]; - } - - // This will separate the list of languages from the "Configure languages" button. - // If there is at least one language. - locales.push("---"); - return locales; + return filteredLanguages; }, [ languages ]); - const currentLocale = useMemo(() => { - return locales.find(locale => typeof locale === "object" && locale.id === currentNoteLanguage) as Locale | undefined; - }, [ currentNoteLanguage ]); - return (
{t("basic_properties.language")}:   - - {locales.map(locale => { - if (typeof locale === "object") { - const checked = locale.id === (currentNoteLanguage ?? ""); - return setCurrentNoteLanguage(locale.id || null)} - >{locale.name} - } else { - return - } - })} + setModalShown(true)} + >{t("note_language.configure-languages")} + )} + > - setModalShown(true)} - >{t("note_language.configure-languages")} - + @@ -364,7 +327,7 @@ function NoteLanguageSwitch({ note }: { note?: FNote | null }) {
- ) + ); } function findTypeTitle(type?: NoteType, mime?: string | null) { diff --git a/apps/client/src/widgets/type_widgets/options/components/LocaleSelector.tsx b/apps/client/src/widgets/type_widgets/options/components/LocaleSelector.tsx new file mode 100644 index 000000000..0161ae6a8 --- /dev/null +++ b/apps/client/src/widgets/type_widgets/options/components/LocaleSelector.tsx @@ -0,0 +1,63 @@ +import { Locale } from "@triliumnext/commons"; +import Dropdown from "../../../react/Dropdown"; +import { FormDropdownDivider, FormListItem } from "../../../react/FormList"; +import { ComponentChildren } from "preact"; +import { useMemo, useState } from "preact/hooks"; + +export function LocaleSelector({ id, locales, currentValue, onChange, defaultLocale, extraChildren }: { + id?: string; + locales: Locale[], + currentValue: string, + onChange: (newLocale: string) => void, + defaultLocale?: Locale, + extraChildren?: ComponentChildren +}) { + const [ activeLocale, setActiveLocale ] = useState(defaultLocale?.id === currentValue ? defaultLocale : locales.find(l => l.id === currentValue)); + console.log("defaultLocale ", defaultLocale, currentValue, activeLocale) + + const processedLocales = useMemo(() => { + const leftToRightLanguages = locales.filter((l) => !l.rtl); + const rightToLeftLanguages = locales.filter((l) => l.rtl); + + let items: ("---" | Locale)[] = []; + if (defaultLocale) items.push(defaultLocale); + + if (leftToRightLanguages.length > 0) { + if (items.length > 0) items.push("---"); + items = [ ...items, ...leftToRightLanguages ]; + } + + if (rightToLeftLanguages.length > 0) { + items = [ + ...items, + "---", + ...rightToLeftLanguages + ]; + } + + if (extraChildren) { + items.push("---"); + } + return items; + }, [ locales ]); + + return ( + + {processedLocales.map(locale => { + if (typeof locale === "object") { + return { + setActiveLocale(locale); + onChange(locale.id); + }} + >{locale.name} + } else { + return + } + })} + {extraChildren} + + ) +} diff --git a/apps/client/src/widgets/type_widgets/options/i18n.tsx b/apps/client/src/widgets/type_widgets/options/i18n.tsx index a1f9e63df..36a0a1100 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n.tsx +++ b/apps/client/src/widgets/type_widgets/options/i18n.tsx @@ -1,20 +1,18 @@ -import { useMemo, useState } from "preact/hooks"; +import { useMemo } from "preact/hooks"; import { getAvailableLocales, t } from "../../../services/i18n"; import FormSelect from "../../react/FormSelect"; import OptionsRow from "./components/OptionsRow"; import OptionsSection from "./components/OptionsSection"; import { useTriliumOption, useTriliumOptionJson } from "../../react/hooks"; import type { Locale } from "@triliumnext/commons"; -import { isElectron, restartDesktopApp } from "../../../services/utils"; -import FormRadioGroup, { FormInlineRadioGroup } from "../../react/FormRadioGroup"; +import { restartDesktopApp } from "../../../services/utils"; +import FormRadioGroup from "../../react/FormRadioGroup"; import FormText from "../../react/FormText"; import RawHtml from "../../react/RawHtml"; import Admonition from "../../react/Admonition"; import Button from "../../react/Button"; import CheckboxList from "./components/CheckboxList"; -import FormDropdownList from "../../react/FormDropdownList"; -import Dropdown from "../../react/Dropdown"; -import { FormListItem } from "../../react/FormList"; +import { LocaleSelector } from "./components/LocaleSelector"; export default function InternationalizationOptions() { return ( @@ -35,7 +33,6 @@ function LocalizationOptions() { return true; }), formattingLocales: [ - { id: "", name: t("i18n.formatting-locale-auto") }, ...allLocales.filter(locale => locale.electronLocale) ] } @@ -51,7 +48,7 @@ function LocalizationOptions() { { - + } @@ -59,23 +56,6 @@ function LocalizationOptions() { ) } -function LocaleSelector({ id, locales, currentValue, onChange }: { id?: string; locales: Locale[], currentValue: string, onChange: (newLocale: string) => void }) { - const [ activeLocale, setActiveLocale ] = useState(locales.find(l => l.id === currentValue)); - return ( - - {locales.map(locale => ( - { - setActiveLocale(locale); - onChange(locale.id); - }} - >{locale.name} - ))} - - ) -} - function DateSettings() { const [ firstDayOfWeek, setFirstDayOfWeek ] = useTriliumOption("firstDayOfWeek"); const [ firstWeekOfYear, setFirstWeekOfYear ] = useTriliumOption("firstWeekOfYear"); From a68e4bdbec9208722ac58ced3f6f1d98c1e2f61a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 14 Oct 2025 18:43:56 +0300 Subject: [PATCH 15/15] chore(ribbon): add an icon to "Configure languages" --- apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx index 0202f46e4..11a843233 100644 --- a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx +++ b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx @@ -310,6 +310,7 @@ function NoteLanguageSwitch({ note }: { note?: FNote | null }) { extraChildren={( setModalShown(true)} + icon="bx bx-cog" >{t("note_language.configure-languages")} )} >