From 252c9dfd16950dbdbc27ec158aa6e85e3bf5b33c Mon Sep 17 00:00:00 2001 From: Hugo Posnic Date: Mon, 19 Dec 2016 20:03:15 +0100 Subject: [PATCH] Fix bug in locale detection --- src/manjaro_hello.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/manjaro_hello.py b/src/manjaro_hello.py index 7b85086..ba62f41 100644 --- a/src/manjaro_hello.py +++ b/src/manjaro_hello.py @@ -57,17 +57,16 @@ class ManjaroHello(): self.builder.get_object("aboutdialog").set_logo(logo) # Init translation + self.locales = ("en", "fr") # supported locales self.default_locale = "en" self.sys_locale = locale.getdefaultlocale()[0] self.default_texts = {} - locales = os.listdir(self.locale_path) - locales.append(self.default_locale) # Choose best locale for user - if self.preferences["locale"] not in locales: + if self.preferences["locale"] not in self.locales: if self.sys_locale in locales: self.preferences["locale"] = self.sys_locale else: - if self.sys_locale[:2] in locales: + if self.sys_locale[:2] in self.locales: self.preferences["locale"] = self.sys_locale[:2] else: self.preferences["locale"] = self.default_locale