feat(website/i18n): use translations in get-started

This commit is contained in:
Elian Doran 2025-10-11 20:46:41 +03:00
parent 2c71e995f2
commit d56debaa9f
No known key found for this signature in database
3 changed files with 15 additions and 6 deletions

View File

@ -0,0 +1,9 @@
{
"get-started": {
"title": "Get started",
"desktop_title": "Download the desktop application (v{{version}})",
"architecture": "Architecture:",
"older_releases": "See older releases",
"server_title": "Set up a server for access on multiple devices"
}
}

View File

@ -1,7 +1,6 @@
import { default as i18next } from "i18next";
import HttpApi from 'i18next-http-backend';
console.log("INIT I18NEXT");
i18next.use(HttpApi)
await i18next.init({
debug: true,

View File

@ -8,6 +8,7 @@ import Icon from "../../components/Icon.js";
import helpIcon from "../../assets/boxicons/bx-help-circle.svg?raw";
import "./get-started.css";
import packageJson from "../../../../../package.json" with { type: "json" };
import { t } from "../../i18n.js";
export default function DownloadPage() {
const [ currentArch, setCurrentArch ] = useState<Architecture>("x64");
@ -18,13 +19,13 @@ export default function DownloadPage() {
setUserPlatform(getPlatform() ?? "windows");
}, []);
usePageTitle("Get started");
usePageTitle(t("get-started.title"));
return (
<>
<Section title={`Download the desktop application (v${packageJson.version})`} className="fill accented download-desktop">
<Section title={t("get-started.desktop_title", { version: packageJson.version })} className="fill accented download-desktop">
<div className="architecture-switch">
<span>Architecture:</span>
<span>{t("get-started.architecture")}</span>
<div class="toggle-wrapper">
{(["x64", "arm64"] as const).map(arch => (
@ -45,11 +46,11 @@ export default function DownloadPage() {
</div>
<div class="download-footer">
<Link href="https://github.com/TriliumNext/Trilium/releases/" openExternally>See older releases</Link>
<Link href="https://github.com/TriliumNext/Trilium/releases/" openExternally>{t("get-started.older_releases")}</Link>
</div>
</Section>
<Section title="Set up a server for access on multiple devices">
<Section title={t("get-started.server_title")}>
<div className="grid-2-cols download-server">
{Object.entries(downloadMatrix.server).map(entry => (
<DownloadCard app="server" arch={currentArch} entry={entry} />