Skip to main content

klirr_core/models/l18n/
content.rs

1use crate::prelude::*;
2
3/// The content of the localization file, which includes
4/// client information, invoice information, vendor information,
5/// and line items.
6#[derive(Debug, Clone, Serialize, Deserialize, Getters, Builder)]
7pub struct L18nContent {
8    #[getset(get = "pub")]
9    client_info: L18nClientInfo,
10
11    #[getset(get = "pub")]
12    invoice_info: L18nInvoiceInfo,
13
14    #[getset(get = "pub")]
15    vendor_info: L18nVendorInfo,
16
17    #[getset(get = "pub")]
18    line_items: L18nLineItems,
19
20    #[getset(get = "pub")]
21    month_names: [String; 12],
22}
23impl ToTypst for L18nContent {}
24impl L18nContent {
25    pub fn english() -> Self {
26        Self::builder()
27            .client_info(L18nClientInfo::english())
28            .invoice_info(L18nInvoiceInfo::english())
29            .vendor_info(L18nVendorInfo::english())
30            .line_items(L18nLineItems::english())
31            .month_names([
32                "January".to_string(),
33                "February".to_string(),
34                "March".to_string(),
35                "April".to_string(),
36                "May".to_string(),
37                "June".to_string(),
38                "July".to_string(),
39                "August".to_string(),
40                "September".to_string(),
41                "October".to_string(),
42                "November".to_string(),
43                "December".to_string(),
44            ])
45            .build()
46    }
47}