mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
fix: C locale
This commit is contained in:
parent
85ab78b73c
commit
0f6f594cc8
1 changed files with 8 additions and 1 deletions
|
|
@ -40,7 +40,14 @@ i18n!("i18n", fallback = "en", minify_key = true);
|
||||||
fn main() {
|
fn main() {
|
||||||
colored::control::set_override(true);
|
colored::control::set_override(true);
|
||||||
// let locale = std::env::var("LANG").unwrap_or("en_US".to_string());
|
// let locale = std::env::var("LANG").unwrap_or("en_US".to_string());
|
||||||
let locale = get_locale().unwrap_or("en-US".to_string());
|
let locale = {
|
||||||
|
let sys_locale = get_locale().unwrap_or("en-US".to_string());
|
||||||
|
if sys_locale.len() < 2 {
|
||||||
|
"en_US".to_string()
|
||||||
|
} else {
|
||||||
|
sys_locale
|
||||||
|
}
|
||||||
|
};
|
||||||
rust_i18n::set_locale(&locale[0..2]);
|
rust_i18n::set_locale(&locale[0..2]);
|
||||||
|
|
||||||
#[cfg(feature = "request-ai")]
|
#[cfg(feature = "request-ai")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue