Outdated example used mostly as a testing ground for various functionality, was seeing very high churn as new features were added. This will be replaced by cli_macros/tests
OIH7UWAWAWOQHP3N6WTL7K2QY46F4HUMFGBACIXZUIR77P2FXOXAC
HJMYJDC77NLU44QZWIW7CELXJKD4EK4YZ6CCILYBG6FWGZ2KMBVAC
O77KA6C4UJGZXVGPEA7WCRQH6XYQJPWETSPDXI3VOKOSRQND7JEQC
XGNME3WRU3MJDTFHUFJYARLVXWBZIH5ODBOIIFTXHNCBTZQH2R7QC
K4XW4OBW5VWRCQZJNVV624E25SKRJPZ5WUXWVYHP6U7T7NPJFMFQC
3C3CHSY5FETUIE7W2VQ5V62GJNE3MW2WUM7GJDUFWSDB4WKNFR2AC
NFHPBRB5AUJGWAN7UMUDUNFDGDOCKVUKC3AAPDTND7C7MJYISVVQC
BMUMO42ICN3GQW77KUE2GTJPOA77SFDXJ4NNDO5NA2VJS267OXZAC
UOMQT7LTURIIWHZT2ZHLCJG6XESYTN26EJC7IHRFR4PYJ355PNYAC
4XADHKM66YB7R2AWXJAYR3N7CG3EM323S5WVTJWUDILZS3TAMYRAC
56F2YE6HUZ76U4QBPUDJ2VQLJ75TQYNTVQIOX4QBOZ2H6GJKRGUQC
use fluent_embed::{derive_enum, Group};
use syn::parse_quote;
fn main() {
let resource = fluent_syntax::parser::parse(ftl).unwrap();
let source: syn::DeriveInput = parse_quote! {
enum Test {
Emails { unread_emails: u64 }
}
};
let data = match source.data {
syn::Data::Enum(enum_data) => enum_data,
_ => todo!(),
};
let file_contents = derive_enum(group, source.ident, data);
let mock_file = syn::parse_file(file_contents.to_string().as_str()).unwrap();
let formatted = prettyplease::unparse(&mock_file);
println!("{formatted}");
}
let group = Group::from_resource(resource);
{ $unreadEmails ->
[one] You have one unread email.
*[other] You have { $unreadEmails } unread emails.
}"#,
);
let ftl = String::from(
r#"emails =