1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
//! Locale capabilities for the crate. /// Get the name of two-letter a locale. /// /// Be aware that this only gives names for locales that are used in /// this crate. Others will return the given locale. pub fn locale_name(s: &str) -> String { match s { "de" => "German".to_string(), "en" => "English".to_string(), "ru" => "Russian".to_string(), "fr" => "French".to_string(), "es" => "Spanish".to_string(), "it" => "Italian".to_string(), "sk" => "Slovakian".to_string(), _ => s.to_string(), } }