Locale determination is not done properly and locale is not retained for some locales. #156

Merged
phoepsilonix merged 1 commit from fix-locale into master 2025-01-27 08:23:01 +00:00
phoepsilonix commented 2025-01-27 06:50:38 +00:00 (Migrated from gitlab2.manjaro.org)

This is a summary of the following three commits that were pushed directly to master.
4287851aed
80e66387b2
53cec4a683

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.

This is a summary of the following three commits that were pushed directly to master. 4287851aed726f43b6d4346b0d03ea83be5570c9 80e66387b24c168ba6875b4a53f4529e40507913 53cec4a683b2d7066305c8d0e34c163d73d92338 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.
phoepsilonix commented 2025-01-27 06:50:39 +00:00 (Migrated from gitlab2.manjaro.org)

requested review from @fhdk and @yochananmarqos1

requested review from @fhdk and @yochananmarqos1
phoepsilonix commented 2025-01-27 06:50:39 +00:00 (Migrated from gitlab2.manjaro.org)

assigned to @phoepsilonix

assigned to @phoepsilonix
phoepsilonix commented 2025-01-27 06:51:42 +00:00 (Migrated from gitlab2.manjaro.org)

I apologize for the inconvenience, as it is not in my power to revoke it.

I apologize for the inconvenience, as it is not in my power to revoke it.
phoepsilonix commented 2025-01-27 06:55:56 +00:00 (Migrated from gitlab2.manjaro.org)

changed title from {-Fix default_locale and get_best_-}locale to {+Locale is not preserved for some +}locale{+s.+}

changed title from **{-Fix default_locale and get_best_-}locale** to **{+Locale is not preserved for some +}locale{+s.+}**
phoepsilonix commented 2025-01-27 06:55:56 +00:00 (Migrated from gitlab2.manjaro.org)

changed the description

changed the description
phoepsilonix commented 2025-01-27 06:59:19 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in issue #47

mentioned in issue #47
phoepsilonix commented 2025-01-27 07:02:40 +00:00 (Migrated from gitlab2.manjaro.org)

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.

> 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'

The locale in the configuration file also remains as en.

> cat .config/manjaro-hello.json 
{“locale”: “en”}
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. ``` > 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' ``` The locale in the configuration file also remains as en. ``` > cat .config/manjaro-hello.json {“locale”: “en”} ```
phoepsilonix commented 2025-01-27 07:13:58 +00:00 (Migrated from gitlab2.manjaro.org)

changed title from Locale {-is not preserv-}ed for some locales. to Locale {+determination is not done properly and locale is not retain+}ed for some locales.

changed title from **Locale {-is not preserv-}ed for some locales.** to **Locale {+determination is not done properly and locale is not retain+}ed for some locales.**
fhdk commented 2025-01-27 08:22:29 +00:00 (Migrated from gitlab2.manjaro.org)

approved this merge request

approved this merge request
fhdk commented 2025-01-27 08:22:39 +00:00 (Migrated from gitlab2.manjaro.org)

Yes - you are correct - that is a bug introduced by me.

Thank you.

Yes - you are correct - that is a bug introduced by me. Thank you.
fhdk commented 2025-01-27 08:23:02 +00:00 (Migrated from gitlab2.manjaro.org)

mentioned in commit b18049a45e

mentioned in commit b18049a45ee9cebe96b6ab2f3539c998de341204
fhdk (Migrated from gitlab2.manjaro.org) merged commit b18049a45e into master 2025-01-27 08:23:02 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
applications/manjaro-hello!156
No description provided.