Skip to main content

Crate es_fluent_manager_bevy

Crate es_fluent_manager_bevy 

Source
Expand description

§es-fluent-manager-bevy

Docs Crates.io

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§

ActiveLanguageId
A Bevy resource that holds the currently published active LanguageIdentifier.
BevyI18n
Bevy-native localization context for systems.
FluentText
A Bevy component that holds localized text content.
I18nPlugin
Bevy plugin that wires asset loading, runtime language state, and the context-bound localization together.
I18nPluginConfig
Configuration for I18nPlugin.
I18nPluginStartupError
Startup failure captured when the plugin cannot safely initialize i18n.
LocaleChangeEvent
A Bevy Message sent to request a change of the requested locale.
LocaleChangedEvent
A Bevy Message sent after the active locale has been successfully published.
RequestedLanguageId
A Bevy resource that holds the most recently requested LanguageIdentifier.

Enums§

I18nSet
Bevy system sets used by crate::I18nPlugin.

Traits§

FluentTextRegistration
An extension trait for App to simplify the registration of FluentText components.
FromLocale
A trait for types that can be constructed from a LanguageIdentifier.
RefreshForLocale
A trait for types that can be updated in place when the locale changes.

Derive Macros§

BevyFluentText
Registers a type for use with FluentText<T> in Bevy.