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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
use *;
/// Returns the BCP-47 tag for the locale that owns `route`.
///
/// The tag is matched against the locale's own display label, which
/// `build.rs` already emits from the content repository's
/// `[[locales]]` frontmatter. That is deliberate: the crate has no
/// second copy of which prefix means which language, and inventing one
/// here is how a route ends up rendering Korean text in the Japanese
/// shell. A locale whose label is not one of the four known ones falls
/// back to [`LOCALE_TAG_DEFAULT`], because the English table is the
/// complete one and a missing tag must never leave the gate blank.
///
/// The label lives on the site's language list rather than on
/// `DocsLocale`: per-locale bundling serves each language from its own
/// directory, so the switcher is the one place that carries every
/// label a bundle can be reached by.
///
/// # Arguments
///
/// - `&str` - The page route path.
///
/// # Returns
///
/// - `&'static str` - The locale tag for the route's locale.
/// Translates `key` in the locale that owns `route`.
///
/// Resolution walks the active locale's table and then the English one,
/// so a key missing from a locale degrades to readable English rather
/// than to the raw key or an empty string — the gate never shows a blank
/// label. A key present in neither table returns `key` itself, which
/// makes an unregistered key visible in the UI instead of silently
/// invisible.
///
/// # Arguments
///
/// - `&str` - The page route path, whose locale selects the table.
/// - `&str` - The translation key.
///
/// # Returns
///
/// - `String` - The translated message, or `key` when no table has it.
/// Returns the message registered for `key` under `tag`, if any.
///
/// # Arguments
///
/// - `&str` - The locale tag to read.
/// - `&str` - The translation key to read.
///
/// # Returns
///
/// - `Option<String>` - The message, or `None` when the tag or the key
/// is not registered.
/// Returns the translation table registered under `tag`.
///
/// # Arguments
///
/// - `&str` - The locale tag to read.
///
/// # Returns
///
/// - `&'static [(&'static str, &'static str)]` - The table, empty when
/// the tag is not one of the four supported locales.
/// Returns every locale tag the gate carries a table for.
///
/// # Returns
///
/// - `&'static [&'static str]` - The supported locale tags, in the
/// order the tables are declared.
/// Returns every translation key the password gate registers.
///
/// Exposed as a function rather than as a `pub const` because the key
/// list is exactly the thing a completeness test needs to enumerate,
/// and a function is the visibility the project allows an external
/// reader to reach for.
///
/// # Returns
///
/// - `&'static [&'static str]` - Every key, in table order.
/// Returns the translation key for the locked-page explanation.
///
/// # Returns
///
/// - `&'static str` - The key the hint is registered under.
/// Returns the tag the fallback translation table is registered under.
///
/// The fallback is English: it is the only table guaranteed to carry
/// every key, so it is what a partially translated locale degrades to.
///
/// # Returns
///
/// - `&'static str` - The fallback locale tag.
/// Returns every locale tag bound to a content-repository label.
///
/// # Returns
///
/// - `&'static [(&'static str, &'static str)]` - `(label, tag)` pairs.