aboutsummaryrefslogtreecommitdiff
path: root/ki18n/cmd/gettext
diff options
context:
space:
mode:
Diffstat (limited to 'ki18n/cmd/gettext')
-rw-r--r--ki18n/cmd/gettext/gettext.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/ki18n/cmd/gettext/gettext.go b/ki18n/cmd/gettext/gettext.go
index e68dd22..b3b47cd 100644
--- a/ki18n/cmd/gettext/gettext.go
+++ b/ki18n/cmd/gettext/gettext.go
@@ -174,6 +174,7 @@ func main() {
extractedKeys := extractAllKeys()
baseLogger.Info("extracted keys from templates", slog.Int("count", len(extractedKeys)))
+ missingKeys := false
for _, lang := range langs {
logger := baseLogger.With(slog.String("lang", lang))
currentLocales := getOrCreateLocale(lang, logger)
@@ -201,6 +202,7 @@ func main() {
if _, ok := currentLocales[key]; !ok {
logger.Info(`found missing key`, slog.String("key", key))
newLocales[key] = ""
+ missingKeys = true
}
}
var completion string
@@ -217,4 +219,8 @@ func main() {
kcore.Expect(os.WriteFile(filepath.Join("locales", lang, "index.yml"), content, 0o600), "error writing file")
}
}
+
+ if missingKeys {
+ os.Exit(1)
+ }
}