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
// 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 ).
//! Options for [`DisplayNames`](crate::DisplayNames).
/// A bag of options defining how region or language codes will be translated.
///
/// # Example
///
/// ```
/// use icu::experimental::displaynames::{
/// DisplayNamesOptions, multi::RegionDisplayNames, Style,
/// };
/// use icu::locale::{locale, subtags::region};
///
/// let locale = locale!("en-001");
/// let mut options: DisplayNamesOptions = Default::default();
/// options.style = Some(Style::Short);
/// let display_name = RegionDisplayNames::try_new(locale.into(), options)
/// .expect("Data should load successfully");
///
/// // Full name would be "Bosnia & Herzegovina"
/// assert_eq!(display_name.of(region!("BA")), Some("Bosnia"));
/// ```
/// An enum for formatting style.
// The variants are self explanatory.
/// An enum for fallback return when the system does not have the
/// requested display name.
/// An enum for the language display kind.
// The variants are self explanatory.