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 2025Releases
latest 53-
0.16.009 Jul 2025Release notes
Open source →Fixes
- #13 Replace abandoned
locale_configdependency withsys-locale. Fixes #63 Cannot parse locale on Macos. Big thanks to @TristanDebrunner for this contribution!- When the
gettext-systemfeature is enabled,locale_configis not entirely eliminated from the dependency tree as gettext-rs depends on it.
- When the
Dependencies
- Bump
fluentto 0.17 andfluent-syntaxto0.12.- Considering this is such a central dependency, I've decided to treat this as a breaking change.
Documentation
- Fixed some typos. Thanks to @YgorSouza.
- #13 Replace abandoned
-
0.15.414 Apr 2025Release notes
Open source →New Features
- Add
FluentLanguageLoader::with_fluent_message_and_bundle(). This method functions likewith_fluent_message(), but it also returns theFluentBundlewhich owns the message. As part of implementation of #144. Many thanks to @cbs228 for this contribution.
Internal
- Bump version of
notifydependency to version8.0.0.
- Add
-
0.15.306 Jan 2025 -
0.15.223 Oct 2024 -
0.15.123 Oct 2024 withdrawnRelease notes
Open source →Fixes
- Fix for #97 Error when using workspace defined package metadata. Contributed by @Umio-Yasuno.
Internal
- Use workspace dependency for
i18n-embed-implcrate.
-
0.15.008 Aug 2024Release notes
Open source →New Features
- New
autoreloadcrate feature.RustEmbedNotifyAssets- A wrapper forrust_embed::RustEmbedthat 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
I18nAssetstrait.- 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 uselang(...).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 useselect_languages(...)instead.
- Extra bounds on the arguments for
DefaultLocalizer::new()(Send + Sync + 'static) to allow it to be used withautoreloadfeature. 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
- New
-
0.14.127 Sep 2023Nothing published for this version
-
0.14.010 Sep 2023 -
0.13.916 May 2023Nothing published for this version
-
0.13.814 Jan 2023Release notes
Open source →Internal
- Made
arc-swapan optional dependency, it's only required forfluent-systemimplementation.
- Made
-
0.13.714 Jan 2023Release notes
Open source →New Features
- A new
LanguageLoader::load_available_languages()method to load all available languages. - A new
FluentLanguageLoader::select_languages()method (renamedFluentLanguageLoader::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 renamedFluentLanguageLoader::select_languages().
- A new
-
0.13.614 Jan 2023Release notes
Open source →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 ofFluentLanguageLoader::lang().
- A single new method called
-
0.13.509 Jan 2023Release notes
Open source →New Features
- Support fluent attributes #98 thanks to @Almost-Senseless-Coder!
- New methods on
FluentLanguageLoader: get_attrget_attr_args_concreteget_attr_args_fluentget_attr_argsget_lang_attrget_lang_attr_args_concreteget_lang_attr_args_fluentget_lang_attr_args
- New methods on
Internal
- Bump
env_loggerdev dependency to version0.10. - Fix clippy warnings.
- Support fluent attributes #98 thanks to @Almost-Senseless-Coder!
-
0.13.423 Feb 2022Release notes
Open source →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.
- Implement
-
0.13.310 Feb 2022 -
0.13.210 Feb 2022Release notes
Open source →Internal
- Use conditional compilation correctly for doctests.
- Update
parking_lotto version0.12.
-
0.13.112 Dec 2021Release notes
Open source →New Features
- New
FluentLanguageLoader::with_bundles_mut()method to allow mutable access to bundles.
Internal Changes
- Bumped
pretty_assertionsversion1.0. - Fixed clippy lints.
- New
-
0.13.026 Aug 2021Release notes
Open source →Breaking Changes
- Update
rust-embedto version6. - Update
fluentto version0.16.
- Update
-
0.12.106 Jun 2021Release notes
Open source →Documentation
- Updated crate description.
- Don't reference specific
i18n-embedversion number.
-
0.12.018 Mar 2021Release notes
Open source →Documentation
- Added
binexample which explains how to consume thelib-fluentexample library in a desktop CLI application.
Breaking Changes
- Updated
fluentto version0.15.
Internal Changes
- Updated
FluentLanguageLoaderto use a thread safe IntlLangMemoizer as per the notes on FluentBundle's concurrency. This was required to solve a compilation error ini18n-embed-fland may also fix problems for other downstream users who were expectingFluentLanguageLoaderto beSend + 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 theIntlLangMemoizeradded.
- Added
-
0.11.004 Feb 2021Release notes
Open source →Documentation
- Updated/improved examples, including an improvement for how to expose localization from a library using the
fluentsystem, ensuring that the fallback language is loaded by default. - Updated examples with new
LanguageRequester::add_listener()signature now usingstd::sync::Arcandstd::sync::Weak.
Breaking Changes
- Fix for #60 where
i18n-embed-flloadsi18n.tomlfrom a different path tofluent_language_loader!(). For subcrates in a workspace previouslyfluent_language_loader!()andgettext_language_loader!()were searching fori18n.tomlin 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 thelistenertype tostd::sync::Weak, to better support temporary dependencies that may come from another thread. This should not be a performance bottleneck. This also affectsDesktopLanguageRequesterandWebLanguageRequester.
New Features
- New
LanguageRequester::add_listener_ref()method to add permanent listeners of type&dyn Localizer. This also affectsDesktopLanguageRequesterandWebLanguageRequester.
Internal Changes
- Fix clippy warnings.
- Update
i18-embed-implto version0.7.0.
- Updated/improved examples, including an improvement for how to expose localization from a library using the
-
0.10.212 Jan 2021Release notes
Open source →- Add workaround for #57 for until https://github.com/projectfluent/fluent-rs/issues/213 is solved.
-
0.10.111 Jan 2021Release notes
Open source →- Update references to
i18n-embedversion in readme and source code examples.
- Update references to
-
0.10.011 Jan 2021Release notes
Open source →Fixes
- More gracefully handle the situation on Linux where LANG environment variable is not set due to rust-locale/locale_config#6. Fixes #49.
Internal Changes
- Update
fluentdependency to version0.14.
-
0.9.424 Nov 2020Release notes
Open source →New Features
- Functionality to disable bidirectional isolation in Fluent with
FluentLanguageLoaderwith a newset_use_isolatingmethod #45.
Internal Changes
- Remove the now redundant CRLF fix #36.
- Functionality to disable bidirectional isolation in Fluent with
-
0.9.323 Oct 2020 -
0.9.222 Oct 2020 -
0.9.122 Oct 2020Release notes
Open source →Fixes
- Renamed argument in
select()method for clarity. - Changed logs in
select()method to usedebuglevel instead ofinfolevel.
- Renamed argument in
-
0.9.017 Oct 2020Release notes
Open source →- Bumped version to reflect potential breaking changes present in the new version of
fluent,0.13which is exposed in this crate's public API. And yanked previous versions ofi18n-embed:0.8.6and0.8.5.
- Bumped version to reflect potential breaking changes present in the new version of
-
0.8.617 Oct 2020 withdrawnRelease notes
Open source →- Update documentation and example to more accurately reflect the current state of
LanguageRequester::poll()on various systems.
- Update documentation and example to more accurately reflect the current state of
-
0.8.517 Oct 2020 withdrawnRelease notes
Open source →New Features
- Add new
get_args_fluent()method toFluentLanguageLoaderto allow arguments to be specified usingfluent's newFluentArgstype.
Internal Changes
- Update
fluentto version0.13. - Fixes to address breaking changes in
fluent-syntaxversion0.10.
- Add new
-
0.8.429 Aug 2020Release notes
Open source →Bug Fixes
- A workaround for the fluent issue #191, where CRLF formatted localization files are not always successfully parsed by fluent.
-
0.8.328 Aug 2020Release notes
Open source →New Features
- Added a new
with_message_iter()method toFluentLanguageLoader, to allow iterating over the messages available for a particular language. - Added
Defaultimplementation forWebLanguageRequester.
- Added a new
-
0.8.228 Aug 2020 -
0.8.127 Aug 2020 -
0.8.027 Aug 2020Release notes
Open source →Changes to support the new
i18n-embed-flcrate'sfl!()macro, and some major cleanup/refactoring/simplification.New Features
- A new
I18nAssetstrait, to support situations where assets are not embedded. - Automatic implementation of the
I18nAssetstrait for types that implementRustEmbed. - A new
FileSystemAssetstype (which is enabled using the crate featurefilesystem-assets), which implementsI18nAssetsfor loading assets at runtime from the file system. - Implemented
Debugtrait on more types. - Added new
has()andwith_fluent_message()methods toFluentLanguageLoader. - Made
LanguageRequesterImplavailable on default crate features. No longer requiresgettext-systemorfluent-systemto be enabled.
Breaking Changes
- Removed
I18nEmbedtrait, and derive macro, it was replaced with the newI18nAssetstrait. - Clarified the
domainandmodulearguments/variable inputs toFluentLanguageLoaderandGettextLanguageLoader, and in theLanguageLoadertrait with some renaming. - Removed a bunch of unnecessary lifetimes, and
'staticbounds on types, methods and arguments. LanguageRequester::current_languages()'s return type now usesStringas theHashMapkey instead of&'static str.available_languages()implementation moved fromI18nEmbedtoLanguageLoader.
Bug Fixes
- Improved resolution of
i18n.tomllocation in both thegettext_language_loader!()andfluent_language_loader!()macros using find-crate.
- A new
-
0.7.223 Aug 2020 -
0.7.123 Aug 2020 -
0.7.023 Aug 2020Release notes
Open source →Changes for the support of the
fluentlocalization system.New Features
- Added two new optional crate feature flags
gettext-systemandfluent-systemto enable the newGettextLanguageLoaderandFluentLanguageLoadertypes. See the README and docs for more details.
Breaking Changes
- Update to
i18n-configversion0.3.0, contains breaking changes toi18n.tomlconfiguration file format. See the i18n changelog for more details. - Rename
language_loader!()macro togettext_language_loader!(), and change how it works a little to make it simpler. Most of the functionality has been moved into the newGettextLanguageLoadertype. See the docs. gettext-systemis no longer included in the default crate features.
- Added two new optional crate feature flags
-
0.6.119 Aug 2020Release notes
Open source →Bug Fixes
- Only re-export optional dependencies when they're actually enabled in the crate features (#26 thanks to @jplatte.)
-
0.6.020 May 2020Release notes
Open source →- Changed the argument for
LanguageRequester::add_listener()to use astd::rc::Weakinstead ofstd::rc::Rcto make it more obvious that it is the caller's responsibility to hold on to theRcin order to maintain the reference. - Fixed typo in
LanguageRequester::set_language_override().
- Changed the argument for
-
0.5.016 May 2020Release notes
Open source →- Refactored
I18nEmbedError::Multiple(Box<Vec<I18nEmbedError>>)toI18nEmbedError::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>>>)toadd_listener(&mut self, localizer: &Rc<dyn Localizer<'a>>)removing the unnecessaryBox. - Added
Defaultimplementation forDesktopLanguageRequester.
- Refactored
-
0.4.210 May 2020Release notes
Open source →- Update
fluent-langnegdependency to version0.13. - Update
unic-langiddependency to version0.9. - Fix incorrect comment in code example #18.
- Update
-
0.4.103 May 2020Nothing published for this version
-
0.4.020 Apr 2020Release notes
Open source →Mostly a refactor of
LanguageLoaderandI18nAssetsto solve issue #15.- Replaced the derive macro for
LanguageLoaderwith a newlanguage_loader!(StructName)which creates a new struct with the specifiedStructNameand implementsLanguageLoaderfor it. This was done becauseLanguageLoadernow needs to store state for the currently selected language, and deriving this automatically would be complicated. - Refactored
I18nAssetsto move theload_language_fileresponsibility intoLanguageLoaderand add a newload_languagemethod toLanguageLoader. - Refactored
I18nAssetsDynto also expose theRustEmbed#get()method, required for the newLanguageLoaderchanges. - Using
LanguageLoaderas a static now requires lazy_static or something similar because theStructName#new()constructor which is created for it inlanguage_loader!(StructName)is notconst.
- Replaced the derive macro for
-
0.3.316 Apr 2020 -
0.3.216 Apr 2020 -
0.3.110 Apr 2020Nothing published for this version
-
0.3.010 Apr 2020Nothing published for this version
-
0.2.007 Apr 2020Nothing published for this version
-
0.1.207 Apr 2020Nothing published for this version
-
0.1.107 Apr 2020Nothing published for this version
-
0.1.007 Apr 2020Nothing published for this version