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
//! watchword's messages as a [phrasebook-catalog] 0.1 catalog, [`L10N`].
//!
//! This is the text of watchword's Yew components, kept here so a tool that
//! only needs the messages, such as an app's localization checker, takes them
//! without building a frontend. It needs neither `std` nor `alloc`.
//! watchword-yew023 re-exports [`L10N`], and [phrasebook] 0.2 takes it as one
//! of its catalogs.
//!
//! [phrasebook-catalog]: https://docs.rs/phrasebook-catalog
//! [phrasebook]: https://docs.rs/phrasebook
use ;
/// watchword's messages, in English, with every id under the `watchword-`
/// prefix.
///
/// watchword's components look their text up in the `Phrases` the app
/// provides with `ContextProvider<Phrases>`, and fall back to these messages
/// for any id the app's phrasebook lacks, or when nothing is provided. An app
/// that translates watchword adds the `watchword-*` ids of
/// [`locales/en-US.ftl`][ftl] to its own catalog for each language, and adds
/// this catalog after its own, so its translations win:
///
/// ```ignore
/// use phrasebook::{Catalog, Lang, Phrasebook, Source};
///
/// const SV_SE: Lang = Lang::new("sv-SE");
///
/// static APP: Catalog = Catalog::new("app", &[
/// Source::new(Lang::EN_US, include_str!("../locales/en-US.ftl")),
/// Source::new(SV_SE, include_str!("../locales/sv-SE.ftl")),
/// ]);
///
/// let book = Phrasebook::builder()
/// .language(Lang::EN_US, "English")
/// .language(SV_SE, "Svenska")
/// .catalog(&APP)
/// .catalog(&watchword::phrasebookcatalog01::L10N)
/// .build();
/// ```
///
/// A tool that checks an app's `.ftl` against the libraries it takes lists
/// these ids with `phrasebook::check::ids(&L10N, lang)` for each of
/// `L10N.languages()`.
///
/// [ftl]: https://github.com/udoprog/watchword/blob/main/crates/watchword-core/locales/en-US.ftl
pub static L10N: Catalog = new
.with_prefix;