From eb93762ecc06a54353e7b6629efa663ad20824f9 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 25 Oct 2025 20:10:11 +0300 Subject: [PATCH] chore(website/i18n): missing translations in header --- .../public/translations/en/translation.json | 5 +++++ .../public/translations/ro/translation.json | 5 +++++ apps/website/src/components/Header.tsx | 14 ++++++++------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/website/public/translations/en/translation.json b/apps/website/public/translations/en/translation.json index 929a307a8..4801fae1c 100644 --- a/apps/website/public/translations/en/translation.json +++ b/apps/website/public/translations/en/translation.json @@ -106,6 +106,11 @@ "linux_small": "for Linux", "more_platforms": "More platforms & server setup" }, + "header": { + "get-started": "Get started", + "documentation": "Documentation", + "support-us": "Support us" + }, "footer": { "copyright_and_the": " and the ", "copyright_community": "community" diff --git a/apps/website/public/translations/ro/translation.json b/apps/website/public/translations/ro/translation.json index 18e47da9e..a60937a3f 100644 --- a/apps/website/public/translations/ro/translation.json +++ b/apps/website/public/translations/ro/translation.json @@ -106,6 +106,11 @@ "linux_small": "pentru Linux", "more_platforms": "Mai multe platforme și instalarea server-ului" }, + "header": { + "get-started": "Primii pași", + "documentation": "Documentație", + "support-us": "Sprijină-ne" + }, "footer": { "copyright_and_the": " și ", "copyright_community": "comunitatea" diff --git a/apps/website/src/components/Header.tsx b/apps/website/src/components/Header.tsx index 7ad0ca2aa..e4cd7cc3f 100644 --- a/apps/website/src/components/Header.tsx +++ b/apps/website/src/components/Header.tsx @@ -9,6 +9,7 @@ import Icon from "./Icon.js"; import logoPath from "../assets/icon-color.svg"; import menuIcon from "../assets/boxicons/bx-menu.svg?raw"; import { LocaleContext } from ".."; +import { useTranslation } from "react-i18next"; interface HeaderLink { url: string; @@ -16,17 +17,18 @@ interface HeaderLink { external?: boolean; } -const HEADER_LINKS: HeaderLink[] = [ - { url: "/get-started/", text: "Get started" }, - { url: "https://docs.triliumnotes.org/", text: "Documentation", external: true }, - { url: "/support-us/", text: "Support us" } -] - export function Header(props: {repoStargazersCount: number}) { const { url } = useLocation(); + const { t } = useTranslation(); const locale = useContext(LocaleContext); const [ mobileMenuShown, setMobileMenuShown ] = useState(false); + const HEADER_LINKS = useMemo(() => [ + { url: "/get-started/", text: t("header.get-started") }, + { url: "https://docs.triliumnotes.org/", text: t("header.documentation"), external: true }, + { url: "/support-us/", text: t("header.support-us") } + ], [ locale ]); + return (