rust_i18n_derive/lib.rs
1/// A derive macro to automatically implement localization methods for enums.
2///
3/// # Example
4/// ```rust
5/// use rust_i18n_derive::Localized;
6///
7/// #[derive(Localized)]
8/// enum Message {
9/// #[tag("msg.hello")]
10/// Hello,
11/// }
12///
13pub use rust_i18n_derive_impl::Localized;
14
15pub trait Localized {
16 fn key(&self) -> &'static str;
17 fn localize(&self) -> std::borrow::Cow<'static, str>;
18}