es-fluent-lang
Runtime support for es-fluent language management.
This crate provides the core language types (re-exporting unic-langid) and the optional "Language Enum" generator macro.
Features
#[es_fluent_language]
Generates a strongly-typed enum of all available languages in your project. It automatically scans your i18n.toml assets directory to find supported locales.
use es_fluent_language;
use EsFluent;
use EnumIter;
// Define an empty enum, and the macro fills it
If your assets_dir contains en, fr, and de folders, this generates:
It also implements:
Default: Uses thefallback_languagefrom your config.FromStr: Parses string codes (e.g., "en-US") into the enum variant.Into<LanguageIdentifier>: Converts back to a standard locale ID.
Standard Translations
The crate also includes a built-in module for translating language names themselves (e.g., "English", "Français", "Deutsch"). This means you can easily build a "Language Picker" UI without manually translating the names of every language.