From e91f592f22960879eb8922587f1b84ee1e79ceef Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 29 Jun 2026 18:24:49 +0200 Subject: [PATCH] feat(help): embed the TREK wiki as an in-app help centre MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a Help section (profile menu, /help) that renders the GitHub wiki inside TREK. /api/help fetches the wiki markdown — the nav from _Sidebar.md, pages, and proxied images — from GitHub and caches it (1h TTL, serves stale on outage), so it auto-syncs on wiki edits with no redeploy and the client never calls GitHub directly. The page is styled to match TREK with a section sidebar, search and react-markdown; wiki [[links]] are rewritten to in-app routes and HTML-comment placeholders are stripped. Page state lives in a useHelp() hook per the page pattern. Adds nav.help and a help namespace across all locales. --- .gitignore | 4 +- client/src/App.tsx | 17 +++ client/src/api/client.ts | 11 ++ client/src/components/Layout/Navbar.tsx | 10 +- client/src/pages/HelpPage.tsx | 188 ++++++++++++++++++++++++ client/src/pages/help/useHelp.ts | 56 +++++++ server/src/nest/app.module.ts | 3 +- server/src/nest/help/help.controller.ts | 50 +++++++ server/src/nest/help/help.module.ts | 8 + server/src/services/wikiService.ts | 180 +++++++++++++++++++++++ shared/src/i18n/ar/help.ts | 13 ++ shared/src/i18n/ar/index.ts | 2 + shared/src/i18n/ar/nav.ts | 1 + shared/src/i18n/br/help.ts | 13 ++ shared/src/i18n/br/index.ts | 2 + shared/src/i18n/br/nav.ts | 1 + shared/src/i18n/cs/help.ts | 13 ++ shared/src/i18n/cs/index.ts | 2 + shared/src/i18n/cs/nav.ts | 1 + shared/src/i18n/de/help.ts | 13 ++ shared/src/i18n/de/index.ts | 2 + shared/src/i18n/de/nav.ts | 1 + shared/src/i18n/en/help.ts | 13 ++ shared/src/i18n/en/index.ts | 2 + shared/src/i18n/en/nav.ts | 1 + shared/src/i18n/es/help.ts | 13 ++ shared/src/i18n/es/index.ts | 2 + shared/src/i18n/es/nav.ts | 1 + shared/src/i18n/fr/help.ts | 13 ++ shared/src/i18n/fr/index.ts | 2 + shared/src/i18n/fr/nav.ts | 1 + shared/src/i18n/gr/help.ts | 13 ++ shared/src/i18n/gr/index.ts | 2 + shared/src/i18n/gr/nav.ts | 1 + shared/src/i18n/hu/help.ts | 13 ++ shared/src/i18n/hu/index.ts | 2 + shared/src/i18n/hu/nav.ts | 1 + shared/src/i18n/id/help.ts | 13 ++ shared/src/i18n/id/index.ts | 2 + shared/src/i18n/id/nav.ts | 1 + shared/src/i18n/it/help.ts | 13 ++ shared/src/i18n/it/index.ts | 2 + shared/src/i18n/it/nav.ts | 1 + shared/src/i18n/ja/help.ts | 13 ++ shared/src/i18n/ja/index.ts | 2 + shared/src/i18n/ja/nav.ts | 1 + shared/src/i18n/ko/help.ts | 13 ++ shared/src/i18n/ko/index.ts | 2 + shared/src/i18n/ko/nav.ts | 1 + shared/src/i18n/nl/help.ts | 13 ++ shared/src/i18n/nl/index.ts | 2 + shared/src/i18n/nl/nav.ts | 1 + shared/src/i18n/pl/help.ts | 13 ++ shared/src/i18n/pl/index.ts | 2 + shared/src/i18n/pl/nav.ts | 1 + shared/src/i18n/ru/help.ts | 13 ++ shared/src/i18n/ru/index.ts | 2 + shared/src/i18n/ru/nav.ts | 1 + shared/src/i18n/sv/help.ts | 13 ++ shared/src/i18n/sv/index.ts | 2 + shared/src/i18n/sv/nav.ts | 1 + shared/src/i18n/tr/help.ts | 13 ++ shared/src/i18n/tr/index.ts | 2 + shared/src/i18n/tr/nav.ts | 1 + shared/src/i18n/uk/help.ts | 13 ++ shared/src/i18n/uk/index.ts | 2 + shared/src/i18n/uk/nav.ts | 1 + shared/src/i18n/zh-TW/help.ts | 13 ++ shared/src/i18n/zh-TW/index.ts | 2 + shared/src/i18n/zh-TW/nav.ts | 1 + shared/src/i18n/zh/help.ts | 13 ++ shared/src/i18n/zh/index.ts | 2 + shared/src/i18n/zh/nav.ts | 1 + 73 files changed, 860 insertions(+), 3 deletions(-) create mode 100644 client/src/pages/HelpPage.tsx create mode 100644 client/src/pages/help/useHelp.ts create mode 100644 server/src/nest/help/help.controller.ts create mode 100644 server/src/nest/help/help.module.ts create mode 100644 server/src/services/wikiService.ts create mode 100644 shared/src/i18n/ar/help.ts create mode 100644 shared/src/i18n/br/help.ts create mode 100644 shared/src/i18n/cs/help.ts create mode 100644 shared/src/i18n/de/help.ts create mode 100644 shared/src/i18n/en/help.ts create mode 100644 shared/src/i18n/es/help.ts create mode 100644 shared/src/i18n/fr/help.ts create mode 100644 shared/src/i18n/gr/help.ts create mode 100644 shared/src/i18n/hu/help.ts create mode 100644 shared/src/i18n/id/help.ts create mode 100644 shared/src/i18n/it/help.ts create mode 100644 shared/src/i18n/ja/help.ts create mode 100644 shared/src/i18n/ko/help.ts create mode 100644 shared/src/i18n/nl/help.ts create mode 100644 shared/src/i18n/pl/help.ts create mode 100644 shared/src/i18n/ru/help.ts create mode 100644 shared/src/i18n/sv/help.ts create mode 100644 shared/src/i18n/tr/help.ts create mode 100644 shared/src/i18n/uk/help.ts create mode 100644 shared/src/i18n/zh-TW/help.ts create mode 100644 shared/src/i18n/zh/help.ts diff --git a/.gitignore b/.gitignore index b1e4bdf26..fef272b87 100644 --- a/.gitignore +++ b/.gitignore @@ -65,4 +65,6 @@ coverage test-data .run -.full-review \ No newline at end of file +.full-review +# Wiki offline snapshot is baked in at build, not committed (duplicates wiki/) +server/assets/wiki/ diff --git a/client/src/App.tsx b/client/src/App.tsx index a46f111eb..949acd59b 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -13,6 +13,7 @@ import FilesPage from './pages/FilesPage' import AdminPage from './pages/AdminPage' import SettingsPage from './pages/SettingsPage' import VacayPage from './pages/VacayPage' +import HelpPage from './pages/HelpPage' import AtlasPage from './pages/AtlasPage' import JourneyPage from './pages/JourneyPage' import JourneyDetailPage from './pages/JourneyDetailPage' @@ -221,6 +222,22 @@ export default function App() { } /> + + + + } + /> + + + + } + /> r.data), } +export interface HelpNavItem { title: string; slug: string } +export interface HelpNavSection { title: string; pages: HelpNavItem[] } +export interface HelpPageData { slug: string; title: string; markdown: string } + +export const helpApi = { + index: (): Promise<{ sections: HelpNavSection[] }> => + apiClient.get('/help/index').then(r => r.data), + page: (slug: string): Promise => + apiClient.get(`/help/page/${encodeURIComponent(slug)}`).then(r => r.data), +} + export const settingsApi = { get: () => apiClient.get('/settings').then(r => r.data), set: (key: string, value: unknown) => { diff --git a/client/src/components/Layout/Navbar.tsx b/client/src/components/Layout/Navbar.tsx index ba49bd55a..bafaa103e 100644 --- a/client/src/components/Layout/Navbar.tsx +++ b/client/src/components/Layout/Navbar.tsx @@ -5,7 +5,7 @@ import { useAuthStore } from '../../store/authStore' import { useSettingsStore } from '../../store/settingsStore' import { useAddonStore } from '../../store/addonStore' import { useTranslation } from '../../i18n' -import { Plane, LogOut, Settings, ChevronDown, Shield, ArrowLeft, Users, Moon, Sun, Monitor, CalendarDays, Briefcase, Globe, Compass } from 'lucide-react' +import { Plane, LogOut, Settings, ChevronDown, Shield, ArrowLeft, Users, Moon, Sun, Monitor, CalendarDays, Briefcase, Globe, Compass, BookOpen } from 'lucide-react' import type { LucideIcon } from 'lucide-react' import InAppNotificationBell from './InAppNotificationBell.tsx' @@ -252,6 +252,14 @@ export default function Navbar({ tripTitle, tripId, onBack, showBack, onShare }: {t('nav.settings')} + setUserMenuOpen(false)} + className="flex items-center gap-2 px-4 py-2 text-sm transition-colors text-content-secondary" + onMouseEnter={e => e.currentTarget.style.background = 'var(--bg-hover)'} + onMouseLeave={e => e.currentTarget.style.background = 'transparent'}> + + {t('nav.help')} + + {user.role === 'admin' && ( setUserMenuOpen(false)} className="flex items-center gap-2 px-4 py-2 text-sm transition-colors text-content-secondary" diff --git a/client/src/pages/HelpPage.tsx b/client/src/pages/HelpPage.tsx new file mode 100644 index 000000000..83e32a743 --- /dev/null +++ b/client/src/pages/HelpPage.tsx @@ -0,0 +1,188 @@ +import { Link } from 'react-router-dom' +import Markdown from 'react-markdown' +import remarkGfm from 'remark-gfm' +import { Search, ChevronRight, Loader2, AlertCircle, BookOpen, PanelLeft, X } from 'lucide-react' +import PageShell from '../components/Layout/PageShell' +import { useTranslation } from '../i18n' +import { useHelp } from './help/useHelp' + +export default function HelpPage() { + const { t } = useTranslation() + const { page, loading, pageError, query, setQuery, navOpen, setNavOpen, contentRef, activeSlug, filtered } = + useHelp() + + const nav = ( + + ) + + return ( + +
+ {/* Desktop sidebar */} + + + {/* Content */} +
+ {/* Mobile nav toggle */} + + + {loading ? ( +
+ +
+ ) : pageError ? ( +
+ +

{t('help.errorTitle')}

+

{t('help.errorBody')}

+
+ ) : page ? ( +
+ +
+ ) : null} +
+
+ + {/* Mobile sidebar drawer */} + {navOpen && ( +
setNavOpen(false)}> +
+
e.stopPropagation()} + > +
+ + {t('help.title')} + + +
+ {nav} +
+
+ )} + + ) +} + +/** Markdown renderer with TREK-styled elements and SPA-internal links. */ +function WikiContent({ markdown }: { markdown: string }) { + return ( + ( +

{children}

+ ), + h2: ({ children }) => ( +

+ {children} +

+ ), + h3: ({ children }) =>

{children}

, + h4: ({ children }) =>

{children}

, + p: ({ children }) =>

{children}

, + ul: ({ children }) =>
    {children}
, + ol: ({ children }) =>
    {children}
, + li: ({ children }) =>
  • {children}
  • , + a: ({ href, children }) => { + const url = href ?? '' + if (url.startsWith('#')) return {children} + if (url.startsWith('/')) return {children} + return ( + + {children} + + ) + }, + img: ({ src, alt }) => ( + {alt} + ), + code: ({ className, children }) => { + const isBlock = (className ?? '').includes('language-') + if (isBlock) return {children} + return {children} + }, + pre: ({ children }) => ( +
    +            {children}
    +          
    + ), + blockquote: ({ children }) => ( +
    + {children} +
    + ), + table: ({ children }) => ( +
    + {children}
    +
    + ), + th: ({ children }) => ( + + {children} + + ), + td: ({ children }) => {children}, + hr: () =>
    , + }} + > + {markdown} +
    + ) +} diff --git a/client/src/pages/help/useHelp.ts b/client/src/pages/help/useHelp.ts new file mode 100644 index 000000000..0d3f6329f --- /dev/null +++ b/client/src/pages/help/useHelp.ts @@ -0,0 +1,56 @@ +import { useEffect, useMemo, useRef, useState } from 'react' +import { useParams } from 'react-router-dom' +import { helpApi, type HelpNavSection, type HelpPageData } from '../../api/client' + +/** State + data loading for the in-app help wiki (see PATTERN.md). */ +export function useHelp() { + const { slug } = useParams<{ slug: string }>() + const [sections, setSections] = useState([]) + const [page, setPage] = useState(null) + const [loading, setLoading] = useState(true) + const [pageError, setPageError] = useState(false) + const [query, setQuery] = useState('') + const [navOpen, setNavOpen] = useState(false) + const contentRef = useRef(null) + + useEffect(() => { + helpApi.index().then((d) => setSections(d.sections)).catch(() => setSections([])) + }, []) + + const homeSlug = sections[0]?.pages[0]?.slug ?? 'Home' + const activeSlug = slug ?? homeSlug + + useEffect(() => { + let alive = true + setLoading(true) + setPageError(false) + helpApi + .page(activeSlug) + .then((p) => { + if (!alive) return + setPage(p) + setLoading(false) + }) + .catch(() => { + if (!alive) return + setPageError(true) + setLoading(false) + }) + contentRef.current?.scrollTo?.({ top: 0 }) + window.scrollTo?.({ top: 0 }) + setNavOpen(false) + return () => { + alive = false + } + }, [activeSlug]) + + const filtered = useMemo(() => { + const q = query.trim().toLowerCase() + if (!q) return sections + return sections + .map((s) => ({ ...s, pages: s.pages.filter((p) => p.title.toLowerCase().includes(q)) })) + .filter((s) => s.pages.length > 0) + }, [sections, query]) + + return { page, loading, pageError, query, setQuery, navOpen, setNavOpen, contentRef, activeSlug, filtered } +} diff --git a/server/src/nest/app.module.ts b/server/src/nest/app.module.ts index 4c1f75019..284322ce5 100644 --- a/server/src/nest/app.module.ts +++ b/server/src/nest/app.module.ts @@ -4,6 +4,7 @@ import { DatabaseModule } from './database/database.module'; import { HealthController } from './health/health.controller'; import { HealthService } from './health/health.service'; import { WeatherModule } from './weather/weather.module'; +import { HelpModule } from './help/help.module'; import { AirportsModule } from './airports/airports.module'; import { ConfigModule } from './config/config.module'; import { SystemNoticesModule } from './system-notices/system-notices.module'; @@ -46,7 +47,7 @@ import { IdempotencyInterceptor } from './common/idempotency.interceptor'; * migrated. */ @Module({ - imports: [DatabaseModule, WeatherModule, AirportsModule, ConfigModule, SystemNoticesModule, MapsModule, CategoriesModule, TagsModule, NotificationsModule, AtlasModule, VacayModule, PackingModule, TodoModule, BudgetModule, ReservationsModule, DaysModule, AssignmentsModule, PlacesModule, TripsModule, CollabModule, FilesModule, PhotosModule, MemoriesModule, AirtrailModule, JourneyModule, ShareModule, SettingsModule, BackupModule, AuthModule, OidcModule, OauthModule, AdminModule, AddonsModule, BookingImportModule], + imports: [DatabaseModule, WeatherModule, HelpModule, AirportsModule, ConfigModule, SystemNoticesModule, MapsModule, CategoriesModule, TagsModule, NotificationsModule, AtlasModule, VacayModule, PackingModule, TodoModule, BudgetModule, ReservationsModule, DaysModule, AssignmentsModule, PlacesModule, TripsModule, CollabModule, FilesModule, PhotosModule, MemoriesModule, AirtrailModule, JourneyModule, ShareModule, SettingsModule, BackupModule, AuthModule, OidcModule, OauthModule, AdminModule, AddonsModule, BookingImportModule], controllers: [HealthController], providers: [ HealthService, diff --git a/server/src/nest/help/help.controller.ts b/server/src/nest/help/help.controller.ts new file mode 100644 index 000000000..0ea16f94e --- /dev/null +++ b/server/src/nest/help/help.controller.ts @@ -0,0 +1,50 @@ +import { Controller, Get, Param, Req, Res } from '@nestjs/common'; +import type { Request, Response } from 'express'; +import { + getWikiIndex, + getWikiPage, + getWikiAsset, + WikiNotFound, + type WikiPage, + type WikiNavSection, +} from '../../services/wikiService'; + +/** + * /api/help — embedded TREK wiki. Content is public docs (the wiki is public on + * GitHub), so these endpoints are unauthenticated; that also lets tags load + * the proxied assets without sending credentials. All upstream calls go to the + * fixed TREK wiki path and are cached server-side. + */ +@Controller('api/help') +export class HelpController { + @Get('index') + index(): Promise<{ sections: WikiNavSection[] }> { + return getWikiIndex(); + } + + @Get('page/:slug') + async page(@Param('slug') slug: string, @Res() res: Response): Promise { + try { + const page: WikiPage = await getWikiPage(slug); + res.json(page); + } catch (err) { + res.status(err instanceof WikiNotFound ? 404 : 502).json({ error: 'Help page unavailable' }); + } + } + + @Get('asset/*') + async asset(@Req() req: Request, @Res() res: Response): Promise { + // Take everything after `/asset/` straight from the URL — the Express + // wildcard param isn't reliably populated through the Nest adapter. + const after = (req.originalUrl || req.url).split('/asset/')[1] ?? ''; + const assetPath = decodeURIComponent(after.split('?')[0]); + try { + const { buf, type } = await getWikiAsset(assetPath); + res.setHeader('Content-Type', type); + res.setHeader('Cache-Control', 'public, max-age=3600'); + res.end(buf); + } catch { + res.status(404).end(); + } + } +} diff --git a/server/src/nest/help/help.module.ts b/server/src/nest/help/help.module.ts new file mode 100644 index 000000000..13910eb07 --- /dev/null +++ b/server/src/nest/help/help.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; +import { HelpController } from './help.controller'; + +/** /api/help — embedded GitHub wiki (fetched + cached in wikiService). */ +@Module({ + controllers: [HelpController], +}) +export class HelpModule {} diff --git a/server/src/services/wikiService.ts b/server/src/services/wikiService.ts new file mode 100644 index 000000000..501633100 --- /dev/null +++ b/server/src/services/wikiService.ts @@ -0,0 +1,180 @@ +import path from 'path'; +import { promises as fs } from 'fs'; + +/** + * In-app Help/Wiki content, sourced from the TREK GitHub wiki (kept in the repo + * under `wiki/**` and mirrored to the GitHub wiki on push to main). The server + * fetches the markdown from GitHub and caches it, so the embedded help stays in + * sync with wiki edits without a redeploy — and the client never talks to GitHub + * directly (images are proxied too). A bundled snapshot under server/assets/wiki + * is the cold-start / offline fallback. + */ + +const REPO = 'mauriceboe/TREK'; +const RAW_BASE = `https://raw.githubusercontent.com/${REPO}/main/wiki`; +const TTL_MS = 60 * 60 * 1000; // refresh from GitHub at most hourly +const SNAPSHOT_DIR = path.join(__dirname, '..', '..', 'assets', 'wiki'); +const SLUG_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/; + +export class WikiNotFound extends Error { + status = 404; +} + +interface TextEntry { + data: string; + ts: number; +} +const textCache = new Map(); +const assetCache = new Map(); + +const fresh = (ts: number): boolean => Date.now() - ts < TTL_MS; + +async function readSnapshot(file: string): Promise { + try { + return await fs.readFile(path.join(SNAPSHOT_DIR, file), 'utf8'); + } catch { + return null; + } +} + +/** Fetch a wiki text file with cache → stale-cache → bundled-snapshot fallback. */ +async function fetchText(file: string): Promise { + const cached = textCache.get(file); + if (cached && fresh(cached.ts)) return cached.data; + try { + const res = await fetch(`${RAW_BASE}/${encodeURIComponent(file)}`, { + headers: { 'User-Agent': 'TREK-help', Accept: 'text/plain' }, + }); + if (res.ok) { + const text = await res.text(); + textCache.set(file, { data: text, ts: Date.now() }); + return text; + } + if (res.status === 404) throw new WikiNotFound(file); + } catch (err) { + if (err instanceof WikiNotFound) throw err; + // network/parse error — fall through to stale cache or snapshot + } + if (cached) return cached.data; // serve stale rather than fail + const snap = await readSnapshot(file); + if (snap != null) { + textCache.set(file, { data: snap, ts: Date.now() }); + return snap; + } + throw new WikiNotFound(file); +} + +export interface WikiNavItem { + title: string; + slug: string; +} +export interface WikiNavSection { + title: string; + pages: WikiNavItem[]; +} + +/** Parse the wiki `_Sidebar.md` into ordered sections of `[[Title|Slug]]` links. */ +function parseSidebar(md: string): WikiNavSection[] { + const sections: WikiNavSection[] = []; + let current: WikiNavSection | null = null; + for (const raw of md.split('\n')) { + const heading = raw.match(/^#{1,4}\s+(.+?)\s*$/); + if (heading) { + current = { title: heading[1].replace(/[*_`]/g, '').trim(), pages: [] }; + sections.push(current); + continue; + } + const link = raw.match(/^\s*[-*]\s*\[\[([^\]]+)\]\]/); + if (link) { + if (!current) { + current = { title: '', pages: [] }; + sections.push(current); + } + const inner = link[1]; + const [title, slugRaw] = inner.includes('|') ? inner.split('|') : [inner, inner]; + const slug = slugRaw.trim().replace(/\s+/g, '-'); + if (SLUG_RE.test(slug)) current.pages.push({ title: title.trim(), slug }); + } + } + return sections.filter((s) => s.pages.length > 0); +} + +/** Rewrite GitHub-wiki `[[..]]` links to /help routes and proxy relative images. */ +function processMarkdown(md: string): string { + // Strip HTML comments (e.g. `` placeholders) — the + // markdown renderer would otherwise surface them as raw text. + let out = md.replace(//g, ''); + out = out.replace(/\[\[([^\]]+)\]\]/g, (_m, inner: string) => { + const [title, slugRaw] = inner.includes('|') ? inner.split('|') : [inner, inner]; + const slug = slugRaw.trim().replace(/\s+/g, '-'); + return `[${title.trim()}](/help/${slug})`; + }); + out = out.replace(/!\[([^\]]*)\]\(([^)\s]+)([^)]*)\)/g, (m, alt: string, url: string) => { + if (/^https?:\/\//i.test(url) || url.startsWith('/api/help/asset/')) return m; + const clean = url.replace(/^\.?\//, '').replace(/^wiki\//, ''); + return `![${alt}](/api/help/asset/${clean})`; + }); + return out; +} + +function extractTitle(md: string, fallback: string): string { + const h1 = md.match(/^#\s+(.+?)\s*$/m); + return h1 ? h1[1].replace(/[*_`]/g, '').trim() : fallback.replace(/-/g, ' '); +} + +export interface WikiPage { + slug: string; + title: string; + markdown: string; +} + +export async function getWikiIndex(): Promise<{ sections: WikiNavSection[] }> { + const md = await fetchText('_Sidebar.md'); + return { sections: parseSidebar(md) }; +} + +export async function getWikiPage(slug: string): Promise { + if (!SLUG_RE.test(slug)) throw new WikiNotFound(slug); + const md = await fetchText(`${slug}.md`); + return { slug, title: extractTitle(md, slug), markdown: processMarkdown(md) }; +} + +const ASSET_TYPES: Record = { + '.png': 'image/png', + '.jpg': 'image/jpeg', + '.jpeg': 'image/jpeg', + '.gif': 'image/gif', + '.webp': 'image/webp', + '.svg': 'image/svg+xml', +}; + +/** Proxy a wiki image so the browser never calls GitHub directly. */ +export async function getWikiAsset(assetPath: string): Promise<{ buf: Buffer; type: string }> { + // Defend against traversal; allow nested image folders. + if (assetPath.includes('..') || !/^[A-Za-z0-9/._-]+$/.test(assetPath)) throw new WikiNotFound(assetPath); + const ext = path.extname(assetPath).toLowerCase(); + const type = ASSET_TYPES[ext]; + if (!type) throw new WikiNotFound(assetPath); + + const cached = assetCache.get(assetPath); + if (cached && fresh(cached.ts)) return { buf: cached.buf, type: cached.type }; + try { + const res = await fetch(`${RAW_BASE}/${assetPath.split('/').map(encodeURIComponent).join('/')}`, { + headers: { 'User-Agent': 'TREK-help' }, + }); + if (res.ok) { + const buf = Buffer.from(await res.arrayBuffer()); + assetCache.set(assetPath, { buf, type, ts: Date.now() }); + return { buf, type }; + } + } catch { + /* fall through */ + } + if (cached) return { buf: cached.buf, type: cached.type }; + try { + const buf = await fs.readFile(path.join(SNAPSHOT_DIR, assetPath)); + return { buf, type }; + } catch { + throw new WikiNotFound(assetPath); + } +} diff --git a/shared/src/i18n/ar/help.ts b/shared/src/i18n/ar/help.ts new file mode 100644 index 000000000..d3d420d0f --- /dev/null +++ b/shared/src/i18n/ar/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'ar' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/ar/index.ts b/shared/src/i18n/ar/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/ar/index.ts +++ b/shared/src/i18n/ar/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/ar/nav.ts b/shared/src/i18n/ar/nav.ts index c3da58755..52a2638bd 100644 --- a/shared/src/i18n/ar/nav.ts +++ b/shared/src/i18n/ar/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'إعدادات المسؤول', 'nav.bottomLogout': 'تسجيل الخروج', 'nav.bottomAdminBadge': 'مسؤول', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/br/help.ts b/shared/src/i18n/br/help.ts new file mode 100644 index 000000000..fd3ccd2f4 --- /dev/null +++ b/shared/src/i18n/br/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'br' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/br/index.ts b/shared/src/i18n/br/index.ts index 43c637d68..531b85712 100644 --- a/shared/src/i18n/br/index.ts +++ b/shared/src/i18n/br/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/br/nav.ts b/shared/src/i18n/br/nav.ts index 43276d98e..c5720928c 100644 --- a/shared/src/i18n/br/nav.ts +++ b/shared/src/i18n/br/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Administração', 'nav.bottomLogout': 'Sair', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/cs/help.ts b/shared/src/i18n/cs/help.ts new file mode 100644 index 000000000..26bb0a774 --- /dev/null +++ b/shared/src/i18n/cs/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'cs' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/cs/index.ts b/shared/src/i18n/cs/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/cs/index.ts +++ b/shared/src/i18n/cs/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/cs/nav.ts b/shared/src/i18n/cs/nav.ts index a3b404a78..8bc5d410f 100644 --- a/shared/src/i18n/cs/nav.ts +++ b/shared/src/i18n/cs/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Nastavení správce', 'nav.bottomLogout': 'Odhlásit se', 'nav.bottomAdminBadge': 'Správce', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/de/help.ts b/shared/src/i18n/de/help.ts new file mode 100644 index 000000000..12af967ca --- /dev/null +++ b/shared/src/i18n/de/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +const help: TranslationStrings = { + 'help.title': 'Hilfe & Doku', + 'help.search': 'Doku durchsuchen…', + 'help.contents': 'Inhalt', + 'help.noResults': 'Keine passenden Seiten.', + 'help.errorTitle': 'Seite konnte nicht geladen werden', + 'help.errorBody': + 'Die Hilfe-Inhalte kommen aus dem TREK-Wiki. Prüfe deine Verbindung und versuch es erneut.', +}; + +export default help; diff --git a/shared/src/i18n/de/index.ts b/shared/src/i18n/de/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/de/index.ts +++ b/shared/src/i18n/de/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/de/nav.ts b/shared/src/i18n/de/nav.ts index c94f9e91b..fcd56ac74 100644 --- a/shared/src/i18n/de/nav.ts +++ b/shared/src/i18n/de/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Admin-Einstellungen', 'nav.bottomLogout': 'Abmelden', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Hilfe', }; export default nav; diff --git a/shared/src/i18n/en/help.ts b/shared/src/i18n/en/help.ts new file mode 100644 index 000000000..06521ae51 --- /dev/null +++ b/shared/src/i18n/en/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +const help: TranslationStrings = { + 'help.title': 'Help & Docs', + 'help.search': 'Search docs…', + 'help.contents': 'Contents', + 'help.noResults': 'No matching pages.', + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': + 'The help content is fetched from the TREK wiki. Check your connection and try again.', +}; + +export default help; diff --git a/shared/src/i18n/en/index.ts b/shared/src/i18n/en/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/en/index.ts +++ b/shared/src/i18n/en/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/en/nav.ts b/shared/src/i18n/en/nav.ts index e57e970e3..1c747759a 100644 --- a/shared/src/i18n/en/nav.ts +++ b/shared/src/i18n/en/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Admin Settings', 'nav.bottomLogout': 'Logout', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/es/help.ts b/shared/src/i18n/es/help.ts new file mode 100644 index 000000000..9b6e9316f --- /dev/null +++ b/shared/src/i18n/es/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'es' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/es/index.ts b/shared/src/i18n/es/index.ts index 829620a80..d5ab81176 100644 --- a/shared/src/i18n/es/index.ts +++ b/shared/src/i18n/es/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/es/nav.ts b/shared/src/i18n/es/nav.ts index a6585e595..dc934b83a 100644 --- a/shared/src/i18n/es/nav.ts +++ b/shared/src/i18n/es/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Administración', 'nav.bottomLogout': 'Cerrar sesión', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/fr/help.ts b/shared/src/i18n/fr/help.ts new file mode 100644 index 000000000..5097d1d55 --- /dev/null +++ b/shared/src/i18n/fr/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'fr' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/fr/index.ts b/shared/src/i18n/fr/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/fr/index.ts +++ b/shared/src/i18n/fr/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/fr/nav.ts b/shared/src/i18n/fr/nav.ts index f41a37b43..ac680d5a5 100644 --- a/shared/src/i18n/fr/nav.ts +++ b/shared/src/i18n/fr/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Administration', 'nav.bottomLogout': 'Déconnexion', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/gr/help.ts b/shared/src/i18n/gr/help.ts new file mode 100644 index 000000000..caf2778ce --- /dev/null +++ b/shared/src/i18n/gr/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'gr' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/gr/index.ts b/shared/src/i18n/gr/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/gr/index.ts +++ b/shared/src/i18n/gr/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/gr/nav.ts b/shared/src/i18n/gr/nav.ts index 03eff0743..4b00a56c1 100644 --- a/shared/src/i18n/gr/nav.ts +++ b/shared/src/i18n/gr/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Ρυθμίσεις Διαχειριστή', 'nav.bottomLogout': 'Αποσύνδεση', 'nav.bottomAdminBadge': 'Διαχειριστής', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/hu/help.ts b/shared/src/i18n/hu/help.ts new file mode 100644 index 000000000..b9f2e9745 --- /dev/null +++ b/shared/src/i18n/hu/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'hu' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/hu/index.ts b/shared/src/i18n/hu/index.ts index 43c637d68..531b85712 100644 --- a/shared/src/i18n/hu/index.ts +++ b/shared/src/i18n/hu/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/hu/nav.ts b/shared/src/i18n/hu/nav.ts index 9cc7cc78a..98126039b 100644 --- a/shared/src/i18n/hu/nav.ts +++ b/shared/src/i18n/hu/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Adminisztráció', 'nav.bottomLogout': 'Kijelentkezés', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/id/help.ts b/shared/src/i18n/id/help.ts new file mode 100644 index 000000000..b1884b712 --- /dev/null +++ b/shared/src/i18n/id/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'id' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/id/index.ts b/shared/src/i18n/id/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/id/index.ts +++ b/shared/src/i18n/id/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/id/nav.ts b/shared/src/i18n/id/nav.ts index 723fa26c5..7dfee707b 100644 --- a/shared/src/i18n/id/nav.ts +++ b/shared/src/i18n/id/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Pengaturan Admin', 'nav.bottomLogout': 'Keluar', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/it/help.ts b/shared/src/i18n/it/help.ts new file mode 100644 index 000000000..fd9df01c8 --- /dev/null +++ b/shared/src/i18n/it/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'it' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/it/index.ts b/shared/src/i18n/it/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/it/index.ts +++ b/shared/src/i18n/it/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/it/nav.ts b/shared/src/i18n/it/nav.ts index 0d4b09c02..0a0bffb9f 100644 --- a/shared/src/i18n/it/nav.ts +++ b/shared/src/i18n/it/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Amministrazione', 'nav.bottomLogout': 'Disconnetti', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/ja/help.ts b/shared/src/i18n/ja/help.ts new file mode 100644 index 000000000..9f282d544 --- /dev/null +++ b/shared/src/i18n/ja/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'ja' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/ja/index.ts b/shared/src/i18n/ja/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/ja/index.ts +++ b/shared/src/i18n/ja/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/ja/nav.ts b/shared/src/i18n/ja/nav.ts index 67ee82b99..0af5013eb 100644 --- a/shared/src/i18n/ja/nav.ts +++ b/shared/src/i18n/ja/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': '管理者設定', 'nav.bottomLogout': 'ログアウト', 'nav.bottomAdminBadge': '管理者', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/ko/help.ts b/shared/src/i18n/ko/help.ts new file mode 100644 index 000000000..719ee080e --- /dev/null +++ b/shared/src/i18n/ko/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'ko' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/ko/index.ts b/shared/src/i18n/ko/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/ko/index.ts +++ b/shared/src/i18n/ko/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/ko/nav.ts b/shared/src/i18n/ko/nav.ts index 44cb2b110..4d46ee7e6 100644 --- a/shared/src/i18n/ko/nav.ts +++ b/shared/src/i18n/ko/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': '관리자 설정', 'nav.bottomLogout': '로그아웃', 'nav.bottomAdminBadge': '관리자', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/nl/help.ts b/shared/src/i18n/nl/help.ts new file mode 100644 index 000000000..6530c20e9 --- /dev/null +++ b/shared/src/i18n/nl/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'nl' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/nl/index.ts b/shared/src/i18n/nl/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/nl/index.ts +++ b/shared/src/i18n/nl/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/nl/nav.ts b/shared/src/i18n/nl/nav.ts index 3c88eb7da..acae56425 100644 --- a/shared/src/i18n/nl/nav.ts +++ b/shared/src/i18n/nl/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Beheerdersinstellingen', 'nav.bottomLogout': 'Uitloggen', 'nav.bottomAdminBadge': 'Beheerder', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/pl/help.ts b/shared/src/i18n/pl/help.ts new file mode 100644 index 000000000..ff34ae73a --- /dev/null +++ b/shared/src/i18n/pl/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'pl' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/pl/index.ts b/shared/src/i18n/pl/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/pl/index.ts +++ b/shared/src/i18n/pl/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/pl/nav.ts b/shared/src/i18n/pl/nav.ts index 9f6e46166..0fbd7e286 100644 --- a/shared/src/i18n/pl/nav.ts +++ b/shared/src/i18n/pl/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Ustawienia administratora', 'nav.bottomLogout': 'Wyloguj się', 'nav.bottomAdminBadge': 'Administrator', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/ru/help.ts b/shared/src/i18n/ru/help.ts new file mode 100644 index 000000000..b287783ed --- /dev/null +++ b/shared/src/i18n/ru/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'ru' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/ru/index.ts b/shared/src/i18n/ru/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/ru/index.ts +++ b/shared/src/i18n/ru/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/ru/nav.ts b/shared/src/i18n/ru/nav.ts index c5f9a4624..4169d8f2c 100644 --- a/shared/src/i18n/ru/nav.ts +++ b/shared/src/i18n/ru/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Администрирование', 'nav.bottomLogout': 'Выйти', 'nav.bottomAdminBadge': 'Админ', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/sv/help.ts b/shared/src/i18n/sv/help.ts new file mode 100644 index 000000000..960189cec --- /dev/null +++ b/shared/src/i18n/sv/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'sv' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/sv/index.ts b/shared/src/i18n/sv/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/sv/index.ts +++ b/shared/src/i18n/sv/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/sv/nav.ts b/shared/src/i18n/sv/nav.ts index 3deb452f9..996a40be8 100644 --- a/shared/src/i18n/sv/nav.ts +++ b/shared/src/i18n/sv/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Admin Inställningar', 'nav.bottomLogout': 'Logga ut', 'nav.bottomAdminBadge': 'Admin', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/tr/help.ts b/shared/src/i18n/tr/help.ts new file mode 100644 index 000000000..9306be171 --- /dev/null +++ b/shared/src/i18n/tr/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'tr' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/tr/index.ts b/shared/src/i18n/tr/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/tr/index.ts +++ b/shared/src/i18n/tr/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/tr/nav.ts b/shared/src/i18n/tr/nav.ts index 3e16c37d7..1c45a78e6 100644 --- a/shared/src/i18n/tr/nav.ts +++ b/shared/src/i18n/tr/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Yönetici Ayarları', 'nav.bottomLogout': 'Çıkış', 'nav.bottomAdminBadge': 'Yönetici', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/uk/help.ts b/shared/src/i18n/uk/help.ts new file mode 100644 index 000000000..e29af24c4 --- /dev/null +++ b/shared/src/i18n/uk/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'uk' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/uk/index.ts b/shared/src/i18n/uk/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/uk/index.ts +++ b/shared/src/i18n/uk/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/uk/nav.ts b/shared/src/i18n/uk/nav.ts index 90ddf147b..bc43eac81 100644 --- a/shared/src/i18n/uk/nav.ts +++ b/shared/src/i18n/uk/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': 'Адміністрування', 'nav.bottomLogout': 'Вийти', 'nav.bottomAdminBadge': 'Адмін', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/zh-TW/help.ts b/shared/src/i18n/zh-TW/help.ts new file mode 100644 index 000000000..52ecfc306 --- /dev/null +++ b/shared/src/i18n/zh-TW/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'zh-TW' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/zh-TW/index.ts b/shared/src/i18n/zh-TW/index.ts index b67d1baa3..295db70cd 100644 --- a/shared/src/i18n/zh-TW/index.ts +++ b/shared/src/i18n/zh-TW/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/zh-TW/nav.ts b/shared/src/i18n/zh-TW/nav.ts index 35f4ec90a..615c65447 100644 --- a/shared/src/i18n/zh-TW/nav.ts +++ b/shared/src/i18n/zh-TW/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': '管理設定', 'nav.bottomLogout': '退出登入', 'nav.bottomAdminBadge': '管理員', + 'nav.help': 'Help', }; export default nav; diff --git a/shared/src/i18n/zh/help.ts b/shared/src/i18n/zh/help.ts new file mode 100644 index 000000000..91d85397e --- /dev/null +++ b/shared/src/i18n/zh/help.ts @@ -0,0 +1,13 @@ +import type { TranslationStrings } from '../types'; + +// English fallback until 'zh' is translated. +const help: TranslationStrings = { + 'help.title': "Help & Docs", + 'help.search': "Search docs…", + 'help.contents': "Contents", + 'help.noResults': "No matching pages.", + 'help.errorTitle': "Couldn't load this page", + 'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.", +}; + +export default help; diff --git a/shared/src/i18n/zh/index.ts b/shared/src/i18n/zh/index.ts index 77aeb6a09..bfa9b73c4 100644 --- a/shared/src/i18n/zh/index.ts +++ b/shared/src/i18n/zh/index.ts @@ -39,6 +39,7 @@ import trip from './trip'; import trips from './trips'; import undo from './undo'; import vacay from './vacay'; +import help from './help'; const locale = { ...common, @@ -82,5 +83,6 @@ const locale = { ...oauth, ...system_notice, ...transport, + ...help, }; export default locale; diff --git a/shared/src/i18n/zh/nav.ts b/shared/src/i18n/zh/nav.ts index d632bde6e..7e2f86323 100644 --- a/shared/src/i18n/zh/nav.ts +++ b/shared/src/i18n/zh/nav.ts @@ -16,5 +16,6 @@ const nav: TranslationStrings = { 'nav.bottomAdmin': '管理设置', 'nav.bottomLogout': '退出登录', 'nav.bottomAdminBadge': '管理员', + 'nav.help': 'Help', }; export default nav;