From 2b915a12171d02959cad1cd9a9e9536cf2c4d25c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 13 Oct 2025 19:22:14 +0300 Subject: [PATCH] feat(website/i18n): translate download options --- .../public/translations/en/translation.json | 52 ++++++++++++ apps/website/src/download-helper.ts | 81 ++++++++++--------- 2 files changed, 93 insertions(+), 40 deletions(-) diff --git a/apps/website/public/translations/en/translation.json b/apps/website/public/translations/en/translation.json index 8613c3860..8e9106d41 100644 --- a/apps/website/public/translations/en/translation.json +++ b/apps/website/public/translations/en/translation.json @@ -142,5 +142,57 @@ "404": { "title": "404: Not Found", "description": "The page you were looking for could not be found. Maybe it was deleted or the URL is incorrect." + }, + "download_helper_desktop_windows": { + "title_x64": "Windows 64-bit", + "title_arm64": "Windows on ARM", + "description_x64": "Compatible with Intel or AMD devices running Windows 10 and 11.", + "description_arm64": "Compatible with ARM devices (e.g. with Qualcomm Snapdragon).", + "quick_start": "To install via Winget:", + "download_exe": "Download Installer (.exe)", + "download_zip": "Portable (.zip)", + "download_scoop": "Scoop" + }, + "download_helper_desktop_linux": { + "title_x64": "Linux 64-bit", + "title_arm64": "Linux on ARM", + "description_x64": "For most Linux distributions, compatible with x86_64 architecture.", + "description_arm64": "For ARM-based Linux distributions, compatible with aarch64 architecture.", + "quick_start": "Select an appropriate package format, depending on your distribution:", + "download_deb": ".deb", + "download_rpm": ".rpm", + "download_flatpak": ".flatpak", + "download_zip": "Portable (.zip)", + "download_nixpkgs": "nixpkgs", + "download_aur": "AUR" + }, + "download_helper_desktop_macos": { + "title_x64": "macOS for Intel", + "title_arm64": "macOS for Apple Silicon", + "description_x64": "For Intel-based Macs running macOS Big Sur or later.", + "description_arm64": "For Apple Silicon Macs such as those with M1 and M2 chips.", + "quick_start": "To install via Homebrew:", + "download_dmg": "Download Installer (.dmg)", + "download_homebrew_cask": "Homebrew Cask", + "download_zip": "Portable (.zip)" + }, + "download_helper_server_docker": { + "title": "Self-hosted using Docker", + "description": "Easily deploy on Windows, Linux or macOS using a Docker container.", + "download_dockerhub": "Docker Hub", + "download_ghcr": "ghcr.io" + }, + "download_helper_server_linux": { + "title": "Self-hosted on Linux", + "description": "Deploy Trilium Notes on your own server or VPS, compatible with most distributions.", + "download_tar_x64": "x64 (.tar.xz)", + "download_tar_arm64": "ARM (.tar.xz)", + "download_nixos": "NixOS module" + }, + "download_helper_server_hosted": { + "title": "Paid hosting", + "description": "Trilium Notes hosted on PikaPods, a paid service for easy access and management. Not directly affiliated with the Trilium team.", + "download_pikapod": "Set up on PikaPods", + "download_triliumcc": "Alternatively see trilium.cc" } } diff --git a/apps/website/src/download-helper.ts b/apps/website/src/download-helper.ts index 75c71afcf..a4f9eedb1 100644 --- a/apps/website/src/download-helper.ts +++ b/apps/website/src/download-helper.ts @@ -1,4 +1,5 @@ import rootPackageJson from '../../../package.json' with { type: "json" }; +import { t } from './i18n'; export type App = "desktop" | "server"; @@ -37,139 +38,139 @@ export const downloadMatrix: DownloadMatrix = { desktop: { windows: { title: { - x64: "Windows 64-bit", - arm64: "Windows on ARM" + x64: t("download_helper_desktop_windows.title_x64"), + arm64: t("download_helper_desktop_windows.title_arm64") }, description: { - x64: "Compatible with Intel or AMD devices running Windows 10 and 11.", - arm64: "Compatible with ARM devices (e.g. with Qualcomm Snapdragon).", + x64: t("download_helper_desktop_windows.description_x64"), + arm64: t("download_helper_desktop_windows.description_arm64"), }, - quickStartTitle: "To install via Winget:", + quickStartTitle: t("download_helper_desktop_windows.quick_start"), quickStartCode: "winget install TriliumNext.Notes", downloads: { exe: { recommended: true, - name: "Download Installer (.exe)" + name: t("download_helper_desktop_windows.download_exe") }, zip: { - name: "Portable (.zip)" + name: t("download_helper_desktop_windows.download_zip") }, scoop: { - name: "Scoop", + name: t("download_helper_desktop_windows.download_scoop"), url: "https://scoop.sh/#/apps?q=trilium&id=7c08bc3c105b9ee5c00dd4245efdea0f091b8a5c" } } }, linux: { title: { - x64: "Linux 64-bit", - arm64: "Linux on ARM" + x64: t("download_helper_desktop_linux.title_x64"), + arm64: t("download_helper_desktop_linux.title_arm64") }, description: { - x64: "For most Linux distributions, compatible with x86_64 architecture.", - arm64: "For ARM-based Linux distributions, compatible with aarch64 architecture.", + x64: t("download_helper_desktop_linux.description_x64"), + arm64: t("download_helper_desktop_linux.description_arm64"), }, - quickStartTitle: "Select an appropriate package format, depending on your distribution:", + quickStartTitle: t("download_helper_desktop_linux.quick_start"), downloads: { deb: { recommended: true, - name: ".deb" + name: t("download_helper_desktop_linux.download_deb") }, rpm: { recommended: true, - name: ".rpm" + name: t("download_helper_desktop_linux.download_rpm") }, flatpak: { - name: ".flatpak" + name: t("download_helper_desktop_linux.download_flatpak") }, zip: { - name: "Portable (.zip)" + name: t("download_helper_desktop_linux.download_zip") }, nixpkgs: { - name: "nixpkgs", + name: t("download_helper_desktop_linux.download_nixpkgs"), url: "https://search.nixos.org/packages?query=trilium-next" }, aur: { - name: "AUR", + name: t("download_helper_desktop_linux.download_aur"), url: "https://aur.archlinux.org/packages/triliumnext-bin" } } }, macos: { title: { - x64: "macOS for Intel", - arm64: "macOS for Apple Silicon" + x64: t("download_helper_desktop_macos.title_x64"), + arm64: t("download_helper_desktop_macos.title_arm64") }, description: { - x64: "For Intel-based Macs running macOS Big Sur or later.", - arm64: "For Apple Silicon Macs such as those with M1 and M2 chips.", + x64: t("download_helper_desktop_macos.description_x64"), + arm64: t("download_helper_desktop_macos.description_arm64"), }, - quickStartTitle: "To install via Homebrew:", + quickStartTitle: t("download_helper_desktop_macos.quick_start"), quickStartCode: "brew install --cask trilium-notes", downloads: { dmg: { recommended: true, - name: "Download Installer (.dmg)" + name: t("download_helper_desktop_macos.download_dmg") }, homebrew: { - name: "Homebrew Cask", + name: t("download_helper_desktop_macos.download_homebrew_cask"), url: "https://formulae.brew.sh/cask/trilium-notes#default" }, zip: { - name: "Portable (.zip)" + name: t("download_helper_desktop_macos.download_zip") } } } }, server: { docker: { - title: "Self-hosted using Docker", - description: "Easily deploy on Windows, Linux or macOS using a Docker container.", + title: t("download_helper_server_docker.title"), + description: t("download_helper_server_docker.description"), helpUrl: "https://docs.triliumnotes.org/User%20Guide/User%20Guide/Installation%20%26%20Setup/Server%20Installation/1.%20Installing%20the%20server/Using%20Docker.html", quickStartCode: "docker pull triliumnext/trilium\ndocker run -p 8080:8080 -d ./data:/home/node/trilium-data triliumnext/trilium", downloads: { dockerhub: { - name: "Docker Hub", + name: t("download_helper_server_docker.download_dockerhub"), url: "https://hub.docker.com/r/triliumnext/trilium" }, ghcr: { - name: "ghcr.io", + name: t("download_helper_server_docker.download_ghcr"), url: "https://github.com/TriliumNext/Trilium/pkgs/container/trilium" } } }, linux: { - title: "Self-hosted on Linux", - description: "Deploy Trilium Notes on your own server or VPS, compatible with most distributions.", + title: t("download_helper_server_linux.title"), + description: t("download_helper_server_linux.description"), helpUrl: "https://docs.triliumnotes.org/User%20Guide/User%20Guide/Installation%20%26%20Setup/Server%20Installation/1.%20Installing%20the%20server/Packaged%20version%20for%20Linux.html", downloads: { tarX64: { recommended: true, - name: "x64 (.tar.xz)", + name: t("download_helper_server_linux.download_tar_x64"), url: `https://github.com/TriliumNext/Trilium/releases/download/v${version}/TriliumNotes-Server-v${version}-linux-x64.tar.xz`, }, tarArm64: { recommended: true, - name: "ARM (.tar.xz)", + name: t("download_helper_server_linux.download_tar_arm64"), url: `https://github.com/TriliumNext/Trilium/releases/download/v${version}/TriliumNotes-Server-v${version}-linux-arm64.tar.xz` }, nixos: { - name: "NixOS module", + name: t("download_helper_server_linux.download_nixos"), url: "https://docs.triliumnotes.org/User%20Guide/User%20Guide/Installation%20&%20Setup/Server%20Installation/1.%20Installing%20the%20server/On%20NixOS" } } }, pikapod: { - title: "Paid hosting", - description: "Trilium Notes hosted on PikaPods, a paid service for easy access and management. Not directly affiliated with the Trilium team.", + title: t("download_helper_server_hosted.title"), + description: t("download_helper_server_hosted.description"), downloads: { pikapod: { recommended: true, - name: "Set up on PikaPods", + name: t("download_helper_server_hosted.download_pikapod"), url: "https://www.pikapods.com/pods?run=trilium-next" }, triliumcc: { - name: "Alternatively see trilium.cc", + name: t("download_helper_server_hosted.download_triliumcc"), url: "https://trilium.cc/" } }