From 0dd14393d296d9a0915a978f83ac2057b7e4d711 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 12 May 2026 17:31:50 +0200 Subject: ki18n: add gettext CI check for missing translation keys gettext now exits 1 when any key extracted from templates is absent from a locale file. Added as a task and wired into the check task. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 9e6cf5a..aa436a4 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,17 @@ ## ki18n -- [ ] Add gettext to CI - ### Setup 1. Call `ki18n.Init(localesFS)` at startup with a filesystem containing `/*.yml` translation files. Pass extra `ki18n.Locale` values to register additional languages. 2. Register `ki18n.LangMiddleware(...)` on your router, passing one or more strategies in priority order. -3. Run `go run github.com/martinlehoux/kagamigo/cmd/gettext -write` to generate translation files. +3. Run `go run github.com/martinlehoux/kagamigo/ki18n/cmd/gettext -write` to generate translation files. 4. Complete the generated files. +5. Add the check to CI — exits 1 if any translation key is missing from a locale file: + +```sh +go run github.com/martinlehoux/kagamigo/ki18n/cmd/gettext +``` ### Language detection strategies -- cgit v1.3