Expand description
§es-fluent-manager-bevy
Typed localization for Bevy 0.19.x. The plugin loads configured FTL
resources, updates FluentText<T> components when the locale changes,
and exposes BevyI18n for direct localization in systems.
[dependencies]
bevy = "0.19"
es-fluent = "*"
es-fluent-manager-bevy = "*"Register package resources from a library module:
es_fluent_manager_bevy::define_i18n_module!();Install the plugin:
use bevy::prelude::*;
use es_fluent_manager_bevy::I18nPlugin;
use unic_langid::langid;
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(I18nPlugin::with_language(langid!("en")))
.run();Derive BevyFluentText for values used directly as
FluentText<T>. Use #[locale] on named fields that must
refresh from the requested locale, and use I18nSet when application
systems need explicit ordering around localization phases.
Configured packages call es_fluent_build::track_i18n_assets() from Cargo’s
selected custom-build target. Derived fallback-locale messages are compile-time
checked by default. Set missing_message_policy = "fallback-str" in the owning
package’s i18n.toml when BevyI18n and FluentText<T> should use snake_case
field, variant, or type names after locale fallback is exhausted.
See the Bevy manager guide for UI components, system parameters, locale state, and scheduling.
Macros§
- define_
i18n_ module - Defines a Bevy i18n module.
Structs§
- Active
Language Id - A Bevy resource that holds the currently published active
LanguageIdentifier. - Bevy
I18n - Bevy-native localization context for systems.
- Fluent
Text - A Bevy component that holds localized text content.
- I18n
Plugin - Bevy plugin that wires asset loading, runtime language state, and the context-bound localization together.
- I18n
Plugin Config - Configuration for
I18nPlugin. - I18n
Plugin Startup Error - Startup failure captured when the plugin cannot safely initialize i18n.
- Locale
Change Event - A Bevy
Messagesent to request a change of the requested locale. - Locale
Changed Event - A Bevy
Messagesent after the active locale has been successfully published. - Requested
Language Id - A Bevy resource that holds the most recently requested
LanguageIdentifier.
Enums§
- I18nSet
- Bevy system sets used by
crate::I18nPlugin.
Traits§
- Fluent
Text Registration - An extension trait for
Appto simplify the registration ofFluentTextcomponents. - From
Locale - A trait for types that can be constructed from a
LanguageIdentifier. - Refresh
ForLocale - A trait for types that can be updated in place when the locale changes.
Derive Macros§
- Bevy
Fluent Text - Registers a type for use with
FluentText<T>in Bevy.