Project

General

Profile

Bug #466

Qt: Translations are not applied

Added by Thomas Lange about 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Major
Assignee:
-
Category:
plugins/qtui
Target version:
Start date:
October 14, 2014
Due date:
% Done:

100%

Estimated time:
Affects version:

Description

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).

Platform: Linux

Settings.png (42.1 KB) Settings.png Settings window Thomas Lange, October 14, 2014 15:58
translate_qt_buttons.patch (4.04 KB) translate_qt_buttons.patch Thomas Lange, February 12, 2015 19:09

History

#1 Updated by John Lindgren about 10 years ago

  • Target version deleted (3.6)
  • 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.

#2 Updated by Ariadne Conill about 10 years ago

I am planning to remove the last bits of the Qt Designer stuff this weekend.

#3 Updated by John Lindgren about 10 years ago

I fixed several issues in the PreferencesWidget code; all of the settings dialog should be translated now.

#4 Updated by Thomas Lange about 10 years ago

  • Status changed from New to In Progress

Thanks John, good work.
I just fixed some remaining issues.

TODO:
- 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"));

#5 Updated by Ariadne Conill about 10 years ago

Qt designer vestiges have been nuked. The menus should now be translated.

#6 Updated by Thomas Lange about 10 years ago

At first it still used the English strings, but the fix was trivial.
Using () instead of N() resolved it.

#7 Updated by Ariadne Conill about 10 years ago

That fix is incorrect. Please revert.

#8 Updated by Thomas Lange about 10 years ago

Done, sorry for the inconvenience.
What is the proper fix though?

#9 Updated by Ariadne Conill about 10 years ago

Please try latest libaudqt, it should have an appropriate fix.

#10 Updated by Thomas Lange about 10 years ago

It is the same as before, still not translated.

#11 Updated by Ariadne Conill about 10 years ago

Best to leave it to jlindgren then, the current approach is the same as libaudgui basically.

#12 Updated by Ariadne Conill about 10 years ago

Qt itself can be translated by installing a custom translator which is subclassed from QTranslator. I'll work on that this weekend, it might help.

#13 Updated by John Lindgren about 10 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.

#14 Updated by Thomas Lange about 10 years ago

John Lindgren wrote:

Menu translations should be fixed now.

Thanks, confirming it works.

#15 Updated by Thomas Lange about 10 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 almost 10 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.

#17 Updated by John Lindgren almost 10 years ago

Looks fine to me.

#18 Updated by Thomas Lange over 9 years ago

  • Affects version deleted (3.6)

Update for 3.7-devel:

PreferencesWidgets in "/skins-qt/skins_cfg.cc" are not shown translated currently.

#20 Updated by John Lindgren over 9 years ago

  • Status changed from In Progress to Closed
  • Target version set to 3.7
  • % Done changed from 0 to 100

Closing this since it looks like the issues have all been fixed.

Also available in: Atom PDF