[][src]Function bloguen::util::default_language

pub fn default_language() -> Option<String>

Try to get the default language for the system/user/environment.

On Windows, checks GetLocaleInfoEx().

On non-Windows, checks $LANG, then $LANGUAGE, then $LC_NAME.

Examples

// On Linux, if `LANG=en_GB.utf8`.
assert_eq!(default_language(), Some("en-GB".to_string()));

// On Windows, if language is set to Polish.
assert_eq!(default_language(), Some("pl".to_string()));

// If the language cannot be detected:
assert_eq!(default_language(), None);