mirror of
https://github.com/zadam/trilium.git
synced 2025-12-23 16:49:58 +01:00
feat(website/i18n): swap locale when footer
This commit is contained in:
@@ -5,11 +5,13 @@ import githubDiscussionsIcon from "../assets/boxicons/bx-discussion.svg?raw";
|
||||
import matrixIcon from "../assets/boxicons/bx-message-dots.svg?raw";
|
||||
import redditIcon from "../assets/boxicons/bx-reddit.svg?raw";
|
||||
import { Link } from "./Button.js";
|
||||
import { LOCALES } from "../i18n";
|
||||
import { LOCALES, swapLocaleInUrl } from "../i18n";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useLocation } from "preact-iso";
|
||||
|
||||
export default function Footer() {
|
||||
const { t } = useTranslation();
|
||||
const { url } = useLocation();
|
||||
|
||||
return (
|
||||
<footer>
|
||||
@@ -26,7 +28,7 @@ export default function Footer() {
|
||||
<div class="row">
|
||||
<nav class="languages">
|
||||
{LOCALES.map(locale => (
|
||||
<Link href={"/" + locale.id + "/"}>{locale.name}</Link>
|
||||
<Link href={swapLocaleInUrl(url, locale.id)}>{locale.name}</Link>
|
||||
))}
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user