Qt: Translations are not applied
Almost all strings are shown in English with the Qt interface.
Only some window titles and buttons use the translations
(screenshot of the settings window is attached).
#1 Updated by John Lindgren over 3 years ago
- Target version deleted (
- Category changed from libaudqt to plugins/qtui
- Priority changed from Blocker to Major
I don't think this should be a blocker for 3.6 since the Qt UI is only going to be a technical preview in that release. Some of the translations will not appear without a fair amount of work, since Qt Designer does not support our gettext-based translations.
#4 Updated by Thomas Lange over 3 years ago
- Status changed from New to In Progress
Thanks John, good work.
I just fixed some remaining issues.
- menu bar
- dialog buttons
- combobox "Preferences->Audio->Bit depth"
- combobox "Preferences->Playlist->Auto character encoding detector for:"
- tooltip "Close Tab" on tab close buttons
The dialog buttons and the tooltip should be translated by Qt, but apparently they are not.
We could either use custom QPushButtons or something like this:
m_buttonbox.setStandardButtons (QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + m_buttonbox.button (QDialogButtonBox::Ok)->setText (translate_str ("_OK")); + m_buttonbox.button (QDialogButtonBox::Cancel)->setText (translate_str ("_Cancel"));
#13 Updated by John Lindgren over 3 years ago
William Pitcock wrote:
Best to leave it to jlindgren then, the current approach is the same as libaudgui basically.
One of the pitfalls of this approach is that it's easy for the gettext domain to get dropped at some point in the call tree. There were a couple of places where this was happening in libaudqt. Menu translations should be fixed now.
#15 Updated by Thomas Lange over 3 years ago
Another issue remains in the file dialog (libaudqt/fileopener.cc#46).
If we translate the button label with "translate_str (N_("_Add"))", the accelerator
is converted to the Qt one (&). But Qt itself uses on GTK systems a native GTK dialog
and in this case the string is shown literally as "&Add".
If we just use _("_Add"), the accelerator is wrong on Qt systems.
Additionally it would be nice to show an icon on this button.
#16 Updated by Thomas Lange over 3 years ago
With the attached patch all dialog buttons are translatable.
The strings are already used in the GTK interface so no further translation work is needed.
My suggestion is to use this solution until William implements a custom QTranslator.