From 307c619ff2d9eb00e59452ab38da70f1c95cc816 Mon Sep 17 00:00:00 2001 From: Masato TOYOSHIMA Date: Mon, 27 Jan 2025 15:43:07 +0900 Subject: [PATCH] Fix default_locale and get_best_locale Fix error in default_locale key default_locale is a key that preferences has, not usr_prefs. Reverted the part of the process that requires path expansion in get_best_locale. --- src/manjaro_hello.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/manjaro_hello.py b/src/manjaro_hello.py index 51a49e9..0487021 100755 --- a/src/manjaro_hello.py +++ b/src/manjaro_hello.py @@ -250,7 +250,7 @@ class Hello(Gtk.Window): :return: locale to use :rtype: str """ - path = f"{self.preferences["locale_path"]}/LC_MESSAGES/{self.app}*.mo" + path = self.preferences["locale_path"] + "/{}/LC_MESSAGES/" + self.app + ".mo" if os.path.isfile(path.format(self.usr_prefs["locale"])): # return usr_preference @@ -374,7 +374,7 @@ class Hello(Gtk.Window): """ filename = f"{self.preferences["data_path"]}/pages/{self.usr_prefs["locale"]}/{name}" if not os.path.isfile(filename): - f"{self.preferences["data_path"]}/pages/{self.usr_prefs["default_locale"]}/{name}" + f"{self.preferences["data_path"]}/pages/{self.preferences["default_locale"]}/{name}" try: with open(filename, "r") as fil: return fil.read()