Files
scrabble-game/renderer/src/legal.mjs
T
Ilia Denisov de5ab9186c
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 21s
CI / ui (pull_request) Successful in 1m14s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m48s
feat(legal): bilingual (RU + EN) legal pages with a language + theme switcher
Add English versions of the privacy policy, EULA and offer (ui/legal/*_en.md) and render each legal page as one self-contained bilingual document: both language bodies plus a header language toggle and theme toggle (no back), a small inline ES5 script that switches language client-side (no reload, default Russian + persisted) and applies the theme (system default + persisted override) — mirroring the landing. The offer's English view transliterates the Russian product names spliced from the live catalog.

renderLegalHtml now takes both language sources; renderOffer splices the price list into both; the renderer bakes and reads the _en sources and pre-renders the static pages at boot. Also wrap the /offer/ contour probe in the same retry+timeout as the legal probe (the offer page is now bilingual and larger). Docs + renderer/ui tests updated.
2026-07-13 13:22:56 +02:00

25 lines
1.3 KiB
JavaScript

// The public legal pages (GET /privacy/, GET /eula/): the owner-edited RU + EN markdown under
// ui/legal/, rendered by the SAME shared renderLegalHtml the offer uses (bundled from ui/src/lib/offer)
// into one bilingual page with a language + theme switcher. Unlike the offer, these carry no dynamic
// data — no backend fetch, no marker splice. Kept out of server.mjs so the per-page title/canonical
// presets are unit-testable without HTTP (test/legal.test.mjs).
import { renderLegalHtml } from '../dist/gameimage.mjs';
// renderPrivacy renders the privacy-policy markdown (RU + EN) as the standalone /privacy/ page.
export function renderPrivacy(ruMd, enMd) {
return renderLegalHtml({
ru: { md: ruMd, title: 'Политика конфиденциальности — Эрудит' },
en: { md: enMd, title: 'Privacy Policy — Erudit' },
canonical: 'https://erudit-game.ru/privacy/',
});
}
// renderEula renders the end-user licence agreement markdown (RU + EN) as the standalone /eula/ page.
export function renderEula(ruMd, enMd) {
return renderLegalHtml({
ru: { md: ruMd, title: 'Пользовательское соглашение — Эрудит' },
en: { md: enMd, title: 'Terms of Use — Erudit' },
canonical: 'https://erudit-game.ru/eula/',
});
}