Skip to main content

Crate greentic_i18n_cards

Crate greentic_i18n_cards 

Source
Expand description

Adaptive Card i18n primitives: extract translatable strings from cards and drive greentic-i18n-translator to produce per-locale bundles. Each consumer keeps its own high-level orchestration on top of these primitives.

Structs§

ExtractConfig
Configuration for i18n extraction.
ExtractedString
An extracted translatable string.

Constants§

TRANSLATOR_BIN_ENV
Explicit path override for the translator binary.
TRANSLATOR_DEV_BIN_ENV
Dev override for the translator binary.

Functions§

extract_from_directory
Extract translatable strings from all cards in a directory.
extract_from_value
Extract strings from a JSON value recursively.
is_translator_available
Whether a translator binary can be located.
resolve_translator
Locate the translator: env override (GREENTIC_I18N_TRANSLATOR_BIN then _DEV_BIN) if the pointed file exists, otherwise search PATH.
to_json_bundle
Convert extracted strings to a JSON bundle format.
translate_to_language
Translate one language. Runs <translator> translate --langs <lang> --en <abs en> [--glossary <abs>] --auth-mode auto in a unique temp cwd (git init so codex-cli trusts it). The translator writes <lang>.json next to --en. Returns Err on spawn failure or non-zero exit.
write_bundle
Write extracted strings to a JSON file.
write_manifest
Write _manifest.json (sorted, deduped locale array, always incl. "en").