mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 00:36:30 +02:00
Compare commits
36 Commits
c4e5494c14
...
40edd42740
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40edd42740 | ||
|
|
d2c7011735 | ||
|
|
a050d1741b | ||
|
|
18982865da | ||
|
|
3aa810fed7 | ||
|
|
c5ecc22c67 | ||
|
|
252f8ccb1f | ||
|
|
e1bb704383 | ||
|
|
dce0d9400b | ||
|
|
615c783fe3 | ||
|
|
f29411baf7 | ||
|
|
be5e70130c | ||
|
|
9ba1e9d732 | ||
|
|
e1dc4d1433 | ||
|
|
d0d268496c | ||
|
|
8a6950c945 | ||
|
|
477592d176 | ||
|
|
7e5c2ed79d | ||
|
|
bc580f2a88 | ||
|
|
71cd92e0b5 | ||
|
|
a4d92e12be | ||
|
|
c40279b480 | ||
|
|
4c7e7c157c | ||
|
|
c08386450a | ||
|
|
eb93762ecc | ||
|
|
2697f9a25d | ||
|
|
9515e2099b | ||
|
|
966c08da87 | ||
|
|
ea04446e81 | ||
|
|
e4f806ed14 | ||
|
|
49cf7ae1a3 | ||
|
|
1a6f5a027f | ||
|
|
f4796f0f9e | ||
|
|
30480b2c23 | ||
|
|
b7b1d17817 | ||
|
|
14e06c4555 |
@@ -648,7 +648,8 @@
|
||||
"logout": "Abmelden",
|
||||
"show-cheatsheet": "Cheatsheet anzeigen",
|
||||
"toggle-zen-mode": "Zen Modus",
|
||||
"new-version-available": "Neues Update verfügbar"
|
||||
"new-version-available": "Neues Update verfügbar",
|
||||
"download-update": "Version {{latestVersion}} herunterladen"
|
||||
},
|
||||
"sync_status": {
|
||||
"unknown": "<p>Der Synchronisations-Status wird bekannt, sobald der nächste Synchronisierungsversuch gestartet wird.</p><p>Klicke, um eine Synchronisierung jetzt auszulösen.</p>",
|
||||
@@ -2082,6 +2083,7 @@
|
||||
},
|
||||
"presentation_view": {
|
||||
"edit-slide": "Folie bearbeiten",
|
||||
"start-presentation": "Präsentation starten"
|
||||
"start-presentation": "Präsentation starten",
|
||||
"slide-overview": "Übersicht der Folien ein-/ausblenden"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,8 @@
|
||||
"explodeArchivesTooltip": "Если этот флажок установлен, Trilium будет читать файлы <code>.zip</code>, <code>.enex</code> и <code>.opml</code> и создавать заметки из файлов внутри этих архивов. Если флажок не установлен, Trilium будет прикреплять сами архивы к заметке.",
|
||||
"explodeArchives": "Прочитать содержимое архивов <code>.zip</code>, <code>.enex</code> и <code>.opml</code>.",
|
||||
"shrinkImagesTooltip": "<p>Если этот параметр включен, Trilium попытается уменьшить размер импортируемых изображений путём масштабирования и оптимизации, что может повлиять на воспринимаемое качество изображения. Если этот параметр не установлен, изображения будут импортированы без изменений.</p><p>Это не относится к импорту файлов <code>.zip</code> с метаданными, поскольку предполагается, что эти файлы уже оптимизированы.</p>",
|
||||
"codeImportedAsCode": "Импортировать распознанные файлы кода (например, <code>.json</code>) в виде заметок типа \"код\", если это неясно из метаданных"
|
||||
"codeImportedAsCode": "Импортировать распознанные файлы кода (например, <code>.json</code>) в виде заметок типа \"код\", если это неясно из метаданных",
|
||||
"importZipRecommendation": "При импорте ZIP файла иерархия заметок будет отражена в структуре папок внутри архива."
|
||||
},
|
||||
"markdown_import": {
|
||||
"dialog_title": "Импорт Markdown",
|
||||
@@ -980,7 +981,8 @@
|
||||
"open_sql_console_history": "Открыть историю консоли SQL",
|
||||
"show_shared_notes_subtree": "Поддерево общедоступных заметок",
|
||||
"switch_to_mobile_version": "Перейти на мобильную версию",
|
||||
"switch_to_desktop_version": "Переключиться на версию для ПК"
|
||||
"switch_to_desktop_version": "Переключиться на версию для ПК",
|
||||
"new-version-available": "Доступно обновление"
|
||||
},
|
||||
"zpetne_odkazy": {
|
||||
"backlink": "{{count}} ссылки",
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"test": "vitest",
|
||||
"preview": "pnpm build && vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -3,6 +3,44 @@
|
||||
"title": "Loslegen",
|
||||
"desktop_title": "Die Desktop-App herunterladen (v{{version}})",
|
||||
"architecture": "Architektur:",
|
||||
"older_releases": "Ältere Releases anzeigen"
|
||||
"older_releases": "Ältere Releases anzeigen",
|
||||
"server_title": "Richte einen Server für den Zugriff auf mehreren Geräten ein"
|
||||
},
|
||||
"hero_section": {
|
||||
"github": "GitHub",
|
||||
"get_started": "Loslegen",
|
||||
"dockerhub": "Docker Hub",
|
||||
"title": "Organisieren Sie Ihre Gedanken. Bauen Sie Ihre persönliche Wissensdatenbank auf.",
|
||||
"subtitle": "Trilium ist eine Open-Source-Lösung zum Erstellen von Notizen und Organisieren einer persönlichen Wissensdatenbank. Sie kann lokal auf dem Desktop verwendet oder mit einem selbst gehosteten Server synchronisieren werden, um erstellte Notizen überall verfügbar zu haben.",
|
||||
"screenshot_alt": "Screenshot der Desktop-Anwendung Trilium Notes"
|
||||
},
|
||||
"organization_benefits": {
|
||||
"title": "Organisation",
|
||||
"note_structure_title": "Notizstruktur",
|
||||
"attributes_title": "Notiz Labels und Beziehungen"
|
||||
},
|
||||
"productivity_benefits": {
|
||||
"revisions_title": "Notizrevisionen",
|
||||
"title": "Produktivität und Sicherheit",
|
||||
"sync_title": "Synchronisation",
|
||||
"protected_notes_title": "Geschützte Notizen",
|
||||
"jump_to_title": "Schnellsuche und Kommandos",
|
||||
"search_title": "Leistungsstarke Suche",
|
||||
"web_clipper_title": "Web clipper"
|
||||
},
|
||||
"note_types": {
|
||||
"text_title": "Text Notizen",
|
||||
"code_title": "Code Notizen",
|
||||
"canvas_title": "Canvas",
|
||||
"mermaid_title": "Mermaid Diagramm",
|
||||
"mindmap_title": "Mind Map"
|
||||
},
|
||||
"extensibility_benefits": {
|
||||
"import_export_title": "Import/Export",
|
||||
"scripting_title": "Erweitertes Scripting",
|
||||
"api_title": "REST API"
|
||||
},
|
||||
"collections": {
|
||||
"calendar_title": "Kalender"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
"web_clipper_content": "Grab web pages (or screenshots) and place them directly into Trilium using the web clipper browser extension."
|
||||
},
|
||||
"note_types": {
|
||||
"title": "Multiple ways to represent your information",
|
||||
"text_title": "Text notes",
|
||||
"text_description": "The notes are edited using a visual (WYSIWYG) editor, with support for tables, images, math expressions, code blocks with syntax highlighting. Quickly format the text using Markdown-like syntax or using slash commands.",
|
||||
"code_title": "Code notes",
|
||||
@@ -65,6 +66,7 @@
|
||||
"api_description": "Interact with Trilium programatically using its builtin REST API."
|
||||
},
|
||||
"collections": {
|
||||
"title": "Collections",
|
||||
"calendar_title": "Calendar",
|
||||
"calendar_description": "Organize your personal or professional events using a calendar, with support for all-day and multi-day events. See your events at a glance with the week, month and year views. Easy interaction to add or drag events.",
|
||||
"table_title": "Table",
|
||||
@@ -106,6 +108,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"
|
||||
@@ -163,7 +170,7 @@
|
||||
"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_x64": "For Intel-based Macs running macOS Monterey 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)",
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
"download_helper_desktop_macos": {
|
||||
"title_x64": "macOS para Intel",
|
||||
"title_arm64": "macOS para Apple Silicon",
|
||||
"description_x64": "Para Macs con procesador Intel que ejecuten macOS Big Sur o posterior.",
|
||||
"description_x64": "Para Macs con procesador Intel que ejecuten macOS Monterey o posterior.",
|
||||
"description_arm64": "Para Macs con Apple Silicon, como los que tienen chips M1 y M2.",
|
||||
"quick_start": "Para instalar mediante Homebrew:",
|
||||
"download_dmg": "Descargar instalador (.dmg)",
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
"download_helper_desktop_macos": {
|
||||
"title_x64": "macOS pour Intel",
|
||||
"title_arm64": "macOS pour Apple Silicon",
|
||||
"description_x64": "Pour les Mac basés sur Intel exécutant macOS Big Sur ou une version ultérieure.",
|
||||
"description_x64": "Pour les Mac basés sur Intel exécutant macOS Monterey ou une version ultérieure.",
|
||||
"description_arm64": "Pour les Mac Apple Silicon tels que ceux équipés de puces M1 et M2.",
|
||||
"quick_start": "Pour installer via Homebrew :",
|
||||
"download_dmg": "Télécharger le programme d'installation (.dmg)",
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
"download_helper_desktop_macos": {
|
||||
"title_x64": "macOS per Intel",
|
||||
"title_arm64": "macOS per Apple Silicon",
|
||||
"description_x64": "Per Mac basati su Intel con macOS Big Sur o versioni successive.",
|
||||
"description_x64": "Per Mac basati su Intel con macOS Monterey o versioni successive.",
|
||||
"description_arm64": "Per i Mac Apple Silicon, come quelli con chip M1 e M2.",
|
||||
"quick_start": "Per installare tramite Homebrew:",
|
||||
"download_dmg": "Scarica il programma di installazione (.dmg)",
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
"download_helper_desktop_macos": {
|
||||
"title_x64": "Intel 向け macOS",
|
||||
"title_arm64": "Apple Silicon 向け macOS",
|
||||
"description_x64": "macOS Big Sur 以降を実行している Intel ベースの Mac 向け。",
|
||||
"description_x64": "macOS Monterey 以降を実行している Intel ベースの Mac 向け。",
|
||||
"description_arm64": "M1 および M2 チップを搭載した Apple Silicon Mac 向け。",
|
||||
"quick_start": "Homebrew 経由でインストールするには:",
|
||||
"download_dmg": "インストーラーをダウンロード (.dmg)",
|
||||
|
||||
@@ -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"
|
||||
@@ -157,7 +162,7 @@
|
||||
"download_helper_desktop_macos": {
|
||||
"title_x64": "macOS pentru Intel",
|
||||
"title_arm64": "macOS pentru Apple Silicon",
|
||||
"description_x64": "Pentru Mac-uri bazate pe Intel ce rulează macOS Big Sur sau mai nou.",
|
||||
"description_x64": "Pentru Mac-uri bazate pe Intel ce rulează macOS Monterey sau mai nou.",
|
||||
"description_arm64": "Pentru Mac-uri bazate pe Apple Silicon, precum cele cu chip-uri M1, M2.",
|
||||
"quick_start": "Instalați prin Homebrew:",
|
||||
"download_dmg": "Descarcă instalatorul (.dmg)",
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
"download_helper_desktop_macos": {
|
||||
"title_x64": "macOS 適用於 Intel",
|
||||
"title_arm64": "macOS 適用於 Apple Silicon",
|
||||
"description_x64": "適用於搭載 Intel 處理器的 Mac,並運行 macOS Big Sur 或更新版本。",
|
||||
"description_x64": "適用於搭載 Intel 處理器的 Mac,並運行 macOS Monterey 或更新版本。",
|
||||
"description_arm64": "適用於搭載 Apple Silicon 的 Mac,例如配備 M1 和 M2 晶片的機型。",
|
||||
"quick_start": "透過 Homebrew 安裝:",
|
||||
"download_dmg": "下載安裝程式 (.dmg)",
|
||||
|
||||
@@ -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" />}
|
||||
|
||||
@@ -3,18 +3,21 @@ import "./DownloadButton.css";
|
||||
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 { useContext, useEffect, useState } from "preact/hooks";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { LocaleContext } from "../index.js";
|
||||
|
||||
interface DownloadButtonProps {
|
||||
big?: boolean;
|
||||
}
|
||||
|
||||
export default function DownloadButton({ big }: DownloadButtonProps) {
|
||||
const locale = useContext(LocaleContext);
|
||||
const { t } = useTranslation();
|
||||
const [ recommendedDownload, setRecommendedDownload ] = useState<RecommendedDownload | null>();
|
||||
useEffect(() => {
|
||||
getRecommendedDownload()?.then(setRecommendedDownload);
|
||||
}, []);
|
||||
getRecommendedDownload(t)?.then(setRecommendedDownload);
|
||||
}, [ t ]);
|
||||
|
||||
return (recommendedDownload &&
|
||||
<>
|
||||
@@ -35,7 +38,7 @@ export default function DownloadButton({ big }: DownloadButtonProps) {
|
||||
) : (
|
||||
<Button
|
||||
className={`download-button desktop-only ${big ? "big" : ""}`}
|
||||
href="/get-started/"
|
||||
href={`/${locale}/get-started/`}
|
||||
iconSvg={downloadIcon}
|
||||
text={<>
|
||||
{t("download_now.text")}
|
||||
|
||||
@@ -5,17 +5,26 @@ footer {
|
||||
color: var(--muted-color);
|
||||
font-size: 0.8em;
|
||||
|
||||
.content-wrapper {
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-direction: column-reverse;
|
||||
gap: 2em;
|
||||
margin-bottom: 1em;
|
||||
|
||||
@media (min-width: 720px) {
|
||||
flex-direction: row;
|
||||
}
|
||||
}
|
||||
|
||||
nav.languages {
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
gap: 0.5em 1em;
|
||||
}
|
||||
}
|
||||
|
||||
.social-buttons {
|
||||
|
||||
@@ -5,24 +5,46 @@ 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 { t } from "../i18n";
|
||||
import { LOCALES, swapLocaleInUrl } from "../i18n";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useLocation } from "preact-iso";
|
||||
import { useContext } from "preact/hooks";
|
||||
import { LocaleContext } from "..";
|
||||
|
||||
export default function Footer() {
|
||||
const { t } = useTranslation();
|
||||
const { url } = useLocation();
|
||||
const currentLocale = useContext(LocaleContext);
|
||||
|
||||
return (
|
||||
<footer>
|
||||
<div class="content-wrapper">
|
||||
<div class="footer-text">
|
||||
© 2024-2025 <Link href="https://github.com/eliandoran" openExternally>Elian Doran</Link>{t("footer.copyright_and_the")}<Link href="https://github.com/TriliumNext/Trilium/graphs/contributors" openExternally>{t("footer.copyright_community")}</Link>.<br />
|
||||
© 2017-2024 <Link href="https://github.com/zadam" openExternally>zadam</Link>.
|
||||
<div class="row">
|
||||
<div class="footer-text">
|
||||
© 2024-2025 <Link href="https://github.com/eliandoran" openExternally>Elian Doran</Link>{t("footer.copyright_and_the")}<Link href="https://github.com/TriliumNext/Trilium/graphs/contributors" openExternally>{t("footer.copyright_community")}</Link>.<br />
|
||||
© 2017-2024 <Link href="https://github.com/zadam" openExternally>zadam</Link>.
|
||||
</div>
|
||||
|
||||
<SocialButtons />
|
||||
</div>
|
||||
|
||||
<SocialButtons />
|
||||
<div class="row">
|
||||
<nav class="languages">
|
||||
{LOCALES.map(locale => (
|
||||
locale.id !== currentLocale
|
||||
? <Link href={swapLocaleInUrl(url, locale.id)}>{locale.name}</Link>
|
||||
: <span className="active">{locale.name}</span>
|
||||
))}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
)
|
||||
}
|
||||
|
||||
export function SocialButtons({ className, withText }: { className?: string, withText?: boolean }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className={`social-buttons ${className}`}>
|
||||
<SocialButton
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import "./Header.css";
|
||||
import { Link } from "./Button.js";
|
||||
import { SocialButtons, SocialButton } from "./Footer.js";
|
||||
import { useEffect, useMemo, useState } from "preact/hooks";
|
||||
import { useContext, useEffect, useMemo, useState } from "preact/hooks";
|
||||
import { useLocation } from 'preact-iso';
|
||||
import DownloadButton from './DownloadButton.js';
|
||||
import githubIcon from "../assets/boxicons/bx-github.svg?raw";
|
||||
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";
|
||||
import { swapLocaleInUrl } from "../i18n";
|
||||
|
||||
interface HeaderLink {
|
||||
url: string;
|
||||
@@ -15,21 +18,26 @@ 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 [ headerLinks, setHeaderLinks ] = useState<HeaderLink[]>([]);
|
||||
useEffect(() => {
|
||||
setHeaderLinks([
|
||||
{ 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, t ]);
|
||||
|
||||
return (
|
||||
<header>
|
||||
<div class="content-wrapper">
|
||||
<div class="first-row">
|
||||
<a class="banner" href="/">
|
||||
<a class="banner" href={`/${locale}/`}>
|
||||
<img src={logoPath} width="300" height="300" alt="Trilium Notes logo" /> <span>Trilium Notes</span>
|
||||
</a>
|
||||
|
||||
@@ -46,16 +54,17 @@ export function Header(props: {repoStargazersCount: number}) {
|
||||
</div>
|
||||
|
||||
<nav className={`${mobileMenuShown ? "mobile-shown" : ""}`}>
|
||||
{HEADER_LINKS.map(link => (
|
||||
<Link
|
||||
href={link.url}
|
||||
className={url === link.url ? "active" : ""}
|
||||
{headerLinks.map(link => {
|
||||
const linkHref = link.external ? link.url : swapLocaleInUrl(link.url, locale);
|
||||
return (<Link
|
||||
href={linkHref}
|
||||
className={url === linkHref ? "active" : ""}
|
||||
openExternally={link.external}
|
||||
onClick={() => {
|
||||
setMobileMenuShown(false);
|
||||
}}
|
||||
>{link.text}</Link>
|
||||
))}
|
||||
>{link.text}</Link>)
|
||||
})}
|
||||
|
||||
<SocialButtons className="mobile-only" withText />
|
||||
</nav>
|
||||
@@ -74,4 +83,4 @@ export function Header(props: {repoStargazersCount: number}) {
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { TFunction } from 'i18next';
|
||||
import rootPackageJson from '../../../package.json' with { type: "json" };
|
||||
import { t } from './i18n';
|
||||
|
||||
export type App = "desktop" | "server";
|
||||
|
||||
@@ -34,151 +34,155 @@ export interface RecommendedDownload {
|
||||
type DownloadMatrix = Record<App, { [ P in Platform ]?: DownloadMatrixEntry }>;
|
||||
|
||||
// Keep compatibility info inline with https://github.com/electron/electron/blob/main/README.md#platform-support.
|
||||
export const downloadMatrix: DownloadMatrix = {
|
||||
desktop: {
|
||||
windows: {
|
||||
title: {
|
||||
x64: t("download_helper_desktop_windows.title_x64"),
|
||||
arm64: t("download_helper_desktop_windows.title_arm64")
|
||||
},
|
||||
description: {
|
||||
x64: t("download_helper_desktop_windows.description_x64"),
|
||||
arm64: t("download_helper_desktop_windows.description_arm64"),
|
||||
},
|
||||
quickStartTitle: t("download_helper_desktop_windows.quick_start"),
|
||||
quickStartCode: "winget install TriliumNext.Notes",
|
||||
downloads: {
|
||||
exe: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_windows.download_exe")
|
||||
export function getDownloadMatrix(t: TFunction<"translation", undefined>): DownloadMatrix {
|
||||
return {
|
||||
desktop: {
|
||||
windows: {
|
||||
title: {
|
||||
x64: t("download_helper_desktop_windows.title_x64"),
|
||||
arm64: t("download_helper_desktop_windows.title_arm64")
|
||||
},
|
||||
zip: {
|
||||
name: t("download_helper_desktop_windows.download_zip")
|
||||
description: {
|
||||
x64: t("download_helper_desktop_windows.description_x64"),
|
||||
arm64: t("download_helper_desktop_windows.description_arm64"),
|
||||
},
|
||||
scoop: {
|
||||
name: t("download_helper_desktop_windows.download_scoop"),
|
||||
url: "https://scoop.sh/#/apps?q=trilium&id=7c08bc3c105b9ee5c00dd4245efdea0f091b8a5c"
|
||||
quickStartTitle: t("download_helper_desktop_windows.quick_start"),
|
||||
quickStartCode: "winget install TriliumNext.Notes",
|
||||
downloads: {
|
||||
exe: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_windows.download_exe")
|
||||
},
|
||||
zip: {
|
||||
name: t("download_helper_desktop_windows.download_zip")
|
||||
},
|
||||
scoop: {
|
||||
name: t("download_helper_desktop_windows.download_scoop"),
|
||||
url: "https://scoop.sh/#/apps?q=trilium&id=7c08bc3c105b9ee5c00dd4245efdea0f091b8a5c"
|
||||
}
|
||||
}
|
||||
},
|
||||
linux: {
|
||||
title: {
|
||||
x64: t("download_helper_desktop_linux.title_x64"),
|
||||
arm64: t("download_helper_desktop_linux.title_arm64")
|
||||
},
|
||||
description: {
|
||||
x64: t("download_helper_desktop_linux.description_x64"),
|
||||
arm64: t("download_helper_desktop_linux.description_arm64"),
|
||||
},
|
||||
quickStartTitle: t("download_helper_desktop_linux.quick_start"),
|
||||
downloads: {
|
||||
deb: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_linux.download_deb")
|
||||
},
|
||||
rpm: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_linux.download_rpm")
|
||||
},
|
||||
flatpak: {
|
||||
name: t("download_helper_desktop_linux.download_flatpak")
|
||||
},
|
||||
zip: {
|
||||
name: t("download_helper_desktop_linux.download_zip")
|
||||
},
|
||||
nixpkgs: {
|
||||
name: t("download_helper_desktop_linux.download_nixpkgs"),
|
||||
url: "https://search.nixos.org/packages?query=trilium-next"
|
||||
},
|
||||
aur: {
|
||||
name: t("download_helper_desktop_linux.download_aur"),
|
||||
url: "https://aur.archlinux.org/packages/triliumnext-bin"
|
||||
}
|
||||
}
|
||||
},
|
||||
macos: {
|
||||
title: {
|
||||
x64: t("download_helper_desktop_macos.title_x64"),
|
||||
arm64: t("download_helper_desktop_macos.title_arm64")
|
||||
},
|
||||
description: {
|
||||
x64: t("download_helper_desktop_macos.description_x64"),
|
||||
arm64: t("download_helper_desktop_macos.description_arm64"),
|
||||
},
|
||||
quickStartTitle: t("download_helper_desktop_macos.quick_start"),
|
||||
quickStartCode: "brew install --cask trilium-notes",
|
||||
downloads: {
|
||||
dmg: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_macos.download_dmg")
|
||||
},
|
||||
homebrew: {
|
||||
name: t("download_helper_desktop_macos.download_homebrew_cask"),
|
||||
url: "https://formulae.brew.sh/cask/trilium-notes#default"
|
||||
},
|
||||
zip: {
|
||||
name: t("download_helper_desktop_macos.download_zip")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
linux: {
|
||||
title: {
|
||||
x64: t("download_helper_desktop_linux.title_x64"),
|
||||
arm64: t("download_helper_desktop_linux.title_arm64")
|
||||
},
|
||||
description: {
|
||||
x64: t("download_helper_desktop_linux.description_x64"),
|
||||
arm64: t("download_helper_desktop_linux.description_arm64"),
|
||||
},
|
||||
quickStartTitle: t("download_helper_desktop_linux.quick_start"),
|
||||
downloads: {
|
||||
deb: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_linux.download_deb")
|
||||
},
|
||||
rpm: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_linux.download_rpm")
|
||||
},
|
||||
flatpak: {
|
||||
name: t("download_helper_desktop_linux.download_flatpak")
|
||||
},
|
||||
zip: {
|
||||
name: t("download_helper_desktop_linux.download_zip")
|
||||
},
|
||||
nixpkgs: {
|
||||
name: t("download_helper_desktop_linux.download_nixpkgs"),
|
||||
url: "https://search.nixos.org/packages?query=trilium-next"
|
||||
},
|
||||
aur: {
|
||||
name: t("download_helper_desktop_linux.download_aur"),
|
||||
url: "https://aur.archlinux.org/packages/triliumnext-bin"
|
||||
server: {
|
||||
docker: {
|
||||
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 -v ./data:/home/node/trilium-data triliumnext/trilium",
|
||||
downloads: {
|
||||
dockerhub: {
|
||||
name: t("download_helper_server_docker.download_dockerhub"),
|
||||
url: "https://hub.docker.com/r/triliumnext/trilium"
|
||||
},
|
||||
ghcr: {
|
||||
name: t("download_helper_server_docker.download_ghcr"),
|
||||
url: "https://github.com/TriliumNext/Trilium/pkgs/container/trilium"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
macos: {
|
||||
title: {
|
||||
x64: t("download_helper_desktop_macos.title_x64"),
|
||||
arm64: t("download_helper_desktop_macos.title_arm64")
|
||||
},
|
||||
description: {
|
||||
x64: t("download_helper_desktop_macos.description_x64"),
|
||||
arm64: t("download_helper_desktop_macos.description_arm64"),
|
||||
linux: {
|
||||
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: 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: 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: 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"
|
||||
}
|
||||
}
|
||||
},
|
||||
quickStartTitle: t("download_helper_desktop_macos.quick_start"),
|
||||
quickStartCode: "brew install --cask trilium-notes",
|
||||
downloads: {
|
||||
dmg: {
|
||||
recommended: true,
|
||||
name: t("download_helper_desktop_macos.download_dmg")
|
||||
},
|
||||
homebrew: {
|
||||
name: t("download_helper_desktop_macos.download_homebrew_cask"),
|
||||
url: "https://formulae.brew.sh/cask/trilium-notes#default"
|
||||
},
|
||||
zip: {
|
||||
name: t("download_helper_desktop_macos.download_zip")
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
server: {
|
||||
docker: {
|
||||
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 -v ./data:/home/node/trilium-data triliumnext/trilium",
|
||||
downloads: {
|
||||
dockerhub: {
|
||||
name: t("download_helper_server_docker.download_dockerhub"),
|
||||
url: "https://hub.docker.com/r/triliumnext/trilium"
|
||||
},
|
||||
ghcr: {
|
||||
name: t("download_helper_server_docker.download_ghcr"),
|
||||
url: "https://github.com/TriliumNext/Trilium/pkgs/container/trilium"
|
||||
}
|
||||
}
|
||||
},
|
||||
linux: {
|
||||
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: 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: 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: 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: t("download_helper_server_hosted.title"),
|
||||
description: t("download_helper_server_hosted.description"),
|
||||
downloads: {
|
||||
pikapod: {
|
||||
recommended: true,
|
||||
name: t("download_helper_server_hosted.download_pikapod"),
|
||||
url: "https://www.pikapods.com/pods?run=trilium-next"
|
||||
},
|
||||
triliumcc: {
|
||||
name: t("download_helper_server_hosted.download_triliumcc"),
|
||||
url: "https://trilium.cc/"
|
||||
pikapod: {
|
||||
title: t("download_helper_server_hosted.title"),
|
||||
description: t("download_helper_server_hosted.description"),
|
||||
downloads: {
|
||||
pikapod: {
|
||||
recommended: true,
|
||||
name: t("download_helper_server_hosted.download_pikapod"),
|
||||
url: "https://www.pikapods.com/pods?run=trilium-next"
|
||||
},
|
||||
triliumcc: {
|
||||
name: t("download_helper_server_hosted.download_triliumcc"),
|
||||
url: "https://trilium.cc/"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export function buildDownloadUrl(app: App, platform: Platform, format: string, architecture: Architecture): string {
|
||||
export function buildDownloadUrl(t: TFunction<"translation", undefined>, app: App, platform: Platform, format: string, architecture: Architecture): string {
|
||||
const downloadMatrix = getDownloadMatrix(t);
|
||||
|
||||
if (app === "desktop") {
|
||||
return downloadMatrix.desktop[platform]?.downloads[format].url ??
|
||||
`https://github.com/TriliumNext/Trilium/releases/download/v${version}/TriliumNotes-v${version}-${platform}-${architecture}.${format}`;
|
||||
@@ -218,8 +222,9 @@ export function getPlatform(): Platform | null {
|
||||
}
|
||||
}
|
||||
|
||||
export async function getRecommendedDownload(): Promise<RecommendedDownload | null> {
|
||||
export async function getRecommendedDownload(t: TFunction<"translation", undefined>): Promise<RecommendedDownload | null> {
|
||||
if (typeof window === "undefined") return null;
|
||||
const downloadMatrix = getDownloadMatrix(t);
|
||||
|
||||
const architecture = await getArchitecture();
|
||||
const platform = getPlatform();
|
||||
@@ -233,7 +238,7 @@ export async function getRecommendedDownload(): Promise<RecommendedDownload | nu
|
||||
if (!recommendedDownload) return null;
|
||||
|
||||
const format = recommendedDownload[0];
|
||||
const url = buildDownloadUrl("desktop", platform, format || 'zip', architecture);
|
||||
const url = buildDownloadUrl(t, "desktop", platform, format || 'zip', architecture);
|
||||
|
||||
const platformTitle = platformInfo.title;
|
||||
const name = typeof platformTitle === "string" ? platformTitle : platformTitle[architecture] as string;
|
||||
|
||||
31
apps/website/src/i18n.spec.ts
Normal file
31
apps/website/src/i18n.spec.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { extractLocaleFromUrl, mapLocale, swapLocaleInUrl } from "./i18n";
|
||||
|
||||
describe("mapLocale", () => {
|
||||
it("maps Chinese", () => {
|
||||
expect(mapLocale("zh-TW")).toStrictEqual("zh-Hant");
|
||||
expect(mapLocale("zh-CN")).toStrictEqual("zh-Hans");
|
||||
});
|
||||
|
||||
it("maps languages without countries", () => {
|
||||
expect(mapLocale("ro-RO")).toStrictEqual("ro");
|
||||
expect(mapLocale("ro")).toStrictEqual("ro");
|
||||
});
|
||||
});
|
||||
|
||||
describe("swapLocale", () => {
|
||||
it("swap locale in URL", () => {
|
||||
expect(swapLocaleInUrl("/get-started", "ro")).toStrictEqual("/ro/get-started");
|
||||
expect(swapLocaleInUrl("/ro/get-started", "ro")).toStrictEqual("/ro/get-started");
|
||||
expect(swapLocaleInUrl("/en/get-started", "ro")).toStrictEqual("/ro/get-started");
|
||||
expect(swapLocaleInUrl("/ro/", "en")).toStrictEqual("/en/");
|
||||
});
|
||||
});
|
||||
|
||||
describe("extractLocaleFromUrl", () => {
|
||||
it("properly extracts locale", () => {
|
||||
expect(extractLocaleFromUrl("/en/get-started")).toStrictEqual("en");
|
||||
expect(extractLocaleFromUrl("/get-started")).toStrictEqual(undefined);
|
||||
expect(extractLocaleFromUrl("/")).toStrictEqual(undefined);
|
||||
});
|
||||
});
|
||||
@@ -1,19 +1,50 @@
|
||||
import { default as i18next } from "i18next";
|
||||
import HttpApi from 'i18next-http-backend';
|
||||
import { initReactI18next } from "react-i18next";
|
||||
interface Locale {
|
||||
id: string;
|
||||
name: string;
|
||||
rtl?: boolean;
|
||||
}
|
||||
|
||||
i18next
|
||||
.use(HttpApi)
|
||||
.use(initReactI18next);
|
||||
export const LOCALES: Locale[] = [
|
||||
{ id: "en", name: "English" },
|
||||
{ id: "ro", name: "Română" },
|
||||
{ id: "zh-Hans", name: "简体中文" },
|
||||
{ id: "zh-Hant", name: "繁體中文" },
|
||||
{ id: "fr", name: "Français" },
|
||||
{ id: "it", name: "Italiano" },
|
||||
{ id: "ja", name: "日本語" },
|
||||
{ id: "pl", name: "Polski" },
|
||||
{ id: "es", name: "Español" },
|
||||
{ id: "ar", name: "اَلْعَرَبِيَّةُ", rtl: true },
|
||||
].toSorted((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
await i18next.init({
|
||||
debug: true,
|
||||
lng: "en",
|
||||
fallbackLng: "en",
|
||||
backend: {
|
||||
loadPath: "/translations/{{lng}}/{{ns}}.json",
|
||||
},
|
||||
returnEmptyString: false
|
||||
});
|
||||
export function mapLocale(locale: string) {
|
||||
if (!locale) return 'en';
|
||||
const lower = locale.toLowerCase();
|
||||
|
||||
export const t = i18next.t;
|
||||
if (lower.startsWith('zh')) {
|
||||
if (lower.includes('tw') || lower.includes('hk') || lower.includes('mo') || lower.includes('hant')) {
|
||||
return 'zh-Hant';
|
||||
}
|
||||
return 'zh-Hans';
|
||||
}
|
||||
|
||||
// Default for everything else
|
||||
return locale.split('-')[0]; // e.g. "en-US" -> "en"
|
||||
}
|
||||
|
||||
export function swapLocaleInUrl(url: string, newLocale: string) {
|
||||
const components = url.split("/");
|
||||
if (components.length === 2) {
|
||||
return `/${newLocale}${url}`;
|
||||
} else {
|
||||
components[1] = newLocale;
|
||||
return components.join("/");
|
||||
}
|
||||
}
|
||||
|
||||
export function extractLocaleFromUrl(url: string) {
|
||||
const localeId = url.split('/')[1];
|
||||
const correspondingLocale = LOCALES.find(l => l.id === localeId);
|
||||
if (!correspondingLocale) return undefined;
|
||||
return localeId;
|
||||
}
|
||||
|
||||
@@ -2,29 +2,78 @@ import './style.css';
|
||||
import { FALLBACK_STARGAZERS_COUNT, getRepoStargazersCount } from './github-utils.js';
|
||||
import { Header } from './components/Header.jsx';
|
||||
import { Home } from './pages/Home/index.jsx';
|
||||
import { LocationProvider, Router, Route, hydrate, prerender as ssr } from 'preact-iso';
|
||||
import { LocationProvider, Router, Route, hydrate, prerender as ssr, useLocation } from 'preact-iso';
|
||||
import { NotFound } from './pages/_404.jsx';
|
||||
import Footer from './components/Footer.js';
|
||||
import GetStarted from './pages/GetStarted/get-started.js';
|
||||
import SupportUs from './pages/SupportUs/SupportUs.js';
|
||||
import { createContext } from 'preact';
|
||||
import { useLayoutEffect, useState } from 'preact/hooks';
|
||||
import { default as i18next, changeLanguage } from 'i18next';
|
||||
import { extractLocaleFromUrl, LOCALES, mapLocale } from './i18n';
|
||||
import HttpApi from 'i18next-http-backend';
|
||||
import { initReactI18next } from "react-i18next";
|
||||
|
||||
export const LocaleContext = createContext('en');
|
||||
|
||||
export function App(props: {repoStargazersCount: number}) {
|
||||
return (
|
||||
<LocationProvider>
|
||||
<Header repoStargazersCount={props.repoStargazersCount} />
|
||||
<main>
|
||||
<Router>
|
||||
<Route path="/" component={Home} />
|
||||
<Route default component={NotFound} />
|
||||
<Route path="/get-started" component={GetStarted} />
|
||||
<Route path="/support-us" component={SupportUs} />
|
||||
</Router>
|
||||
</main>
|
||||
<Footer />
|
||||
<LocaleProvider>
|
||||
<Header repoStargazersCount={props.repoStargazersCount} />
|
||||
<main>
|
||||
<Router>
|
||||
<Route path="/" component={Home} />
|
||||
<Route path="/get-started" component={GetStarted} />
|
||||
<Route path="/support-us" component={SupportUs} />
|
||||
|
||||
<Route path="/:locale:/" component={Home} />
|
||||
<Route path="/:locale:/get-started" component={GetStarted} />
|
||||
<Route path="/:locale:/support-us" component={SupportUs} />
|
||||
|
||||
<Route default component={NotFound} />
|
||||
</Router>
|
||||
</main>
|
||||
<Footer />
|
||||
</LocaleProvider>
|
||||
</LocationProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export function LocaleProvider({ children }) {
|
||||
const { path } = useLocation();
|
||||
const localeId = mapLocale(extractLocaleFromUrl(path) || navigator.language);
|
||||
const [ loaded, setLoaded ] = useState(false);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
i18next
|
||||
.use(HttpApi)
|
||||
.use(initReactI18next);
|
||||
i18next.init({
|
||||
lng: localeId,
|
||||
fallbackLng: "en",
|
||||
backend: {
|
||||
loadPath: "/translations/{{lng}}/{{ns}}.json",
|
||||
},
|
||||
returnEmptyString: false
|
||||
}).then(() => setLoaded(true))
|
||||
}, []);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (!loaded) return;
|
||||
changeLanguage(localeId);
|
||||
const correspondingLocale = LOCALES.find(l => l.id === localeId);
|
||||
document.documentElement.lang = localeId;
|
||||
document.documentElement.dir = correspondingLocale?.rtl ? "rtl" : "ltr";
|
||||
}, [ loaded, localeId ]);
|
||||
|
||||
return (
|
||||
<LocaleContext.Provider value={localeId}>
|
||||
{loaded && children}
|
||||
</LocaleContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
hydrate(<App repoStargazersCount={FALLBACK_STARGAZERS_COUNT} />, document.getElementById('app')!);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
import { useLayoutEffect, useState } from "preact/hooks";
|
||||
import Card from "../../components/Card.js";
|
||||
import Section from "../../components/Section.js";
|
||||
import { App, Architecture, buildDownloadUrl, downloadMatrix, DownloadMatrixEntry, getArchitecture, getPlatform, Platform } from "../../download-helper.js";
|
||||
import { App, Architecture, buildDownloadUrl, DownloadMatrixEntry, getArchitecture, getDownloadMatrix, getPlatform, Platform } from "../../download-helper.js";
|
||||
import { usePageTitle } from "../../hooks.js";
|
||||
import Button, { Link } from "../../components/Button.js";
|
||||
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";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function DownloadPage() {
|
||||
const { t } = useTranslation();
|
||||
const [ currentArch, setCurrentArch ] = useState<Architecture>("x64");
|
||||
const [ userPlatform, setUserPlatform ] = useState<Platform>();
|
||||
const downloadMatrix = getDownloadMatrix(t);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
getArchitecture().then((arch) => setCurrentArch(arch ?? "x64"));
|
||||
@@ -71,6 +73,7 @@ export function DownloadCard({ app, arch, entry: [ platform, entry ], isRecommen
|
||||
return (typeof text === "string" ? text : text[arch]);
|
||||
}
|
||||
|
||||
const { t } = useTranslation();
|
||||
const allDownloads = Object.entries(entry.downloads);
|
||||
const recommendedDownloads = allDownloads.filter(download => download[1].recommended);
|
||||
const restDownloads = allDownloads.filter(download => !download[1].recommended);
|
||||
@@ -107,7 +110,7 @@ export function DownloadCard({ app, arch, entry: [ platform, entry ], isRecommen
|
||||
{recommendedDownloads.map(recommendedDownload => (
|
||||
<Button
|
||||
className="recommended"
|
||||
href={buildDownloadUrl(app, platform as Platform, recommendedDownload[0], arch)}
|
||||
href={buildDownloadUrl(t, app, platform as Platform, recommendedDownload[0], arch)}
|
||||
text={recommendedDownload[1].name}
|
||||
openExternally={!!recommendedDownload[1].url}
|
||||
/>
|
||||
@@ -117,7 +120,7 @@ export function DownloadCard({ app, arch, entry: [ platform, entry ], isRecommen
|
||||
<div class="other-options">
|
||||
{restDownloads.map(download => (
|
||||
<Link
|
||||
href={buildDownloadUrl(app, platform as Platform, download[0], arch)}
|
||||
href={buildDownloadUrl(t, app, platform as Platform, download[0], arch)}
|
||||
openExternally={!!download[1].url}
|
||||
>
|
||||
{download[1].name}
|
||||
|
||||
@@ -57,6 +57,8 @@ section.hero-section {
|
||||
color: transparent;
|
||||
line-height: 1.1;
|
||||
font-weight: 400;
|
||||
font-size: 2em;
|
||||
margin-block: 0.65em;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ import boardIcon from "../../assets/boxicons/bx-columns-3.svg?raw";
|
||||
import geomapIcon from "../../assets/boxicons/bx-map.svg?raw";
|
||||
import { getPlatform } from '../../download-helper.js';
|
||||
import { useEffect, useState } from 'preact/hooks';
|
||||
import { t } from '../../i18n.js';
|
||||
import { Trans } from 'react-i18next';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
|
||||
export function Home() {
|
||||
usePageTitle("");
|
||||
@@ -52,6 +51,7 @@ export function Home() {
|
||||
}
|
||||
|
||||
function HeroSection() {
|
||||
const { t } = useTranslation();
|
||||
const platform = getPlatform();
|
||||
const colorScheme = useColorScheme();
|
||||
const [ screenshotUrl, setScreenshotUrl ] = useState<string>();
|
||||
@@ -96,6 +96,7 @@ function HeroSection() {
|
||||
}
|
||||
|
||||
function OrganizationBenefitsSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<Section className="benefits" title={t("organization_benefits.title")}>
|
||||
@@ -110,6 +111,7 @@ function OrganizationBenefitsSection() {
|
||||
}
|
||||
|
||||
function ProductivityBenefitsSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<Section className="benefits accented" title={t("productivity_benefits.title")}>
|
||||
@@ -127,8 +129,9 @@ function ProductivityBenefitsSection() {
|
||||
}
|
||||
|
||||
function NoteTypesSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Section className="note-types" title="Multiple ways to represent your information">
|
||||
<Section className="note-types" title={t("note_types.title")}>
|
||||
<ListWithScreenshot horizontal items={[
|
||||
{
|
||||
title: t("note_types.text_title"),
|
||||
@@ -190,6 +193,7 @@ function NoteTypesSection() {
|
||||
}
|
||||
|
||||
function ExtensibilityBenefitsSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<>
|
||||
<Section className="benefits accented" title={t("extensibility_benefits.title")}>
|
||||
@@ -205,8 +209,9 @@ function ExtensibilityBenefitsSection() {
|
||||
}
|
||||
|
||||
function CollectionsSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Section className="collections" title="Collections">
|
||||
<Section className="collections" title={t("collections.title")}>
|
||||
<ListWithScreenshot items={[
|
||||
{
|
||||
title: t("collections.calendar_title"),
|
||||
@@ -247,6 +252,7 @@ function ListWithScreenshot({ items, horizontal, cardExtra }: {
|
||||
cardExtra?: ComponentChildren;
|
||||
}) {
|
||||
const [ selectedItem, setSelectedItem ] = useState(items[0]);
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<div className={`list-with-screenshot ${horizontal ? "horizontal" : ""}`}>
|
||||
@@ -278,6 +284,7 @@ function ListWithScreenshot({ items, horizontal, cardExtra }: {
|
||||
}
|
||||
|
||||
function FaqSection() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Section className="faq" title={t("faq.title")}>
|
||||
<div class="grid-2-cols">
|
||||
@@ -301,6 +308,7 @@ function FaqItem({ question, children }: { question: string; children: Component
|
||||
}
|
||||
|
||||
function FinalCta() {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Section className="final-cta accented" title={t("final_cta.title")}>
|
||||
<p>{t("final_cta.description")}</p>
|
||||
|
||||
@@ -6,10 +6,10 @@ import buyMeACoffeeIcon from "../../assets/boxicons/bx-buy-me-a-coffee.svg?raw";
|
||||
import Button, { Link } from "../../components/Button.js";
|
||||
import Card from "../../components/Card.js";
|
||||
import { usePageTitle } from "../../hooks.js";
|
||||
import { t } from "../../i18n.js";
|
||||
import { Trans } from "react-i18next";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
|
||||
export default function Donate() {
|
||||
const { t } = useTranslation();
|
||||
usePageTitle(t("support_us.title"));
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import Section from "../components/Section.js";
|
||||
import { usePageTitle } from "../hooks.js";
|
||||
import { t } from "../i18n.js";
|
||||
import "./_404.css";
|
||||
|
||||
export function NotFound() {
|
||||
const { t } = useTranslation();
|
||||
usePageTitle(t("404.title"));
|
||||
|
||||
return (
|
||||
|
||||
@@ -31,7 +31,13 @@ html,
|
||||
body {
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
|
||||
font-family: Inter,
|
||||
system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
|
||||
"Noto Sans", "Noto Sans CJK SC",
|
||||
"Hiragino Sans", "Hiragino Kaku Gothic ProN",
|
||||
"Microsoft YaHei", "Meiryo", "Malgun Gothic",
|
||||
"PingFang SC", "Source Han Sans SC",
|
||||
"Source Han Sans JP", "Source Han Sans KR";
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,4 +14,7 @@ export default defineConfig({
|
||||
},
|
||||
}),
|
||||
],
|
||||
test: {
|
||||
environment: "happy-dom"
|
||||
}
|
||||
});
|
||||
|
||||
2
docs/README-de.md
vendored
2
docs/README-de.md
vendored
@@ -58,7 +58,7 @@ Unsere Dokumentation ist verfügbar in mehreren Formaten:
|
||||
- [Erste Schritte](https://docs.triliumnotes.org/)
|
||||
- [Installationsanleitung](./docs/User%20Guide/User%20Guide/Installation%20&%20Setup/Server%20Installation.md)
|
||||
- [Docker
|
||||
Setup](./docs/User%20Guide/User%20Guide/Installation%20&%20Setup/Server%20Installation/1.%20Installing%20the%20server/Using%20Docker.md)
|
||||
Einrichten](./docs/User%20Guide/User%20Guide/Installation%20&%20Setup/Server%20Installation/1.%20Installing%20the%20server/Using%20Docker.md)
|
||||
- [TriliumNext
|
||||
aktualisieren](./docs/User%20Guide/User%20Guide/Installation%20%26%20Setup/Upgrading%20TriliumNext.md)
|
||||
- [Grundkonzepte und
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"desktop:start": "pnpm run --filter desktop dev",
|
||||
"desktop:build": "pnpm run --filter desktop build",
|
||||
"desktop:start-prod": "pnpm run --filter desktop start-prod",
|
||||
"website:start": "pnpm run --filter website dev",
|
||||
"website:build": "pnpm run --filter website build",
|
||||
"electron:build": "pnpm desktop:build",
|
||||
"electron:start": "pnpm desktop:start",
|
||||
|
||||
Reference in New Issue
Block a user