diff --git a/README.md b/README.md index 1556ac9..0ffc16f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,23 @@ # Glide website -The website for Glide, the scrolling window manager for [Mac](https://github.com/QuackByte/glide) and [Windows](https://github.com/QuackByte/glide-windows). Built with Astro 7 (Vite under the hood) and TypeScript, in English and Spanish, and served at **https://quackbyte.dev/glide/**. +The website for Glide, the scrolling window manager for [Mac](https://github.com/QuackByte/glide) and [Windows](https://github.com/QuackByte/glide-windows). Built with Astro 7 (Vite under the hood) and TypeScript, in eight languages, and served at **https://quackbyte.dev/glide/**. -| Page | English | Español | +| Language | Home | Privacy policy | | --- | --- | --- | -| Home, downloads, Mac & Windows table | `/glide/` | `/glide/es/` | -| Privacy policy | `/glide/privacy/` | `/glide/es/privacidad/` | +| English | `/glide/` | `/glide/privacy/` | +| Español | `/glide/es/` | `/glide/es/privacidad/` | +| Français | `/glide/fr/` | `/glide/fr/confidentialite/` | +| Deutsch | `/glide/de/` | `/glide/de/datenschutz/` | +| 日本語 | `/glide/ja/` | `/glide/ja/privacy/` | +| 简体中文 | `/glide/zh/` | `/glide/zh/privacy/` | +| 한국어 | `/glide/ko/` | `/glide/ko/privacy/` | +| Português (Brasil) | `/glide/pt/` | `/glide/pt/privacidade/` | + +## Copy and translations + +All visible copy lives in one file per language, [`src/i18n/.ts`](src/i18n). [`en.ts`](src/i18n/en.ts) defines the shape (its header explains how to translate, how `…Html` strings carry links and ``, and the `{tokens}` such as `{mac}` that stand for URLs and key symbols); every other language is typed against it, so a missing key fails `npm run check`. Components never contain copy. Product names, URLs and key symbols come from [`src/config.ts`](src/config.ts) and `tokens()` in [`src/i18n.ts`](src/i18n.ts). + +To change a sentence, edit it in every language file (or in English and let translators follow). To add a language: add a message file, then the language to `langs`, `languages` and `routes` in `src/i18n.ts`, to `i18n.locales` in `astro.config.mjs`, and a page pair under `src/pages//`. CJK languages also need a font stack in `src/styles/global.css`. ## Downloads @@ -13,9 +25,9 @@ The download buttons link to each app's latest GitHub release. In the browser, t ## Mac and Windows parity -[`src/data/features.ts`](src/data/features.ts) lists what each app does, and the home page renders it as the "Mac & Windows" table. It's the one place that tracks parity between the two apps: +[`src/data/features.ts`](src/data/features.ts) lists what each app does, and the home page renders it as the "Mac & Windows" table. It's the one place that tracks parity between the two apps. It holds feature ids and statuses; the names and notes are in the message files (`features.names` and `features.notes`, keyed by id): -- When a feature ships on one platform, add a row, `planned` on the other if it should follow. +- When a feature ships on one platform, add a row (plus its name in every `src/i18n/*.ts`), `planned` on the other if it should follow. - When it ships on the other, flip it to `yes`. - `partial` needs a note saying what differs; `na` is for things that don't apply to a platform. diff --git a/astro.config.mjs b/astro.config.mjs index 7d9206e..2b4ef92 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -8,7 +8,11 @@ export default defineConfig({ trailingSlash: 'always', i18n: { defaultLocale: 'en', - locales: ['en', 'es'], + locales: [ + 'en', 'es', 'fr', 'de', 'ja', 'ko', + { path: 'zh', codes: ['zh-Hans'] }, + { path: 'pt', codes: ['pt-BR'] }, + ], routing: { prefixDefaultLocale: false }, }, }); diff --git a/src/components/Downloads.astro b/src/components/Downloads.astro index 264c0e8..43bf027 100644 --- a/src/components/Downloads.astro +++ b/src/components/Downloads.astro @@ -1,44 +1,36 @@ --- -import { repos, github, requirements } from '../config'; -import type { Lang } from '../i18n'; +import { repos, github } from '../config'; +import { messages, filler, type Lang } from '../i18n'; interface Props { lang: Lang } const { lang } = Astro.props; -const es = lang === 'es'; +const t = messages[lang].downloads; +const fill = filler(lang); const latest = (repo: string) => github(repo, '/releases/latest'); ---

Windows

-

{requirements.windows[lang]}. {es ? 'Se instala sin permisos de administrador.' : 'Installs without administrator rights.'}

-

- {es - ? 'Aún no está firmado con un certificado de código, así que Windows SmartScreen puede avisar la primera vez: elige Más información › Ejecutar de todas formas.' - : "Not code-signed yet, so Windows SmartScreen may warn the first time: choose More info › Run anyway."} -

+

{t.windowsNote}

+

{t.windowsWarning}

-

- {es - ? 'Las dos se actualizan solas. Cada versión, con sus notas y sumas de verificación, está en GitHub: ' - : 'Both keep themselves up to date. Every release, with its notes and checksums, is on GitHub: '} - Mac, Windows. -

+