I'm trying to export a macro that wraps another crates macro, but at the usage site I get the error that the other crate's dependency is undeclared.
Macro export:
#[macro_export]
macro_rules! fl {
($message_id:literal) => {{
i18n_embed_fl::fl!($crate::get_language_loader(), $message_id)
}};
($message_id:literal, $($args:expr),*) => {{
i18n_embed_fl::fl!($crate::get_language_loader(), $message_id, $($args), *)
}};
}
Usage site in another crate:
window.set_title(&fl!("hello-world"));
Error:
error[E0433]: failed to resolve: use of undeclared crate or module `i18n_embed_fl`
--> nih\src\main.rs:28:27
|
28 | window.set_title(&fl!("hello-world")); // todo: this should not be config but language i18n file.
| ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `i18n_embed_fl`
|
= note: this error originates in the macro `fl` (in Nightly builds, run with -Z macro-backtrace for more info)
How can I export this macro without needing to explicitly add the i18n_embed_fl
crate and use it within each crate I want to use the fl
macro?