Skip to content

Commit

Permalink
fixed bug on default locale if OS locale isnt supported
Browse files Browse the repository at this point in the history
  • Loading branch information
qlrd committed Aug 26, 2024
1 parent ecf8e23 commit 38963c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/config_krux_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ def build_config(self, config):
if sys.platform == "win32":
lang_file = os.path.join(self.i18n_path, f"{lang}.UTF-8.json")

Check warning on line 173 in src/app/config_krux_installer.py

View check run for this annotation

Codecov / codecov/patch

src/app/config_krux_installer.py#L173

Added line #L173 was not covered by tests
if os.path.isfile(lang_file):
config.setdefaults("locale", {"lang": f"{lang}.UTF-8.json"})
config.setdefaults("locale", {"lang": lang})
self.info(f"{config}.lang={lang}")

Check warning on line 176 in src/app/config_krux_installer.py

View check run for this annotation

Codecov / codecov/patch

src/app/config_krux_installer.py#L175-L176

Added lines #L175 - L176 were not covered by tests

else:
self.warning(f"{lang} not supported. Default {config}.lang=en_US.UTF-8")
config.setdefaults("locale", {"lang": "en_US.UTF-8"})
self.warning(f"{lang} not supported. Default {config}.lang=en_US")
config.setdefaults("locale", {"lang": "en_US"})

Check warning on line 180 in src/app/config_krux_installer.py

View check run for this annotation

Codecov / codecov/patch

src/app/config_krux_installer.py#L179-L180

Added lines #L179 - L180 were not covered by tests

def build_settings(self, settings):
"""Create settings panel"""
Expand Down

0 comments on commit 38963c9

Please sign in to comment.