Yes/No/Cancel messages appear untranslated in Qt-based apps

Bug #986068 reported by David Planella
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu Translations
Triaged
Medium
Ubuntu Translations Coordinators
ubuntuone-control-panel (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

While using the Ubuntu One control panel, I've just noticed a dialog where the stock Yes/No/Cancel messages appear in English.

Where do they come from? Can they be made translatable?

See attached screenshot.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: ubuntuone-control-panel-qt 3.0.0-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-20.33-generic 3.2.12
Uname: Linux 3.2.0-20-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu5
Architecture: amd64
Date: Fri Apr 20 10:50:29 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha amd64 (20110319)
PackageArchitecture: all
SourcePackage: ubuntuone-control-panel
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
David Planella (dpm) wrote :
Changed in ubuntu-translations:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
dobey (dobey) wrote :

I think these might be stock Qt buttons and strings, in a stock Qt error/message dialog we're popping from code. Also, the window title is incorrect and should be fixed.

Furthermore, we shouldn't be using this combination of button choices here. Yes/No/Cancel don't make any sense, and Yes/No should generally never be used.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

I was able to obtain this dialog (see attached image) setting the Qt locale to spanish instead of taking the ones from the system.
You can check if the translation for your language is installed in your system in the following path:

/usr/share/qt4/translations

(You can obtain this path in a python console with:
>>> from PyQt4 import QtCore
>>> QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)
)

And you can see which language your system is recognizing throw:

>>> QtCore.QLocale.system().name()

It would be helpful if you can share with us the result of those commands and the name of the files inside the folder i mention.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

It seems that Qt don't support Catalan.

Changed in ubuntu-translations:
assignee: nobody → Ubuntu Translations Coordinators (ubuntu-translations-coordinators)
dobey (dobey)
no longer affects: ubuntuone-control-panel/trunk
no longer affects: ubuntuone-control-panel
Revision history for this message
David Planella (dpm) wrote :

Hi Diego,

Here's the output requested, which returns the ca_ES locale:

In [1]: from PyQt4 import QtCore

In [2]: QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)
Out[2]: PyQt4.QtCore.QString(u'/usr/share/qt4/translations')

In [3]: QtCore.QLocale.system().name()
Out[3]: PyQt4.QtCore.QString(u'ca_ES')

On what do you base the statement that Qt doesn't support Catalan? And how do you define 'support'?

Revision history for this message
David Planella (dpm) wrote :

Subscribing Albert to comment.

Looking at the content of /usr/share/qt4/translations, it seems to contain translations for about 22 locales. Unfortunately they are contained in .qm files and thus Qt stock messages remain untranslatable in Launchpad.

I thought stock message translations were loaded from the .mo files from the qt4-x11 package [1]?

[1] https://translations.launchpad.net/ubuntu/precise/+source/qt4-x11/+pots/kdeqt/

Revision history for this message
dobey (dobey) wrote :

David, I see no such mo files on my system. FWIW, I am using sq_AL as my locale, and there are no core qt translations for it either, it would seem. I don't think there's anything we can do in U1 to make this "work." All our strings should be translated. It's just the Qt core ones which aren't in some locales.

Revision history for this message
David Planella (dpm) wrote : Re: [Bug 986068] Re: Yes/No/Cancel messages appear untranslated

Al 20/04/12 21:50, En/na Rodney Dawes ha escrit:
> David, I see no such mo files on my system. FWIW, I am using sq_AL as my
> locale, and there are no core qt translations for it either, it would
> seem. I don't think there's anything we can do in U1 to make this
> "work." All our strings should be translated. It's just the Qt core ones
> which aren't in some locales.
>

Sure, I fully understand that this is not a bug in U1, I'm just trying
to understand how the translations are actually loaded, as it was my
understanding that they were not loaded from the .qm files in
libqtcore4, but rather from the .mo files in qt4-x11, shipped in the
language packs, or at least the translations seem to be there:

$ msgunfmt /usr/share/locale-langpack/ca/LC_MESSAGES/kdeqt.mo | grep -C2 Yes

msgctxt "QDialogButtonBox"
msgid "&Yes"
msgstr "&Sí"

--

msgctxt "QDialogButtonBox"
msgid "Yes to &All"
msgstr "Sí &a tot"

--

msgctxt "QShortcut"
msgid "Yes"
msgstr "Sí"

--

msgctxt "QSql"
msgid "Yes"
msgstr "Sí"

Revision history for this message
dobey (dobey) wrote : Re: Yes/No/Cancel messages appear untranslated

Right. So the kde langpack was missing on my system. Installed it and have the kdeqt.mo now. But I don't see any obvious patches in qt4-x11 source package's debian/patches/ dir that makes qt use gettext to load these translations. It seems like kdelibs does use these translations though, so perhaps they only work for apps also using KDE, rather than plain Qt, as we are.

Revision history for this message
Albert Astals Cid (aacid) wrote :

kdeqt.mo is only used by KDE applications, Qt-only applications use .qm files to be found in /usr/share/qt4/translations/

Sidenote: apt-file search tells me there are lots of packages duplicating these .qm files

apt-file search qt_es.qm
fglrx-amdcccle: /usr/share/ati/amdcccle/qt_es.qm
fglrx-amdcccle-updates: /usr/share/ati/amdcccle/qt_es.qm
gns3: /usr/share/gns3/GNS3/Langs/qt_es.qm
lastfm: /usr/share/lastfm/i18n/qt_es.qm
libqt3-i18n: /usr/share/qt3/translations/qt_es.qm
libqtcore4: /usr/share/qt4/translations/qt_es.qm
mnemosyne: /usr/share/pyshared/mnemosyne/pyqt_ui/locale/qt_es.qm
musescore-common: /usr/share/mscore-1.2/locale/qt_es.qm
netemul: /usr/share/netemul/translation/qt_es.qm
pokerth-data: /usr/share/games/pokerth/translations/qt_es.qm
qelectrotech: /usr/share/qelectrotech/lang/qt_es.qm
qgis-common: /usr/share/qgis/i18n/qt_es.qm
qutecom-data: /usr/share/qutecom/lang/qt_es.qm
texmaker-data: /usr/share/texmaker/qt_es.qm
virtualbox-qt: /usr/share/virtualbox/nls/qt_es.qm
writetype: /usr/share/writetype/translations/qt_es.qm

I thought duplicating files was against debian/ubuntu packaging rules

Revision history for this message
Albert Astals Cid (aacid) wrote :

BTW when i say "kdeqt.mo is only used by KDE applications, Qt-only applications use .qm files to be found in /usr/share/qt4/translations/" it is just because Qt-only applications don't load those .mo, there is nothing preventing your application from using it if you know how to load .mo catalogs and how to hook them into the QTranslator system

Leo Arias (elopio)
tags: added: desktop+ u1-translations
David Planella (dpm)
Changed in ubuntuone-control-panel (Ubuntu):
status: New → Invalid
summary: - Yes/No/Cancel messages appear untranslated
+ Yes/No/Cancel messages appear untranslated in Qt-based apps
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.