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
/// translate! 宏定义
///
/// 语法:$field:ident: $en:literal => $zh:literal
///
/// 展开:
/// - pub struct Translations { pub $field: &'static str, ... }
/// - pub const EN: Translations { ... }
/// - pub const ZH: Translations { ... }
///
/// ⚠️ $crate 路径卫生:若此宏被外部 crate 导入,
/// 需将展开中的 Translations 改为 $crate::Translations,
/// 将 EN/ZH 改为 $crate::EN / $crate::ZH。
pub const EN: Translations = Translations ;
pub const ZH: Translations = Translations ;
/// Auto-generated array of all (field_name, en_value, zh_value) tuples.
/// Used by compile-time cross-validation tests to iterate fields without
/// manual enumeration.
///
/// Each entry: `(field_name_as_str, en_literal, zh_literal)`.
/// Field attributes (e.g. `#[cfg(...)]`) are NOT replicated here — this
/// array only mirrors the field list as written in the `translate!` call.
pub const ALL_TRANSLATION_FIELDS: & = &;
}
}