pub mod errors;
#[cfg(feature = "translator-fluent")]
mod fluent;
#[cfg(feature = "translator-fluent")]
pub use fluent::{FluentTranslator, FLUENT_TRANSLATOR_FILE_EXT};
#[cfg(feature = "translator-lightweight")]
mod lightweight;
#[cfg(feature = "translator-lightweight")]
pub use lightweight::{LightweightTranslator, LIGHTWEIGHT_TRANSLATOR_FILE_EXT};
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
mod dummy;
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
pub use dummy::{DummyTranslator, DUMMY_TRANSLATOR_FILE_EXT};
#[cfg(feature = "translator-fluent")]
pub use FluentTranslator as Translator;
#[cfg(feature = "translator-fluent")]
pub use FLUENT_TRANSLATOR_FILE_EXT as TRANSLATOR_FILE_EXT;
#[cfg(feature = "translator-lightweight")]
pub use LightweightTranslator as Translator;
#[cfg(feature = "translator-lightweight")]
pub use LIGHTWEIGHT_TRANSLATOR_FILE_EXT as TRANSLATOR_FILE_EXT;
#[cfg(feature = "translator-fluent")]
#[doc(hidden)]
pub use fluent::link_macro_backend;
#[cfg(feature = "translator-fluent")]
#[doc(hidden)]
pub use fluent::t_macro_backend;
#[cfg(feature = "translator-fluent")]
#[doc(hidden)]
pub use fluent::t_macro_backend_with_args;
#[cfg(feature = "translator-fluent")]
pub use fluent::TranslationArgs;
#[cfg(feature = "translator-lightweight")]
#[doc(hidden)]
pub use lightweight::link_macro_backend;
#[cfg(feature = "translator-lightweight")]
#[doc(hidden)]
pub use lightweight::t_macro_backend;
#[cfg(feature = "translator-lightweight")]
#[doc(hidden)]
pub use lightweight::t_macro_backend_with_args;
#[cfg(feature = "translator-lightweight")]
pub use lightweight::TranslationArgs;
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
#[doc(hidden)]
pub use dummy::link_macro_backend;
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
#[doc(hidden)]
pub use dummy::t_macro_backend;
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
#[doc(hidden)]
pub use dummy::t_macro_backend_with_args;
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
pub use dummy::TranslationArgs;
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
pub use DummyTranslator as Translator;
#[cfg(all(
not(feature = "translator-fluent"),
not(feature = "translator-lightweight")
))]
pub use DUMMY_TRANSLATOR_FILE_EXT as TRANSLATOR_FILE_EXT;
#[macro_export]
macro_rules! t {
($cx:expr, $id:expr) => {
$crate::i18n::t_macro_backend($id, $cx)
};
($cx:expr, $id:expr, {
$($key:literal = $value:expr),+
}) => {{
let mut args = $crate::i18n::TranslationArgs::new();
$(
args.set($key, $value);
)+
$crate::i18n::t_macro_backend_with_args($id, args, $cx)
}};
}
#[macro_export]
macro_rules! link {
($cx:expr, $url:expr) => {
$crate::i18n::link_macro_backend($url, $cx)
};
}