icu_locale_core/preferences/extensions/unicode/keywords/hour_cycle.rs
1// This file is part of ICU4X. For terms of use, please see the file
2// called LICENSE at the top level of the ICU4X source tree
3// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5use crate::preferences::extensions::unicode::enum_keyword;
6
7enum_keyword!(
8 /// A Unicode Hour Cycle Identifier defines the preferred time cycle. Specifying "hc" in a locale identifier overrides the default value specified by supplemental time data for the region.
9 ///
10 /// The valid values are listed in [LDML](https://unicode.org/reports/tr35/#UnicodeHourCycleIdentifier).
11 HourCycle {
12 /// The 12-hour clock used in much of the world. Hours are numbered 1–12.
13 ///
14 /// Corresponds to 'h' in UTS #35 pattern strings.
15 ("h12" => H12),
16 /// The 24-hour clock. Hour are numbered 0–23.
17 ///
18 /// Corresponds to 'H' in UTS #35 pattern strings.
19 ("h23" => H23),
20 /// Variant of the 12-hour clock, sometimes used in Japan. Hours are numbered 0–11.
21 ///
22 /// Corresponds to 'K' in UTS #35 pattern strings.
23 ("h11" => H11),
24 /// The 12-hour clock automatically selected based on the locale. Hours are numbered
25 /// 1-12, 0-11, or another 12-hour clock based on locale data.
26 ///
27 /// Corresponds to 'j' in UTS #35 skeleton strings,
28 /// except it can resolve to only `h` or `K`.
29 ("c12" => Clock12),
30 /// The 24-hour clock automatically selected based on the locale. Hours are numbered
31 /// 0-23 or another 24-hour clock based on locale data.
32 ///
33 /// Corresponds to 'j' in UTS #35 skeleton strings,
34 /// except it can resolve to only `H`.
35 ("c24" => Clock24),
36}, "hc");