From b12934923671f73fc97bbb4f131c331a77e32a6c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 13 Oct 2025 19:03:56 +0300 Subject: [PATCH] feat(website/i18n): translate support us --- apps/website/package.json | 3 +- .../public/translations/en/translation.json | 14 ++++++- apps/website/src/components/Button.tsx | 2 +- apps/website/src/i18n.ts | 6 ++- .../website/src/pages/SupportUs/SupportUs.tsx | 42 ++++++++++++++----- pnpm-lock.yaml | 11 +++++ 6 files changed, 63 insertions(+), 15 deletions(-) diff --git a/apps/website/package.json b/apps/website/package.json index d5aa5117c..6065c3559 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -12,7 +12,8 @@ "i18next-http-backend": "3.0.2", "preact": "10.27.2", "preact-iso": "2.11.0", - "preact-render-to-string": "6.6.2" + "preact-render-to-string": "6.6.2", + "react-i18next": "16.0.0" }, "devDependencies": { "@preact/preset-vite": "2.10.2", diff --git a/apps/website/public/translations/en/translation.json b/apps/website/public/translations/en/translation.json index 5619e4715..ea1a1352a 100644 --- a/apps/website/public/translations/en/translation.json +++ b/apps/website/public/translations/en/translation.json @@ -124,9 +124,19 @@ }, "support_us": { "title": "Support us", + "financial_donations_title": "Financial donations", + "financial_donations_description": "Trilium is built and maintained with hundreds of hours of work. Your support keeps it open-source, improves features, and covers costs such as hosting.", + "financial_donations_cta": "Consider supporting the main developer (eliandoran) of the application via:", "github_sponsors": "GitHub Sponsors", "paypal": "PayPal", - "buy_me_a_coffee": "Buy Me A Coffee", - "other_ways_to_contribute": "Other ways to contribute" + "buy_me_a_coffee": "Buy Me A Coffee" + }, + "contribute": { + "title": "Other ways to contribute", + "way_translate": "Translate the application into your native language via Weblate.", + "way_community": "Interact with the community on GitHub Discussions or on Matrix.", + "way_reports": "Report bugs via GitHub issues.", + "way_document": "Improve the documentation by informing us on gaps in the documentation or contributing guides, FAQs or tutorials.", + "way_market": "Spread the word: Share Trilium Notes with friends, or on blogs and social media." } } diff --git a/apps/website/src/components/Button.tsx b/apps/website/src/components/Button.tsx index 729346e58..3c2c3e455 100644 --- a/apps/website/src/components/Button.tsx +++ b/apps/website/src/components/Button.tsx @@ -6,7 +6,7 @@ interface LinkProps { className?: string; href?: string; openExternally?: boolean; - children: ComponentChildren; + children?: ComponentChildren; title?: string; onClick?: (e: MouseEvent) => void; } diff --git a/apps/website/src/i18n.ts b/apps/website/src/i18n.ts index bce6a3b65..32bd7d09c 100644 --- a/apps/website/src/i18n.ts +++ b/apps/website/src/i18n.ts @@ -1,7 +1,11 @@ import { default as i18next } from "i18next"; import HttpApi from 'i18next-http-backend'; +import { initReactI18next } from "react-i18next"; + +i18next + .use(HttpApi) + .use(initReactI18next); -i18next.use(HttpApi) await i18next.init({ debug: true, lng: "en", diff --git a/apps/website/src/pages/SupportUs/SupportUs.tsx b/apps/website/src/pages/SupportUs/SupportUs.tsx index c1f5cd64f..ec3bba08f 100644 --- a/apps/website/src/pages/SupportUs/SupportUs.tsx +++ b/apps/website/src/pages/SupportUs/SupportUs.tsx @@ -7,6 +7,7 @@ import Button, { Link } from "../../components/Button.js"; import Card from "../../components/Card.js"; import { usePageTitle } from "../../hooks.js"; import { t } from "../../i18n.js"; +import { Trans } from "react-i18next"; export default function Donate() { usePageTitle(t("support_us.title")); @@ -15,13 +16,20 @@ export default function Donate() { <>
- +

- Trilium is built and maintained with hundreds of hours of work. - Your support keeps it open-source, improves features, and covers costs such as hosting. + }} + />

-

Consider supporting the main developer (eliandoran) of the application via:

+

+ }} + /> +

- +
    -
  • Translate the application into your native language via Weblate.
  • -
  • Interact with the community on GitHub Discussions or on Matrix.
  • -
  • Report bugs via GitHub issues.
  • -
  • Improve the documentation by informing us on gaps in the documentation or contributing guides, FAQs or tutorials.
  • -
  • Spread the word: Share Trilium Notes with friends, or on blogs and social media.
  • +
  • + }} /> +
  • +
  • + , + Matrix: + }} + /> +
  • +
  • + }} + /> +
  • +
  • +
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index faa37e2a1..224c9aed8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -780,6 +780,9 @@ importers: preact-render-to-string: specifier: 6.6.2 version: 6.6.2(preact@10.27.2) + react-i18next: + specifier: 16.0.0 + version: 16.0.0(i18next@25.6.0(typescript@5.9.3))(react-dom@19.1.0(react@16.14.0))(react@16.14.0)(typescript@5.9.3) devDependencies: '@preact/preset-vite': specifier: 2.10.2 @@ -14697,6 +14700,8 @@ snapshots: '@ckeditor/ckeditor5-core': 47.0.0 '@ckeditor/ckeditor5-utils': 47.0.0 ckeditor5: 47.0.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41) + transitivePeerDependencies: + - supports-color '@ckeditor/ckeditor5-code-block@47.0.0(patch_hash=2361d8caad7d6b5bddacc3a3b4aa37dbfba260b1c1b22a450413a79c1bb1ce95)': dependencies: @@ -14949,6 +14954,8 @@ snapshots: '@ckeditor/ckeditor5-utils': 47.0.0 ckeditor5: 47.0.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41) es-toolkit: 1.39.5 + transitivePeerDependencies: + - supports-color '@ckeditor/ckeditor5-editor-multi-root@47.0.0': dependencies: @@ -14971,6 +14978,8 @@ snapshots: '@ckeditor/ckeditor5-table': 47.0.0 '@ckeditor/ckeditor5-utils': 47.0.0 ckeditor5: 47.0.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41) + transitivePeerDependencies: + - supports-color '@ckeditor/ckeditor5-emoji@47.0.0': dependencies: @@ -15442,6 +15451,8 @@ snapshots: '@ckeditor/ckeditor5-ui': 47.0.0 '@ckeditor/ckeditor5-utils': 47.0.0 ckeditor5: 47.0.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41) + transitivePeerDependencies: + - supports-color '@ckeditor/ckeditor5-restricted-editing@47.0.0': dependencies: