From d0a760ec70dee0e1743712a260780f8a81e30ec3 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Fri, 9 Feb 2024 22:16:33 +0300 Subject: [PATCH] RR: Add fallback locale --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index dc005db..a31abe3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,6 +44,11 @@ fn main() { gettextrs::setlocale(LocaleCategory::LcAll, ""); gettextrs::bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind 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); });