🚧 fix language

This commit is contained in:
Vladislav Nepogodin 2023-01-25 02:32:37 +04:00
parent c590a2a916
commit ac49b56a34
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9
1 changed files with 4 additions and 1 deletions

View File

@ -150,6 +150,9 @@ fn build_ui(application: &gtk::Application) {
read_json(save_path.as_str())
};
let best_locale = get_best_locale(&preferences, &save);
std::env::set_var("LANGUAGE", best_locale.as_str());
// Import Css
let provider = gtk::CssProvider::new();
provider
@ -271,7 +274,7 @@ fn build_ui(application: &gtk::Application) {
.expect("Unable to set domain encoding.");
gettextrs::textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain.");
let languages: gtk::ComboBoxText = builder.object("languages").unwrap();
languages.set_active_id(Some(get_best_locale(&preferences, &save).as_str()));
languages.set_active_id(Some(best_locale.as_str()));
// Set autostart switcher state
let autostart = Path::new(&fix_path(preferences["autostart_path"].as_str().unwrap())).exists();