locale_config 0.3.0

Maintains locale preferences for process and thread and initialises them by inspecting the system for user preference.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Inspect CGI environment variables for locale configuration

use std::env;
use super::{Locale};

pub fn system_locale() -> Option<Locale> {
    if let Ok(al) = env::var("HTTP_ACCEPT_LANGUAGE") {
        Locale::new(al.as_ref()).ok()
    } else {
        None
    }
}