es-fluent-manager-embedded
The es-fluent-manager-embedded crate provides a convenient global embedded singleton for the FluentManager. This is useful for applications that do not use a dependency injection framework and need a simple, globally accessible way to manage translations.
It is designed to work with embedded translations, using the define_embedded_i18n_module! macro to discover and compile translation files directly into the binary.
Usage
- In each of your crates that has translations, define a embedded singleton-specific module:
// In my_crate/src/lib.rs
// This macro discovers languages from your `i18n` directory and registers
// the module for the embedded assets system.
define_i18n_module!;
- At the start of your application, initialize the embedded singleton:
// In main.rs
use langid;
// This macro discovers languages from your `i18n` directory and registers
// the module for the embedded assets system.
// In this case, for any EsFluent derived item included with your application's entrypoint.
define_i18n_module!;