[Bug 1111323] New: transmission-qt: can't load translatioins
http://bugzilla.opensuse.org/show_bug.cgi?id=1111323 Bug ID: 1111323 Summary: transmission-qt: can't load translatioins Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: GNOME Assignee: bnc-team-gnome@forge.provo.novell.com Reporter: i@marguerite.su QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Created attachment 785578 --> http://bugzilla.opensuse.org/attachment.cgi?id=785578&action=edit debug patch to see the internal variables in qt/Application.cc Hi, with transmission-qt-lang 2.94-1.4 installed, transmission-qt can't recognize and load .qm translations properly. strace transmission-qt: access("/usr/bin/translations/transmission_zh_CN.qm", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission_zh_CN", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission_zh.qm", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission_zh", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission.qm", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission_en.qm", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission_en", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission.qm", R_OK) = -1 ENOENT access("/usr/bin/translations/transmission", R_OK) = -1 ENOENT access("/usr/share/qt5/translations/qt_en.qm", R_OK) = 0 As I see, transmission-qt tries to load translation from /usr/bin/translations (which does not exist and should not exist), then load qt_en.qm from standard qt5 translations directory. I made a debug build myself(patch included in attachment), and found: QLibraryInfo::TranslationsPath: "/usr/share/qt5/translations" applicationDirPath: "/usr/bin" qtQmDirs: ("/usr/share/qt5/translations", "/usr/bin/translations") appQmDirs: ("/usr/bin/translations") and its original code: void Application::loadTranslations () { const QStringList qtQmDirs = QStringList () << QLibraryInfo::location (QLibraryInfo::TranslationsPath) << #ifdef TRANSLATIONS_DIR QString::fromUtf8 (TRANSLATIONS_DIR) << #endif (applicationDirPath () + QLatin1String ("/translations")); const QStringList appQmDirs = QStringList () << #ifdef TRANSLATIONS_DIR QString::fromUtf8 (TRANSLATIONS_DIR) << #endif (applicationDirPath () + QLatin1String ("/translations")); QString localeName = QLocale ().name (); if (!loadTranslation (myAppTranslator, MY_CONFIG_NAME, localeName, appQmDirs)) { localeName = QLatin1String ("en"); loadTranslation (myAppTranslator, MY_CONFIG_NAME, localeName, appQmDirs); } if (loadTranslation (myQtTranslator, QLatin1String ("qt"), localeName, qtQmDirs)) installTranslator (&myQtTranslator); installTranslator (&myAppTranslator); } if it can't load application translation from appQmDirs("/usr/bin/translations"), it'll try to load english "translation" from the same directory, then try to load standard "qt" translations from qtQmDirs("/usr/share/qt5/translations", "/usr/bin/translations"). none of these can get a perfect hit. because on openSUSE and most of the Linux distributions, qmake will install translations into qt5 standard translations directory /usr/share/qt5/translations. So I think upstream may didn't test properly on Linux, because on Windows and OSX, applications can have their own directory, eg Apps/Transmission, then Apps/Transmission/translations makes sense. Marguerite -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111323 Marguerite Su changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|transmission-qt: can't load |transmission-qt: try to |translatioins |load translations from app | |executable directory which | |is /usr/bin on openSUSE -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111323 http://bugzilla.opensuse.org/show_bug.cgi?id=1111323#c1 --- Comment #1 from Marguerite Su --- Created attachment 785585 --> http://bugzilla.opensuse.org/attachment.cgi?id=785585&action=edit the fix This patch append QLibraryInfo::location (QLibraryInfo::TranslationsPath) into appQmDirs, so transmission-qt will search translations in our standard Qt translation directory /usr/share/qt5/translations, where our translations are installed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111323 http://bugzilla.opensuse.org/show_bug.cgi?id=1111323#c2 Marguerite Su changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from Marguerite Su --- https://build.opensuse.org/request/show/640959 fixed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111323 http://bugzilla.opensuse.org/show_bug.cgi?id=1111323#c3 --- Comment #3 from Marguerite Su --- Created attachment 785738 --> http://bugzilla.opensuse.org/attachment.cgi?id=785738&action=edit fix for 2.84 in Leap 42.3 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1111323 http://bugzilla.opensuse.org/show_bug.cgi?id=1111323#c4 --- Comment #4 from Marguerite Su --- https://github.com/transmission/transmission/issues/736 upstream bug report for reference. As the upstream and I discussed in that issue, we should use cmake to build transmission instead of patching actual code to "fix". Because currenly transmission is the only application that install its translations into /usr/share/qt5/translations, which should be the directory for Qt only. I'll switch the specfile from autotools to cmake to see everything okay. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com