PackageTrack
Sign in Get early access

i18n-embed

Traits and macros to conveniently embed localization assets into your application binary or library in order to localize it at runtime.

0.16.0 5.1M downloads/mo #4496 most downloaded on crates.io kellpossible/cargo-i18n

What this package is like to depend on

Last release 1 years ago

09 Jul 2025

Release timing varies

gaps range from 2 weeks to 11 months

Most releases are documented

notes for 41 of 50 stable releases

3 versions withdrawn

withdrawn after publishing

6 years old

53 releases · first in 2020

0 releases in the last 12 months

see the full history below

Release timeline

53 releases · Apr 2020 to Jul 2025
2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 53
  1. 0.16.0 09 Jul 2025
    Release notes
    • i18n-embed v0.16.0
    • i18n-build v0.10.3
    Open source →
    Release notes

    Fixes

    • #13 Replace abandoned locale_config dependency with sys-locale. Fixes #63 Cannot parse locale on Macos. Big thanks to @TristanDebrunner for this contribution!
      • When the gettext-system feature is enabled, locale_config is not entirely eliminated from the dependency tree as gettext-rs depends on it.

    Dependencies

    • Bump fluent to 0.17 and fluent-syntax to 0.12.
      • Considering this is such a central dependency, I've decided to treat this as a breaking change.

    Documentation

    Open source →
  2. 0.15.4 14 Apr 2025
    Release notes
    • Bump i18n-embed to v0.15.4
    • Bump i18n-embed-fl to v0.9.4
    Open source →
    Release notes

    New Features

    • Add FluentLanguageLoader::with_fluent_message_and_bundle(). This method functions like with_fluent_message(), but it also returns the FluentBundle which owns the message. As part of implementation of #144. Many thanks to @cbs228 for this contribution.

    Internal

    • Bump version of notify dependency to version 8.0.0.
    Open source →
  3. 0.15.3 06 Jan 2025
    Release notes
    • i18n-embed v0.15.3
    • i18n-build v0.10.1
    • i18n-embed-fl v0.9.3
    Open source →
    Release notes

    Internal

    • Removed dependency on lazy_static #135 thanks to @mrtryhard.
    Open source →
  4. 0.15.2 23 Oct 2024
    Release notes
    • Fix incorrect workspace package specification for i18n-embed-impl.
    Open source →
  5. 0.15.1 23 Oct 2024 withdrawn
    Release notes

    Fixes

    • Fix for #97 Error when using workspace defined package metadata. Contributed by @Umio-Yasuno.

    Internal

    • Use workspace dependency for i18n-embed-impl crate.
    Open source →
  6. 0.15.0 08 Aug 2024
    Release notes

    New Features

    • New autoreload crate feature.
      • RustEmbedNotifyAssets - A wrapper for rust_embed::RustEmbed that supports notifications when files have changed on the file system.
      • FileSystemAssets::notify_changes_enabled() - A new method to enable watching for changes.
    • AssetsMultiplexor - A way to multiplex implementations of [I18nAssets] where assets are multiplexed by a priority.

    Breaking

    • Modified I18nAssets trait.
      • Support multiple files referencing the same asset (to allow a hierarchy of overrides).
      • Support for subscribing to updates to assets.
    • Remove deprecated methods for LanguageConfig, Please use lang(...).get_attr_args(...) etc instead.
      • LanguageConfig::get_lang()
      • LanguageConfig::get_lang_args_concrete()
      • LanguageConfig::get_lang_args_fluent()
      • LanguageConfig::get_lang_args()
      • LanguageConfig::get_lang_attr()
      • LanguageConfig::get_lang_attr_args_concrete()
      • LanguageConfig::get_lang_attr_args_fluent()
      • LanguageConfig::get_lang_attr_args()
      • LanguageConfig::lang() - Please use select_languages(...) instead.
    • Extra bounds on the arguments for DefaultLocalizer::new() (Send + Sync + 'static) to allow it to be used with autoreload feature.
    • LanguageLoader::load_languages() now accepts &[unic_langid::LanguageIdentifier] instead of &[&unic_langid::LanguageIdentifier].
    • LanguageLoader:reload() - Added a new trait method which is used to reload the currently loaded languages.

    Fixes

    • Fallback to std::env::var("CARGO_PKG_NAME") Fixes #97
    Open source →
  7. 0.14.1 27 Sep 2023

    Nothing published for this version

  8. 0.14.0 10 Sep 2023
    Release notes

    Internal

    • Bump dependencies and use workspace dependencies.
    Open source →
  9. 0.13.9 16 May 2023

    Nothing published for this version

  10. 0.13.8 14 Jan 2023
    Release notes

    Internal

    • Made arc-swap an optional dependency, it's only required for fluent-system implementation.
    Open source →
  11. 0.13.7 14 Jan 2023
    Release notes

    New Features

    • A new LanguageLoader::load_available_languages() method to load all available languages.
    • A new FluentLanguageLoader::select_languages() method (renamed FluentLanguageLoader::lang()).
    • A new FluentLanguageLoader::select_languages_negotiate() method to select languages based on a negotiation strategy using the available languages.

    Deprecated

    • FluentLanguageLoader::lang() is deprecated in favour of renamed FluentLanguageLoader::select_languages().
    Open source →
  12. 0.13.6 14 Jan 2023
    Release notes

    New Features

    • A single new method called FluentLanguageLoader::lang() thanks to @bikeshedder!

    This methods allows creating a shallow copy of the FluentLanguageLoader which can than be used just like the original loader but with a different current language setting. That makes it possible to use the fl! macro without any changes and is a far more elegant implementation than adding multiple get_lang* methods as done in #84.

    Deprecated

    • FluentLanguageLoader::get_lang* methods have been deprecated in favour of FluentLanguageLoader::lang().
    Open source →
  13. 0.13.5 09 Jan 2023
    Release notes

    New Features

    • Support fluent attributes #98 thanks to @Almost-Senseless-Coder!
      • New methods on FluentLanguageLoader:
      • get_attr
      • get_attr_args_concrete
      • get_attr_args_fluent
      • get_attr_args
      • get_lang_attr
      • get_lang_attr_args_concrete
      • get_lang_attr_args_fluent
      • get_lang_attr_args

    Internal

    • Bump env_logger dev dependency to version 0.10.
    • Fix clippy warnings.
    Open source →
  14. 0.13.4 23 Feb 2022
    Release notes

    New Features

    • Implement FluentLanguageLoader::get_lang(...) methods. This enables the use of the fluent language loader without using the global current language setting, which is useful for web servers. Closes #59.
    Open source →
  15. 0.13.3 10 Feb 2022
    Release notes
    Open source →
  16. 0.13.2 10 Feb 2022
    Release notes

    Internal

    • Use conditional compilation correctly for doctests.
    • Update parking_lot to version 0.12.
    Open source →
  17. 0.13.1 12 Dec 2021
    Release notes

    New Features

    • New FluentLanguageLoader::with_bundles_mut() method to allow mutable access to bundles.

    Internal Changes

    • Bumped pretty_assertions version 1.0.
    • Fixed clippy lints.
    Open source →
  18. 0.13.0 26 Aug 2021
    Release notes

    Breaking Changes

    • Update rust-embed to version 6.
    • Update fluent to version 0.16.
    Open source →
  19. 0.12.1 06 Jun 2021
    Release notes

    Documentation

    • Updated crate description.
    • Don't reference specific i18n-embed version number.
    Open source →
  20. 0.12.0 18 Mar 2021
    Release notes

    Documentation

    • Added bin example which explains how to consume the lib-fluent example library in a desktop CLI application.

    Breaking Changes

    • Updated fluent to version 0.15.

    Internal Changes

    • Updated FluentLanguageLoader to use a thread safe IntlLangMemoizer as per the notes on FluentBundle's concurrency. This was required to solve a compilation error in i18n-embed-fl and may also fix problems for other downstream users who were expecting FluentLanguageLoader to be Send + Sync. It might impact performance for those who are not using this in multi-threaded context, please report this, and in which case support for switching the IntlLangMemoizer added.
    Open source →
  21. 0.11.0 04 Feb 2021
    Release notes

    Documentation

    • Updated/improved examples, including an improvement for how to expose localization from a library using the fluent system, ensuring that the fallback language is loaded by default.
    • Updated examples with new LanguageRequester::add_listener() signature now using std::sync::Arc and std::sync::Weak.

    Breaking Changes

    • Fix for #60 where i18n-embed-fl loads i18n.toml from a different path to fluent_language_loader!(). For subcrates in a workspace previously fluent_language_loader!() and gettext_language_loader!() were searching for i18n.toml in the crate root of the workspace, rather than the current subcrate. This was not the expected behaviour. This fix could be considered a breaking change for libraries that inadvertently relied on that behaviour.
    • For LanguageRequester::add_listener() change the listener type to std::sync::Weak, to better support temporary dependencies that may come from another thread. This should not be a performance bottleneck. This also affects DesktopLanguageRequester and WebLanguageRequester.

    New Features

    • New LanguageRequester::add_listener_ref() method to add permanent listeners of type &dyn Localizer. This also affects DesktopLanguageRequester and WebLanguageRequester.

    Internal Changes

    • Fix clippy warnings.
    • Update i18-embed-impl to version 0.7.0.
    Open source →
  22. 0.10.2 12 Jan 2021
    Release notes
    Open source →
  23. 0.10.1 11 Jan 2021
    Release notes
    • Update references to i18n-embed version in readme and source code examples.
    Open source →
  24. 0.10.0 11 Jan 2021
    Release notes

    Fixes

    Internal Changes

    • Update fluent dependency to version 0.14.
    Open source →
  25. 0.9.4 24 Nov 2020
    Release notes

    New Features

    • Functionality to disable bidirectional isolation in Fluent with FluentLanguageLoader with a new set_use_isolating method #45.

    Internal Changes

    • Remove the now redundant CRLF fix #36.
    Open source →
  26. 0.9.3 23 Oct 2020
    Release notes

    Fixes

    • Updated documentation for select() function.
    Open source →
  27. 0.9.2 22 Oct 2020
    Release notes

    Fixes

    • Remove compiler warning.
    Open source →
  28. 0.9.1 22 Oct 2020
    Release notes

    Fixes

    • Renamed argument in select() method for clarity.
    • Changed logs in select() method to use debug level instead of info level.
    Open source →
  29. 0.9.0 17 Oct 2020
    Release notes
    • Bumped version to reflect potential breaking changes present in the new version of fluent, 0.13 which is exposed in this crate's public API. And yanked previous versions of i18n-embed: 0.8.6 and 0.8.5.
    Open source →
  30. 0.8.6 17 Oct 2020 withdrawn
    Release notes
    • Update documentation and example to more accurately reflect the current state of LanguageRequester::poll() on various systems.
    Open source →
  31. 0.8.5 17 Oct 2020 withdrawn
    Release notes

    New Features

    • Add new get_args_fluent() method to FluentLanguageLoader to allow arguments to be specified using fluent's new FluentArgs type.

    Internal Changes

    • Update fluent to version 0.13.
    • Fixes to address breaking changes in fluent-syntax version 0.10.
    Open source →
  32. 0.8.4 29 Aug 2020
    Release notes

    Bug Fixes

    • A workaround for the fluent issue #191, where CRLF formatted localization files are not always successfully parsed by fluent.
    Open source →
  33. 0.8.3 28 Aug 2020
    Release notes

    New Features

    • Added a new with_message_iter() method to FluentLanguageLoader, to allow iterating over the messages available for a particular language.
    • Added Default implementation for WebLanguageRequester.
    Open source →
  34. 0.8.2 28 Aug 2020
    Release notes
    • Fixed some mistakes in the docs.
    Open source →
  35. 0.8.1 27 Aug 2020
    Release notes
    • Update version reference to i18n-embed in README, and docs.
    Open source →
  36. 0.8.0 27 Aug 2020
    Release notes

    Changes to support the new i18n-embed-fl crate's fl!() macro, and some major cleanup/refactoring/simplification.

    New Features

    • A new I18nAssets trait, to support situations where assets are not embedded.
    • Automatic implementation of the I18nAssets trait for types that implement RustEmbed.
    • A new FileSystemAssets type (which is enabled using the crate feature filesystem-assets), which implements I18nAssets for loading assets at runtime from the file system.
    • Implemented Debug trait on more types.
    • Added new has() and with_fluent_message() methods to FluentLanguageLoader.
    • Made LanguageRequesterImpl available on default crate features. No longer requires gettext-system or fluent-system to be enabled.

    Breaking Changes

    • Removed I18nEmbed trait, and derive macro, it was replaced with the new I18nAssets trait.
    • Clarified the domain and module arguments/variable inputs to FluentLanguageLoader and GettextLanguageLoader, and in the LanguageLoader trait with some renaming.
    • Removed a bunch of unnecessary lifetimes, and 'static bounds on types, methods and arguments.
    • LanguageRequester::current_languages()'s return type now uses String as the HashMap key instead of &'static str.
    • available_languages() implementation moved from I18nEmbed to LanguageLoader.

    Bug Fixes

    • Improved resolution of i18n.toml location in both the gettext_language_loader!() and fluent_language_loader!() macros using find-crate.
    Open source →
  37. 0.7.2 23 Aug 2020
    Release notes
    • Fix broken documentation links when compiling with no features.
    Open source →
  38. 0.7.1 23 Aug 2020
    Release notes
    • Fix broken documentation links.
    Open source →
  39. 0.7.0 23 Aug 2020
    Release notes

    Changes for the support of the fluent localization system.

    New Features

    • Added two new optional crate feature flags gettext-system and fluent-system to enable the new GettextLanguageLoader and FluentLanguageLoader types. See the README and docs for more details.

    Breaking Changes

    • Update to i18n-config version 0.3.0, contains breaking changes to i18n.toml configuration file format. See the i18n changelog for more details.
    • Rename language_loader!() macro to gettext_language_loader!(), and change how it works a little to make it simpler. Most of the functionality has been moved into the new GettextLanguageLoader type. See the docs.
    • gettext-system is no longer included in the default crate features.
    Open source →
  40. 0.6.1 19 Aug 2020
    Release notes

    Bug Fixes

    • Only re-export optional dependencies when they're actually enabled in the crate features (#26 thanks to @jplatte.)
    Open source →
  41. 0.6.0 20 May 2020
    Release notes
    • Changed the argument for LanguageRequester::add_listener() to use a std::rc::Weak instead of std::rc::Rc to make it more obvious that it is the caller's responsibility to hold on to the Rc in order to maintain the reference.
    • Fixed typo in LanguageRequester::set_language_override().
    Open source →
  42. 0.5.0 16 May 2020
    Release notes
    • Refactored I18nEmbedError::Multiple(Box<Vec<I18nEmbedError>>) to I18nEmbedError::Multiple(Vec<I18nEmbedError>), removing the useless box (and complaining Clippy lint).
    • Refactored select() method to use slice argument instead of &Vec<LanguageIdentifier>.
    • Changed LanguageRequester::add_listener(&mut self, localizer: &Rc<Box<dyn Localizer<'a>>>) to add_listener(&mut self, localizer: &Rc<dyn Localizer<'a>>) removing the unnecessary Box.
    • Added Default implementation for DesktopLanguageRequester.
    Open source →
  43. 0.4.2 10 May 2020
    Release notes
    • Update fluent-langneg dependency to version 0.13.
    • Update unic-langid dependency to version 0.9.
    • Fix incorrect comment in code example #18.
    Open source →
  44. 0.4.1 03 May 2020

    Nothing published for this version

  45. 0.4.0 20 Apr 2020
    Release notes

    Mostly a refactor of LanguageLoader and I18nAssets to solve issue #15.

    • Replaced the derive macro for LanguageLoader with a new language_loader!(StructName) which creates a new struct with the specified StructName and implements LanguageLoader for it. This was done because LanguageLoader now needs to store state for the currently selected language, and deriving this automatically would be complicated.
    • Refactored I18nAssets to move the load_language_file responsibility into LanguageLoader and add a new load_language method to LanguageLoader.
    • Refactored I18nAssetsDyn to also expose the RustEmbed#get() method, required for the new LanguageLoader changes.
    • Using LanguageLoader as a static now requires lazy_static or something similar because the StructName#new() constructor which is created for it in language_loader!(StructName) is not const.
    Open source →
  46. 0.3.3 16 Apr 2020
    Release notes
    • Updated link to this changelog in the crate README.
    Open source →
  47. 0.3.2 16 Apr 2020
    Release notes
    • Bump i18n-config dependency in i18n-embed-impl version to 0.2.
    Open source →
  48. 0.3.1 10 Apr 2020

    Nothing published for this version

  49. 0.3.0 10 Apr 2020

    Nothing published for this version

  50. 0.2.0 07 Apr 2020

    Nothing published for this version

  51. 0.1.2 07 Apr 2020

    Nothing published for this version

  52. 0.1.1 07 Apr 2020

    Nothing published for this version

  53. 0.1.0 07 Apr 2020

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive