Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ActiveLang string
ActiveLang is the resolved active language tag. Set once in rootCmd.PersistentPreRunE before any command body runs.
Functions ¶
func Lookup ¶
Lookup returns the translation for key in lang (falling back to en). Returns the string and true if found in either catalog; "", false if absent from both.
func Resolve ¶
Resolve returns the active language tag. Priority: cfgLang (if non-empty, used exclusively) → LANG env var → LC_ALL env var → "en". Empty env var values are treated as unset. All inputs are stripped of region/encoding suffixes: "de_AT.UTF-8" → "de". Unknown tags (no catalog) resolve to "en".
func Tf ¶
Tf resolves key via T and executes it as a text/template with data. Uses missingkey=error: missing keys in data trigger a failure. On any parse or execute failure, returns the raw (un-executed) catalog string. If data is nil, template actions will fail (missingkey=error), returning the raw string.
Types ¶
This section is empty.