Move `l10n_embed` re-exports into `macro_prelude` module

finchie
Aug 8, 2025, 5:25 AM
PGBXJWIHSVTRD7CGDSCPC4YHI65EBKMQFEX62RZWL4EZB63622XAC

Dependencies

  • [2] RUCC2HKZ Rename from `fluent_embed` to `l10n_embed`
  • [3] BFL2Y7GN Add relative timestamps using `jiff` and `icu_relativetime`
  • [4] KZLFC7OW Rename `fluent_embed_runtime` to `fluent_embed`
  • [5] EAPOUW73 Fix compilation error with `fluent-syntax` span PR
  • [6] CESJ4CTO Move macro-specific code into `macro_impl` module
  • [7] QSK7JRBA Add simple `attribute_path` function
  • [8] 73C6NOJ7 Fix minimal `Localize` implementation on errors
  • [9] S26YOXQI Update `Cargo.toml` in workspace and packages
  • [10] X6AMFX3N Temporarily remove automatic language detection
  • [11] 7U2DXFMP Refactor `fluent_embed::Localize` to support overriding locales
  • [12] C6W7N6N5 Implement `Localize` for `FixedDecimal` and primitive number types
  • [13] 4MRF5E76 Generate simple locale matching code in `localize()`
  • [14] 5TEX4MNU Split `fluent_embed` into `group` and `parse` modules
  • [15] UN2XEIEU Migrate from `locale_select` to `env_preferences`
  • [16] CFJKYXUX Remove newtype wrapper `RelativeTime` for `jiff::Timestamp`
  • [17] 3NMKD6I5 Refactor `Localize` trait to use `std::io::Write`
  • [18] K3G4HK2J Track Fluent files using `include!`
  • [19] 7JPOCQEI Add explicit error handling for macro parsing
  • [20] MWN4CAOZ Update `LocalizationError` in `fluent_embed`
  • [21] 6XEMHUGS Use full `Locale` instead of `LanguageIdentifier` subset
  • [22] OWXLFLRM Merge `cli_macros` shim into `fluent_embed`
  • [23] QJC4IQIT Refactor `Localize` functions to infallibly return `String`
  • [24] RUFPE6OO Include canonical locale in list of available locales
  • [25] HHJDRLLN Create `fluent_embed_runtime` crate
  • [26] LU6IFZFG Remove `std::io::Write` trait bound from `Localize`
  • [27] 7M4UI3TW Update dependencies to latest versions
  • [28] QFPQZR4K Refactor `fluent_embed`
  • [29] NO3PDO7P Refactor `fluent_embed` to support structs
  • [30] EKXWNEPK Rename `Localize::message_for_locale` to `Localize::localize_for`
  • [31] 5I5NR4DQ Make `Localize::CANONICAL_LOCALE` a function instead of associated constant
  • [*] XGNME3WR Move `Group::derive_enum` to new `crate::parse_macro` module
  • [*] O77KA6C4 Create `fluent_embed` crate

Change contents

  • replacement in l10n_embed_derive/src/macro_impl/mod.rs at line 169
    [2.1165][2.1165:1311]()
    fn canonical_locale(&self) -> ::l10n_embed::icu_locale::Locale {
    ::l10n_embed::icu_locale::locale!(#canonical_locale)
    [2.1165]
    [3.398]
    fn canonical_locale(&self) -> ::l10n_embed::macro_prelude::icu_locale::Locale {
    ::l10n_embed::macro_prelude::icu_locale::locale!(#canonical_locale)
  • replacement in l10n_embed_derive/src/macro_impl/mod.rs at line 173
    [3.1714][2.1312:1395]()
    fn available_locales(&self) -> Vec<::l10n_embed::icu_locale::Locale> {
    [3.1714]
    [3.383]
    fn available_locales(&self) -> Vec<::l10n_embed::macro_prelude::icu_locale::Locale> {
  • replacement in l10n_embed_derive/src/macro_impl/mod.rs at line 179
    [3.477][2.1396:1455]()
    locale: &::l10n_embed::icu_locale::Locale,
    [3.477]
    [3.1177]
    locale: &::l10n_embed::macro_prelude::icu_locale::Locale,
  • replacement in l10n_embed_derive/src/macro_impl/derive.rs at line 45
    [3.2231][2.1456:1780]()
    const PLURAL_RULE_TYPE: ::l10n_embed::PluralRuleType =
    ::l10n_embed::PluralRuleType::Cardinal;
    let plural_options = ::l10n_embed::PluralRulesOptions::default().with_type(PLURAL_RULE_TYPE);
    let plural_rules = ::l10n_embed::PluralRules::try_new(locale.into(), plural_options).unwrap();
    [3.2231]
    [3.712]
    const PLURAL_RULE_TYPE: ::l10n_embed::macro_prelude::icu_plurals::PluralRuleType =
    ::l10n_embed::macro_prelude::icu_plurals::PluralRuleType::Cardinal;
    let plural_options = ::l10n_embed::macro_prelude::icu_plurals::PluralRulesOptions::default()
    .with_type(PLURAL_RULE_TYPE);
    let plural_rules = ::l10n_embed::macro_prelude::icu_plurals::PluralRules::try_new(
    locale.into(),
    plural_options,
    )
    .unwrap();
  • edit in l10n_embed_derive/src/macro_impl/derive.rs at line 55
    [3.713]
    [3.2468]
  • replacement in l10n_embed_derive/src/macro_impl/derive.rs at line 93
    [3.1776][2.1781:1869]()
    quote!(vec![self.canonical_locale(), #(::l10n_embed::locale!(#locale_literals)),*])
    [3.1776]
    [3.1841]
    quote!(
    vec![self.canonical_locale(), #(::l10n_embed::macro_prelude::icu_locale::locale!(#locale_literals)),*]
    )
  • replacement in l10n_embed_derive/src/lib.rs at line 48
    [3.2976][2.2088:2163]()
    locale: &::l10n_embed::icu_locale::Locale,
    [3.2976]
    [3.1404]
    locale: &::l10n_embed::macro_prelude::icu_locale::Locale,
  • replacement in l10n_embed_derive/src/fluent/ast.rs at line 37
    [3.1755][2.2164:2276]()
    parse_quote!(::l10n_embed::icu_plurals::PluralCategory::#ident_pascal_case)
    [3.1755]
    [3.7266]
    parse_quote!(::l10n_embed::macro_prelude::icu_plurals::PluralCategory::#ident_pascal_case)
  • replacement in l10n_embed_derive/src/fluent/ast.rs at line 101
    [3.2046][2.2277:2405]()
    parse_quote!(::l10n_embed::Decimal::try_from_f64(#float_literal, ::l10n_embed::FloatPrecision::RoundTrip).unwrap())
    [3.2046]
    [3.2330]
    parse_quote!(
    ::l10n_embed::macro_prelude::fixed_decimal::Decimal::try_from_f64(
    #float_literal,
    ::l10n_embed::macro_prelude::fixed_decimal::FloatPrecision::RoundTrip,
    )
    .unwrap();
    )
  • edit in l10n_embed/src/lib.rs at line 1
    [3.924][3.114:269](),[3.114][3.114:269](),[3.269][3.2686:2736](),[3.2736][3.2078:2122](),[3.56][3.2792:2870](),[3.2122][3.2792:2870](),[3.2792][3.2792:2870](),[3.2870][3.107:132](),[3.382][3.107:132](),[3.405][3.4361:4362]()
    // Public re-exports of dependencies required at runtime, so macro-generated code
    // can find all the dependencies it expects as long as this crate exists
    pub use fixed_decimal::{Decimal, FloatPrecision};
    pub use icu_locale::{self, Locale, locale};
    pub use icu_plurals::{self, PluralRuleType, PluralRules, PluralRulesOptions};
    pub use jiff::Timestamp;
  • edit in l10n_embed/src/lib.rs at line 5
    [3.4376]
    [3.405]
    use icu_locale::{Locale, locale};
    // Public re-exports of dependencies required at runtime, so macro-generated code
    // can find all the dependencies it expects as long as this crate exists
    pub mod macro_prelude {
    pub use icu_locale;
    pub use icu_plurals;
    }