Fix default_locale and get_best_locale
about unstable/extra/x86_64/manjaro-hello-0.8.0-1-any.pkg.tar.zst
For example, in my environment, the locale is ja_JP, but the default_locale cannot be determined and the locale is displayed as en.
After launching manjaro-hello, it is possible to switch the language and display Japanese, but if I close it and launch it again, it will be displayed as en locale. The locale in the configuration file also remains as en.
> manjaro-hello
INFO:root:Plugin 'layoutswitcherlib' not available.
Traceback (most recent call last):
File "/usr/bin/manjaro-hello", line 387, in on_languages_changed
self.set_locale(combobox.get_active_id())
File "/usr/bin/manjaro-hello", line 339, in set_locale
label.set_markup(self.get_page(page))
^^^^^^^^^^^^^^^^^^^
File "/usr/bin/manjaro-hello", line 377, in get_page
f"{self.preferences["data_path"]}/pages/{self.usr_prefs["default_locale"]}/{name}"
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: 'default_locale'
> cat .config/manjaro-hello.json
{“locale”: “en”}
applications/manjaro-hello#47 (closed)
Fix default_locale and get_best_locale
-
Fix error in default_locale key
default_locale is a key that preferences has, not usr_prefs.
applications/manjaro-hello@4287851a applications/manjaro-hello@53cec4a6 -
Reverted the part of the process that requires path expansion in get_best_locale.
applications/manjaro-hello@80e66387