-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Customize UI language via GUI #1494
Conversation
qt/app.py
Outdated
if dlg.result() == 1: | ||
self.config.setLanguage(dlg.language_code) | ||
|
||
# How to send notify message (systray bubble)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to modify the language used by gettext and Qt on the fly without restarting the whole application. But BITs current code structure do not allow it. So users have to restart BIT as most other GUI applications to my knowledge realizing it.
Here I would like to inform the users about that fact. I simple systray bubble I would say. How can we do this with BIT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking in #1156 and found about NotifyPlugin
class. But I can not see where it is used. It seems to be unused.
I also tried something like self.config.PLUGIN_MANAGER.error("foo")
but without effect.
I don't understand how BIT produce the systray bubbles/balloons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could find common/pluginmanager.py
and the class PluginManager
in there.
I don't understand that approach. Why do I need a "plugin" to send notify messages? And all this happens without logger.py
.
If I would understand the intention behind that approach I could come up with a solution/improvement.
This smells like a lot of refactoring and redesign work. So I'll stop at this point.
The question is how should we inform the user about the fact that the language settings taking effect only after restarting BIT? IMHO a message box would be a pragmatic solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much better and faster to read now. Still I think the current 3-column radio button + scroll bar layout will not fit into any existing UI guidelines - but does work of course very well. A simple combo box with auto-complete + allowing only values from the list is a commonly seen way of choosing a language without wasting too much space in a settings windows. Since we have now common "BiT" settings dialog (or menu entry) a combo box would look a little bit "alone" in a window though 😉 |
Thanks for your feedback.
Yes, it is very unconventional. 🤣
Replacing the dialog with another GUI element is no big deal. Most of the work was done somewhere else in the code. If no one else comes up with an alternative approach I would say we keep the dialog that way until we implement an application settings dialog where we can integrate it then. |
Fully agree (it does work) |
Customize UI language with GUI dialog.
de
) are not the same used in GNU Linuxlocale
(e.g.de_DE.UTF-8
)日本語
for Japanese)Japanisch
when the UI language is German)Japanese
)babel
via theupdate_language_files.py
script when downloading the translations (po-files) from Weblate.babel
is used only in that helper script and don't become a dependency to the project because of that.Some details to that screencast:
de_DE.UTF-8
(German) as current locale.qttools.can_render()
) and don't use the native language name in that case to prevent errors.