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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//! `mf2-locale-data` — the locale data mf2-two catalogs carry, build side
//! only: never linked into a client.
//!
//! The crate ships its data, derived from Unicode CLDR, in `data/`: a build
//! downloads nothing. From CLDR's JSON:
//!
//! * **plural** rules and each locale's **text direction**: the UTS #35 rule parser, the canonical encoder
//! of the `plural.cardinal` / `plural.ordinal` entries; the CLDR
//! `@integer`/`@decimal` samples of every locale are tests of the client
//! evaluator;
//! * **numbers**, from every locale's `numbers.json`: symbols, grouping, numbering systems and
//! their digits, the percent and currency patterns, deduplicated against
//! CLDR's parent locales (`data/numbers.txt`), and the `number.symbols` /
//! `number.patterns` entries built from them (`number`);
//! * **currencies and units**, from every locale's `currencies.json` and
//! `units.json`
//! (`data/currencies.txt`, `data/units.txt`, deduplicated against the
//! parents and CLDR's fallbacks), and the `currency.data` / `unit.data`
//! entries for the configured sets (`currency`, `unit`).
//!
//! A corpus's needs — which entries, which currencies and units — are
//! `LocaleNeeds` / `NumberNeeds` (`NumberNeeds::add_message` reads them
//! off the data model); `locale_entries` writes the entries.
//!
//! # What 1.x promises here
//!
//! `mf2-build` and `mf2`'s `compile` feature use this crate; an application
//! never names it. Its tables and entry builders are the catalog's layout,
//! which 1.x does not promise (`docs/versioning.md`), so they are hidden
//! from the documentation. What is promised: the errors a build can return
//! from here ([`Error`], [`ParseError`]), the CLDR release the data comes
//! from ([`CLDR_VERSION`]) and a locale's text [`direction`].
//!
//! # The user guide
//!
//! Getting started, call sites, delivery modes, switching language,
//! accessibility, migrating from `leptos-fluent`, and what 1.x promises
//! (`versioning.md`): the user guide is the `docs/` directory of the
//! mf2-two repository. An application reaches this crate through `mf2-build`
//! and [`mf2`](https://docs.rs/mf2)'s `compile` feature.
// docs.rs (`cargo xtask docs-rs`): each feature-gated item says which features it needs.
pub use CurrencyData;
pub use direction;
pub use ;
pub use CldrVersion;
pub use ;
pub use ;
pub use ;
/// The CLDR release the shipped data comes from (`third_party/cldr-json/PIN`).
pub const CLDR_VERSION: CldrVersion = CldrVersion ;
/// Everything a corpus needs of its locale's data: plural rules of each
/// kind it selects on, and number data ([`NumberNeeds`]). The slicing rule
/// is `plans/02-catalog-format.md` §4.4. Build one with `default()` and set
/// fields.
/// The LOCALE entries a catalog for `locale` carries under `needs`, sorted by
/// key, as `mf2_catalog::writer::Options::locale_entries` takes them;
/// `plural.cardinal` also when units or currency names need it.