This commit is contained in:
Valeria Fadeeva 2025-01-31 10:31:17 +05:00
parent 694998812b
commit cab12d8cd9
1 changed files with 2 additions and 4 deletions

View File

@ -2,7 +2,7 @@
use rust_i18n::i18n;
use rust_i18n::t;
rust_i18n::i18n!("locales");
i18n!("locales", fallback = "en");
use fltk::{
app::App,
@ -69,12 +69,10 @@ fn run_cmd(cmd_string: &str, lang_env_var: Option<&str>) {
}
fn main() {
i18n!("locales", fallback = "en");
let locale_key = "LANG";
let locale = match env::var(locale_key) {
Ok(val) => val,
_ => String::from(""),
_ => String::from("en"),
};
rust_i18n::set_locale(&locale);