RR: Add fallback locale

This commit is contained in:
Ward from fusion-voyager-3 2024-02-09 22:16:33 +03:00
parent 5b454a5cac
commit d0a760ec70

View File

@ -44,6 +44,11 @@ fn main() {
gettextrs::setlocale(LocaleCategory::LcAll, ""); gettextrs::setlocale(LocaleCategory::LcAll, "");
gettextrs::bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind the text domain"); gettextrs::bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind the text domain");
gettextrs::textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain"); gettextrs::textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain");
// Fallback if no translation present
if gettext("first_setup_initial_box_text_title") == "first_setup_initial_box_text_title" {
println!("Warning: Current LANG is not supported, using fallback Locale.");
gettextrs::setlocale(LocaleCategory::LcAll, "en_US.UTF8");
}
app.connect_activate(build_ui); app.connect_activate(build_ui);
}); });