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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! The messages the window draws, in the language the desktop asks for.
//!
//! `potext::catalog!` declares the catalogue and its lookups **in this crate**,
//! which is the point of it being a macro: a single global inside `potext` would
//! be one catalogue shared by everything linked against it.
//!
//! Every string a person reads in any of the three applications is here rather
//! than in the application crates, which is why there is one catalogue for the
//! suite and not four. An application contributes its own name, and a name is
//! not translated.
//
// Author: David M. Anderson
// Built with AI assistance (Claude, Anthropic)
pub use fill;
catalog!;
/// Every language the suite ships, as a tag and that language's catalogue.
///
/// A translation is added by putting its `.po` beside the others and naming it
/// here. German was written against Comma's glossary, so the fleet says *Datei*,
/// *Öffnen …* and *OpenDocument-Tabellendokument* the same way in every window.
///
/// The catalogues live inside this crate because `include_str!` reaching above a
/// crate root compiles locally and fails in `cargo package`, which copies only
/// what is under the crate directory: the tarball would carry no catalogue and
/// the publish would die verifying a build that cannot compile. flyleaf lost a
/// release tag to exactly that. `cargo package -p odox-ui --list` is the check.
pub const LANGUAGES: & = &;
/// The same, plus the pseudolocale, which a release does not carry.
///
/// `en-x-pseudo` translates nothing and changes everything: every message comes
/// back accented, bracketed and 40% longer. Running a window in it shows a
/// string that never went through [`t`], a sentence the catalogue never saw, and
/// a label built to the width of English — the last being what German will hit,
/// found without anybody reading German. `po/pseudo.sh` writes it and says the
/// rest.
///
/// ```text
/// POTEXT_LANG=en-x-pseudo cargo run -p xods -- corpus/libreoffice/calc.ods
/// ```
pub const LANGUAGES: & = &;
/// Mark a message for translation without looking it up here.
///
/// gettext's `N_`, which exists for the case this suite has: a message that has
/// to be a literal somewhere the catalogue is not yet in force — a `const`, or a
/// `Product` built before `run` activates one — and is looked up through [`t`]
/// where it is finally shown. Without a marker the extractor never sees the
/// string and the catalogue never carries it; `po/update-po.sh` names this
/// function as a keyword alongside `t`.
pub const
/// Read the desktop's language and put a catalogue in force, once, at startup.