Expand description
Fluent-based i18n for tool descriptions.
English descriptions are embedded via include_str! at compile time.
Non-English locales are loaded from disk and override English per-key.
Structs§
- Locale
Option - One selectable locale: its
code(e.g.ja) and displaylabel(e.g.日本語).
Functions§
- available_
locales - Locales the build knows about, from the embedded
locales.toml. Cheap: parsed once, then returns a borrow of the cached'staticvector. - detect_
locale - Detect locale: config.toml → “en”.
- get_
cli_ string - Get a CLI string by key (e.g. “cli-config-about”).
- get_
cli_ string_ with_ args - Get a CLI string by key and format it with Fluent external arguments.
- get_
required_ cli_ string - Get a required CLI string by key, reporting missing Fluent strings centrally.
- get_
required_ cli_ string_ with_ args - Get a required CLI string by key and format it with Fluent external arguments.
- get_
tool_ description - Get a tool description by tool name (e.g. “shell”, “file_read”).
- init
- Initialize with a specific locale. No-op after first call.
- normalize_
locale - Normalize “zh_CN.UTF-8” → “zh-CN”.