1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// This macro can be used to create a `Vec<LanguageIdentifier>` instance quickly by providing multiple `<language>[-<region>]` or `<language>[_<region>]` strings separated by commas.
#[macro_export]
macro_rules! language_region_pairs {
    ($($id:expr),* $(,)*) => {
        vec![$($crate::unic_langid::langid!($id),)*]
    };
}

/// This macro can be used to create a `Language` instance constantly .
#[macro_export]
macro_rules! language {
    ($id:expr) => {
        $crate::unic_langid_macros::lang!($id)
    };
}

/// This macro can be used to create a `Region` instance constantly .
#[macro_export]
macro_rules! region {
    ($id:expr) => {
        $crate::unic_langid_macros::region!($id)
    };
}