Skip to main content

Module i18n

Module i18n 

Source
Expand description

Bilingual message layer for human-facing stderr progress (--lang en|pt, XDG i18n.lang). Bilingual human-readable message layer.

The CLI chooses language for stderr progress messages via:

  1. Explicit --lang en|pt flag
  2. XDG setting i18n.lang (config set i18n.lang pt)
  3. OS locale (LC_ALL / LC_MESSAGES / LANG — system env, not product)
  4. Fallback English

JSON stdout is deterministic and identical across languages.

Modules§

errors_msg
Error messages for AppError variants — always English.
validation
Localized validation messages for memory fields. Localized validation messages for memory fields and CLI guards.

Enums§

Language
Language.

Functions§

current
Returns the active language, or fallback English if init was never called.
error_prefix
Localized prefix for error messages displayed to the end user.
init
Initializes the global language. Subsequent calls are silently ignored (OnceLock semantics) — guaranteeing thread-safety and determinism.
prune_dry_run
Progress message for dry-run preview of prune-relations.
prune_requires_yes
Warning message when –yes is not passed for destructive prune-relations.
relations_pruned
Progress message emitted after pruning relationships.
tr
Translates a bilingual message by selecting the active variant.