1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#[macro_export]
macro_rules! zclass {
    ($($each:expr),*) => {
        {
            let mut vec_class:Vec<String> = Vec::new();
            $(
                vec_class.push($each.to_string());
            )*
            XZClass::from(vec_class)
        }
    };
}

#[macro_export]
macro_rules! zcs {
    ($($each:expr),*) => {
        {
            let mut vec_class:Vec<String> = Vec::new();
            $(
                vec_class.push($each.to_string());
            )*
            vec_class.join(" ")
        }
    };
}

// 格式化成string
#[macro_export]
macro_rules! zs {
    ($a:expr) => {
        $a.to_string()
    };
}

#[macro_export]
macro_rules! zab {
    ($a:expr,$bool:expr) => {
        if $bool {
            $a.to_string()
        } else {
            "".to_string()
        }
    };

    ($a:expr,$bool:expr,$b:expr) => {
        if $bool {
            $a.to_string()
        } else {
            $b.to_string()
        }
    };
}


#[macro_export]
macro_rules! zi18n {
    ($zshare:expr,$key:expr) => {
        ($zshare.read().word.get($key).unwrap_or(&("".to_string()))).as_str()
    };
}