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
// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
//! Display names for languages and regions.
//!
//! There are currently two designs for how to use this component:
//!
//! 1. [`multi`]: Load multiple display names at once.
//! 2. [`single`]: Load a single display name at a time.
//!
//! There are multiple use cases for this component, so we are not yet committed
//! to either of these designs being the "primary" design. Please share feedback at
//! <https://github.com/unicode-org/icu4x/issues/7824>.
//!
//! Note: Currently, the data between the two modules is NOT being shared.
//!
//! ## Examples
//!
//! The [`multi`] module lets you load multiple names at once, whereas [`single`]
//! loads one name at a time.
//!
//! ```
//! use icu::experimental::displaynames::multi::RegionDisplayNames;
//! use icu::experimental::displaynames::single::RegionDisplayName;
//! use icu::experimental::displaynames::DisplayNamesOptions;
//! use icu::locale::{locale, subtags::region};
//! use writeable::assert_writeable_eq;
//!
//! let locale = locale!("en").into();
//!
//! // Multi: Load a formatter that can display many regions.
//! let multi = RegionDisplayNames::try_new(locale, DisplayNamesOptions::default()).unwrap();
//! assert_writeable_eq!(multi.of(region!("US")).unwrap(), "United States");
//! assert_writeable_eq!(multi.of(region!("GB")).unwrap(), "United Kingdom");
//!
//! // Single: Load only the region(s) we need.
//! let us = RegionDisplayName::try_new(locale, region!("US")).unwrap();
//! let gb = RegionDisplayName::try_new(locale, region!("GB")).unwrap();
//! assert_writeable_eq!(us, "United States");
//! assert_writeable_eq!(gb, "United Kingdom");
//! ```
pub use DisplayNamesPreferences;
pub use DisplayNamesOptions;
pub use Fallback;
pub use LanguageDisplay;
pub use Style;