From 0d4d19658ca8fe3d9c1c2ab77b0ade6ba0840d9c Mon Sep 17 00:00:00 2001 From: vjrj Date: Wed, 15 Jul 2026 19:42:54 +0200 Subject: [PATCH] i18n(site): convert Hugo i18n TOML->go-i18n JSON for Weblate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Weblate has no native Hugo-TOML format. The strings are already the go-i18n structure ([key]/other=), so convert site/i18n/{en,es}.toml -> {en,es}.json ({"key":{"other":"..."}}) — Hugo 0.140 reads it identically (verified with the pinned hugomods/hugo:exts-0.140.2 image). Enables a 'site' Weblate component. Update TRANSLATIONS.md: site is now a component (go-i18n-json), not deferred. --- TRANSLATIONS.md | 28 +++++++--- site/i18n/en.json | 140 ++++++++++++++++++++++++++++++++++++++++++++++ site/i18n/en.toml | 113 ------------------------------------- site/i18n/es.json | 140 ++++++++++++++++++++++++++++++++++++++++++++++ site/i18n/es.toml | 113 ------------------------------------- 5 files changed, 300 insertions(+), 234 deletions(-) create mode 100644 site/i18n/en.json delete mode 100644 site/i18n/en.toml create mode 100644 site/i18n/es.json delete mode 100644 site/i18n/es.toml diff --git a/TRANSLATIONS.md b/TRANSLATIONS.md index ca888f9..1cc90c1 100644 --- a/TRANSLATIONS.md +++ b/TRANSLATIONS.md @@ -13,7 +13,7 @@ The links to the repo and to Weblate are shown both on the landing site | Surface | Files | Format | Base locale | Locales today | |---|---|---|---|---| | **App** (`app` component) | `apps/app_seeds/lib/i18n/*.i18n.json` | JSON **nested** (slang, `{param}` placeholders) | `en` | en, es, pt, fr, de, ast, ja | -| **Site** (deferred) | `site/i18n/*.toml` | Hugo TOML | `en` | en, es | +| **Site** (`site` component) | `site/i18n/*.json` | **go-i18n JSON** (`{"key":{"other":"…"}}`) | `en` | en, es | Only source strings live in git; app strings use `slang`, so `strings.g.dart` / `strings_*.g.dart` are **generated** (see the slang caveat below). @@ -76,12 +76,24 @@ git add -A && git commit -m "chore(i18n): regenerate slang after Weblate sync" regenerate. `fallback_strategy: base_locale` means locales missing a key show the English text until translators fill it in.) -## Site component — deferred +## The `site` component (landing page) -Weblate 5.x has no native Hugo-TOML format, and the site has only EN/ES (~3 KB). -Two options, decide later: -- (a) Switch Hugo i18n to a Weblate-supported format (Hugo also reads - `i18n/*.json` / `*.yaml`), then add a matching `site` component. -- (b) Keep translating the two `site/i18n/*.toml` files by hand. +The Hugo landing strings live in `site/i18n/*.json`. Weblate has no native Hugo-TOML +format, so these were converted from TOML to **go-i18n JSON** (`{"key":{"other":"…"}}`) +— a shape Hugo 0.140 reads identically and Weblate supports natively. Component settings: -For now the site is translated manually; only the `app` component is on Weblate. +| Field | Value | +|---|---| +| Project | `tane` | +| Name / slug | `site` | +| Source code repository | *(link to the `app` component: `weblate://tane/app`)* | +| Repository branch | `main` | +| File mask | `site/i18n/*.json` | +| Monolingual base language file | `site/i18n/en.json` | +| Template for new translations | `site/i18n/en.json` | +| File format | **go-i18n JSON** (`go-i18n-json`) | +| Source language | English (`en`) | + +Linking the repo to the `app` component (`weblate://tane/app`) shares one clone/token. +No slang step here — Hugo consumes the JSON directly. Only EN/ES today; adding a locale = +add `site/i18n/.json`. diff --git a/site/i18n/en.json b/site/i18n/en.json new file mode 100644 index 0000000..999cc59 --- /dev/null +++ b/site/i18n/en.json @@ -0,0 +1,140 @@ +{ + "skipToContent": { + "other": "Skip to content" + }, + "navAbout": { + "other": "About" + }, + "navLegal": { + "other": "Legal" + }, + "navHome": { + "other": "Home" + }, + "screenshotsTitle": { + "other": "A look inside" + }, + "getItTitle": { + "other": "Get Tane" + }, + "getItComingSoon": { + "other": "Publishing to app stores soon. Meanwhile, Tane is free software you can build and run today." + }, + "legalIntro": { + "other": "The plain-language documents that govern Tane. Short version: your data stays on your device, Tane is only a tool, and you are responsible for the seeds you share." + }, + "footerFreeSoftware": { + "other": "Free software (AGPL-3.0). No ads, no commissions, no data selling." + }, + "footerPublishedBy": { + "other": "Published by" + }, + "footerContact": { + "other": "Contact" + }, + "backToHome": { + "other": "Back to home" + }, + "statusBadge": { + "other": "Beta" + }, + "statusTitle": { + "other": "Where Tane is right now" + }, + "statusBody": { + "other": "The inventory works today: keep your seeds offline, encrypted, with no account. The neighbourly sharing layer (offers, messaging, trust) is being built now. Everything already works with zero network." + }, + "screenCapHome": { + "other": "Home — your bank and the market, one tap away" + }, + "screenCapInventory": { + "other": "Inventory — your seeds, grouped by family" + }, + "screenCapMarket": { + "other": "Market — give, swap or sell with people nearby" + }, + "screenCapCalendar": { + "other": "Calendar — what to sow this month" + }, + "screenCapDetail": { + "other": "Variety — years, quantities, origin, germination" + }, + "rtlNoteTitle": { + "other": "International by design" + }, + "rtlNoteBody": { + "other": "Right-to-left and non-Latin scripts are first-class. Here is the inventory mirrored for RTL." + }, + "collabTitle": { + "other": "Get involved" + }, + "collabIntro": { + "other": "Tane has no business model — it lives on volunteers, communities and public tech grants. You can help:" + }, + "collabTranslateT": { + "other": "Translate" + }, + "collabTranslateB": { + "other": "Bring Tane to your language. Translation files are simple; patches are welcome." + }, + "collabTestT": { + "other": "Try it with a seed group" + }, + "collabTestB": { + "other": "Use it in a real seed network or fair and tell us what breaks or what's missing." + }, + "collabCodeT": { + "other": "Contribute code" + }, + "collabCodeB": { + "other": "Flutter/Dart, free software. Design docs and tests included." + }, + "collabFundT": { + "other": "Support it" + }, + "collabFundB": { + "other": "No ads, no commissions. Help fund the work or point us to grants for the commons." + }, + "collabContact": { + "other": "Write to us" + }, + "faqTitle": { + "other": "Questions" + }, + "faqFreeQ": { + "other": "Is it free?" + }, + "faqFreeA": { + "other": "Yes. Free software (AGPL-3.0), no ads, no commissions, no data selling." + }, + "faqAccountQ": { + "other": "Do I need an account?" + }, + "faqAccountA": { + "other": "No account, no sign-up, no server. Your data stays on your device." + }, + "faqOfflineQ": { + "other": "Does it work offline?" + }, + "faqOfflineA": { + "other": "Fully. The internet only enriches it; everything essential works with no connection." + }, + "faqLegalQ": { + "other": "Is it legal to share seeds?" + }, + "faqLegalA": { + "other": "Giving and swapping between growers is broadly allowed; selling can be regulated. You are responsible for what you share — see the notice on seed legality." + }, + "faqDataQ": { + "other": "What about my privacy?" + }, + "faqDataA": { + "other": "Data is encrypted on your device and only what you explicitly share ever leaves it. See the privacy policy." + }, + "aboutCta": { + "other": "Learn what Tane is" + }, + "footerSource": { + "other": "Source code" + } +} diff --git a/site/i18n/en.toml b/site/i18n/en.toml deleted file mode 100644 index 0c6f815..0000000 --- a/site/i18n/en.toml +++ /dev/null @@ -1,113 +0,0 @@ -[skipToContent] -other = "Skip to content" - -[navAbout] -other = "About" - -[navLegal] -other = "Legal" - -[navHome] -other = "Home" - -[screenshotsTitle] -other = "A look inside" - -[getItTitle] -other = "Get Tane" - -[getItComingSoon] -other = "Publishing to app stores soon. Meanwhile, Tane is free software you can build and run today." - -[legalIntro] -other = "The plain-language documents that govern Tane. Short version: your data stays on your device, Tane is only a tool, and you are responsible for the seeds you share." - -[footerFreeSoftware] -other = "Free software (AGPL-3.0). No ads, no commissions, no data selling." - -[footerPublishedBy] -other = "Published by" - -[footerContact] -other = "Contact" - -[backToHome] -other = "Back to home" - -# --- Status --- -[statusBadge] -other = "Beta" -[statusTitle] -other = "Where Tane is right now" -[statusBody] -other = "The inventory works today: keep your seeds offline, encrypted, with no account. The neighbourly sharing layer (offers, messaging, trust) is being built now. Everything already works with zero network." - -# --- Screenshots --- -[screenCapHome] -other = "Home — your bank and the market, one tap away" -[screenCapInventory] -other = "Inventory — your seeds, grouped by family" -[screenCapMarket] -other = "Market — give, swap or sell with people nearby" -[screenCapCalendar] -other = "Calendar — what to sow this month" -[screenCapDetail] -other = "Variety — years, quantities, origin, germination" -[rtlNoteTitle] -other = "International by design" -[rtlNoteBody] -other = "Right-to-left and non-Latin scripts are first-class. Here is the inventory mirrored for RTL." - -# --- Get involved --- -[collabTitle] -other = "Get involved" -[collabIntro] -other = "Tane has no business model — it lives on volunteers, communities and public tech grants. You can help:" -[collabTranslateT] -other = "Translate" -[collabTranslateB] -other = "Bring Tane to your language. Translation files are simple; patches are welcome." -[collabTestT] -other = "Try it with a seed group" -[collabTestB] -other = "Use it in a real seed network or fair and tell us what breaks or what's missing." -[collabCodeT] -other = "Contribute code" -[collabCodeB] -other = "Flutter/Dart, free software. Design docs and tests included." -[collabFundT] -other = "Support it" -[collabFundB] -other = "No ads, no commissions. Help fund the work or point us to grants for the commons." -[collabContact] -other = "Write to us" - -# --- FAQ --- -[faqTitle] -other = "Questions" -[faqFreeQ] -other = "Is it free?" -[faqFreeA] -other = "Yes. Free software (AGPL-3.0), no ads, no commissions, no data selling." -[faqAccountQ] -other = "Do I need an account?" -[faqAccountA] -other = "No account, no sign-up, no server. Your data stays on your device." -[faqOfflineQ] -other = "Does it work offline?" -[faqOfflineA] -other = "Fully. The internet only enriches it; everything essential works with no connection." -[faqLegalQ] -other = "Is it legal to share seeds?" -[faqLegalA] -other = "Giving and swapping between growers is broadly allowed; selling can be regulated. You are responsible for what you share — see the notice on seed legality." -[faqDataQ] -other = "What about my privacy?" -[faqDataA] -other = "Data is encrypted on your device and only what you explicitly share ever leaves it. See the privacy policy." - -# --- misc --- -[aboutCta] -other = "Learn what Tane is" -[footerSource] -other = "Source code" diff --git a/site/i18n/es.json b/site/i18n/es.json new file mode 100644 index 0000000..f9a3e2c --- /dev/null +++ b/site/i18n/es.json @@ -0,0 +1,140 @@ +{ + "skipToContent": { + "other": "Saltar al contenido" + }, + "navAbout": { + "other": "Qué es Tane" + }, + "navLegal": { + "other": "Legal" + }, + "navHome": { + "other": "Inicio" + }, + "screenshotsTitle": { + "other": "Un vistazo por dentro" + }, + "getItTitle": { + "other": "Consigue Tane" + }, + "getItComingSoon": { + "other": "Pronto en las tiendas de aplicaciones. Mientras tanto, Tane es software libre que puedes compilar y usar hoy." + }, + "legalIntro": { + "other": "Los documentos, en lenguaje claro, que rigen Tane. En resumen: tus datos se quedan en tu dispositivo, Tane es solo una herramienta, y tú eres responsable de las semillas que compartes." + }, + "footerFreeSoftware": { + "other": "Software libre (AGPL-3.0). Sin anuncios, sin comisiones, sin venta de datos." + }, + "footerPublishedBy": { + "other": "Publicado por" + }, + "footerContact": { + "other": "Contacto" + }, + "backToHome": { + "other": "Volver al inicio" + }, + "statusBadge": { + "other": "Beta" + }, + "statusTitle": { + "other": "En qué punto está Tane" + }, + "statusBody": { + "other": "El inventario ya funciona: guarda tus semillas sin conexión, cifradas y sin cuenta. La capa de intercambio vecinal (ofertas, mensajería, confianza) se está construyendo ahora. Todo funciona ya sin ninguna red." + }, + "screenCapHome": { + "other": "Inicio — tu banco y el mercado a un toque" + }, + "screenCapInventory": { + "other": "Inventario — tus semillas, agrupadas por familia" + }, + "screenCapMarket": { + "other": "Mercado — regala, intercambia o vende con gente cerca" + }, + "screenCapCalendar": { + "other": "Calendario — qué sembrar este mes" + }, + "screenCapDetail": { + "other": "Variedad — años, cantidades, procedencia, germinación" + }, + "rtlNoteTitle": { + "other": "Internacional por diseño" + }, + "rtlNoteBody": { + "other": "Los idiomas de derecha a izquierda y las escrituras no latinas son de primera clase. Aquí, el inventario reflejado para RTL." + }, + "collabTitle": { + "other": "Colabora" + }, + "collabIntro": { + "other": "Tane no tiene modelo de negocio: se sostiene con voluntariado, comunidades y ayudas públicas. Puedes ayudar:" + }, + "collabTranslateT": { + "other": "Traduce" + }, + "collabTranslateB": { + "other": "Lleva Tane a tu idioma. Los ficheros de traducción son sencillos; los parches son bienvenidos." + }, + "collabTestT": { + "other": "Pruébala con un grupo de semillas" + }, + "collabTestB": { + "other": "Úsala en una red o feria de semillas real y cuéntanos qué falla o qué falta." + }, + "collabCodeT": { + "other": "Programa" + }, + "collabCodeB": { + "other": "Flutter/Dart, software libre. Con documentación de diseño y tests." + }, + "collabFundT": { + "other": "Apóyala" + }, + "collabFundB": { + "other": "Sin anuncios ni comisiones. Ayuda a financiar el trabajo o señálanos ayudas para el común." + }, + "collabContact": { + "other": "Escríbenos" + }, + "faqTitle": { + "other": "Preguntas" + }, + "faqFreeQ": { + "other": "¿Es gratis?" + }, + "faqFreeA": { + "other": "Sí. Software libre (AGPL-3.0), sin anuncios, sin comisiones, sin venta de datos." + }, + "faqAccountQ": { + "other": "¿Necesito cuenta?" + }, + "faqAccountA": { + "other": "Sin cuenta, sin registro, sin servidor. Tus datos se quedan en tu dispositivo." + }, + "faqOfflineQ": { + "other": "¿Funciona sin conexión?" + }, + "faqOfflineA": { + "other": "Totalmente. Internet solo la enriquece; todo lo esencial funciona sin conexión." + }, + "faqLegalQ": { + "other": "¿Es legal compartir semillas?" + }, + "faqLegalA": { + "other": "Regalar e intercambiar entre cultivadoras suele estar permitido; vender puede estar regulado. Eres responsable de lo que compartes: mira el aviso sobre semillas." + }, + "faqDataQ": { + "other": "¿Y mi privacidad?" + }, + "faqDataA": { + "other": "Los datos van cifrados en tu dispositivo y solo sale lo que compartes a propósito. Mira la política de privacidad." + }, + "aboutCta": { + "other": "Descubre qué es Tane" + }, + "footerSource": { + "other": "Código fuente" + } +} diff --git a/site/i18n/es.toml b/site/i18n/es.toml deleted file mode 100644 index 1ebc6bf..0000000 --- a/site/i18n/es.toml +++ /dev/null @@ -1,113 +0,0 @@ -[skipToContent] -other = "Saltar al contenido" - -[navAbout] -other = "Qué es Tane" - -[navLegal] -other = "Legal" - -[navHome] -other = "Inicio" - -[screenshotsTitle] -other = "Un vistazo por dentro" - -[getItTitle] -other = "Consigue Tane" - -[getItComingSoon] -other = "Pronto en las tiendas de aplicaciones. Mientras tanto, Tane es software libre que puedes compilar y usar hoy." - -[legalIntro] -other = "Los documentos, en lenguaje claro, que rigen Tane. En resumen: tus datos se quedan en tu dispositivo, Tane es solo una herramienta, y tú eres responsable de las semillas que compartes." - -[footerFreeSoftware] -other = "Software libre (AGPL-3.0). Sin anuncios, sin comisiones, sin venta de datos." - -[footerPublishedBy] -other = "Publicado por" - -[footerContact] -other = "Contacto" - -[backToHome] -other = "Volver al inicio" - -# --- Estado --- -[statusBadge] -other = "Beta" -[statusTitle] -other = "En qué punto está Tane" -[statusBody] -other = "El inventario ya funciona: guarda tus semillas sin conexión, cifradas y sin cuenta. La capa de intercambio vecinal (ofertas, mensajería, confianza) se está construyendo ahora. Todo funciona ya sin ninguna red." - -# --- Capturas --- -[screenCapHome] -other = "Inicio — tu banco y el mercado a un toque" -[screenCapInventory] -other = "Inventario — tus semillas, agrupadas por familia" -[screenCapMarket] -other = "Mercado — regala, intercambia o vende con gente cerca" -[screenCapCalendar] -other = "Calendario — qué sembrar este mes" -[screenCapDetail] -other = "Variedad — años, cantidades, procedencia, germinación" -[rtlNoteTitle] -other = "Internacional por diseño" -[rtlNoteBody] -other = "Los idiomas de derecha a izquierda y las escrituras no latinas son de primera clase. Aquí, el inventario reflejado para RTL." - -# --- Colabora --- -[collabTitle] -other = "Colabora" -[collabIntro] -other = "Tane no tiene modelo de negocio: se sostiene con voluntariado, comunidades y ayudas públicas. Puedes ayudar:" -[collabTranslateT] -other = "Traduce" -[collabTranslateB] -other = "Lleva Tane a tu idioma. Los ficheros de traducción son sencillos; los parches son bienvenidos." -[collabTestT] -other = "Pruébala con un grupo de semillas" -[collabTestB] -other = "Úsala en una red o feria de semillas real y cuéntanos qué falla o qué falta." -[collabCodeT] -other = "Programa" -[collabCodeB] -other = "Flutter/Dart, software libre. Con documentación de diseño y tests." -[collabFundT] -other = "Apóyala" -[collabFundB] -other = "Sin anuncios ni comisiones. Ayuda a financiar el trabajo o señálanos ayudas para el común." -[collabContact] -other = "Escríbenos" - -# --- Preguntas --- -[faqTitle] -other = "Preguntas" -[faqFreeQ] -other = "¿Es gratis?" -[faqFreeA] -other = "Sí. Software libre (AGPL-3.0), sin anuncios, sin comisiones, sin venta de datos." -[faqAccountQ] -other = "¿Necesito cuenta?" -[faqAccountA] -other = "Sin cuenta, sin registro, sin servidor. Tus datos se quedan en tu dispositivo." -[faqOfflineQ] -other = "¿Funciona sin conexión?" -[faqOfflineA] -other = "Totalmente. Internet solo la enriquece; todo lo esencial funciona sin conexión." -[faqLegalQ] -other = "¿Es legal compartir semillas?" -[faqLegalA] -other = "Regalar e intercambiar entre cultivadoras suele estar permitido; vender puede estar regulado. Eres responsable de lo que compartes: mira el aviso sobre semillas." -[faqDataQ] -other = "¿Y mi privacidad?" -[faqDataA] -other = "Los datos van cifrados en tu dispositivo y solo sale lo que compartes a propósito. Mira la política de privacidad." - -# --- varios --- -[aboutCta] -other = "Descubre qué es Tane" -[footerSource] -other = "Código fuente"