mirror of
https://github.com/zadam/trilium.git
synced 2025-12-23 16:49:58 +01:00
feat(website/i18n): get translation to actually render
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { ComponentChildren, HTMLAttributes } from "preact";
|
||||
import { Link } from "./Button.js";
|
||||
import Icon from "./Icon.js";
|
||||
import { t } from "../i18n.js";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
||||
title: ComponentChildren;
|
||||
@@ -13,6 +13,8 @@ interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
||||
}
|
||||
|
||||
export default function Card({ title, children, imageUrl, iconSvg, className, moreInfoUrl, ...restProps }: CardProps) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className={`card ${className}`} {...restProps}>
|
||||
{imageUrl && <img class="image" src={imageUrl} loading="lazy" />}
|
||||
|
||||
@@ -4,16 +4,17 @@ import Button from "./Button.js";
|
||||
import downloadIcon from "../assets/boxicons/bx-arrow-in-down-square-half.svg?raw";
|
||||
import packageJson from "../../../../package.json" with { type: "json" };
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
import { t } from "../i18n.js";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
interface DownloadButtonProps {
|
||||
big?: boolean;
|
||||
}
|
||||
|
||||
export default function DownloadButton({ big }: DownloadButtonProps) {
|
||||
const { t } = useTranslation();
|
||||
const [ recommendedDownload, setRecommendedDownload ] = useState<RecommendedDownload | null>();
|
||||
useEffect(() => {
|
||||
getRecommendedDownload()?.then(setRecommendedDownload);
|
||||
getRecommendedDownload(t)?.then(setRecommendedDownload);
|
||||
}, []);
|
||||
|
||||
return (recommendedDownload &&
|
||||
|
||||
@@ -5,9 +5,12 @@ 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, t } from "../i18n";
|
||||
import { LOCALES } from "../i18n";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function Footer() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<footer>
|
||||
<div class="content-wrapper">
|
||||
@@ -33,6 +36,8 @@ export default function Footer() {
|
||||
}
|
||||
|
||||
export function SocialButtons({ className, withText }: { className?: string, withText?: boolean }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className={`social-buttons ${className}`}>
|
||||
<SocialButton
|
||||
|
||||
Reference in New Issue
Block a user