]> git.pld-linux.org Git - packages/clementine.git/blobdiff - unbundle-po.patch
- libechonest-2.3.1-1 rebuild
[packages/clementine.git] / unbundle-po.patch
index f7a899ab1d78b234dc93be7b66742f0fb52c6515..7cb3704d6095cfdeb0caf835bbd41198e32672f2 100644 (file)
@@ -12,8 +12,8 @@ TODO: make it configurable via cmake params.
 
 Author: Elan Ruusamäe <glen@pld-linux.org>
 
---- clementine-0.5.3/src/main.cpp~     2010-10-18 23:59:12.000000000 +0300
-+++ clementine-0.5.3/src/main.cpp      2010-10-18 23:59:15.876170584 +0300
+--- clementine-1.3.0rc1/src/main.cpp~  2016-01-20 17:03:12.000000000 +0200
++++ clementine-1.3.0rc1/src/main.cpp   2016-01-20 17:04:21.767206898 +0200
 @@ -176,7 +176,7 @@
  
    // Resources
@@ -23,12 +23,14 @@ Author: Elan Ruusamäe <glen@pld-linux.org>
  
    // Has the user forced a different language?
    QString language = options.language();
-@@ -187,9 +187,15 @@
-   }
+@@ -417,10 +417,15 @@
+                                : override_language;
  
    // Translations
+-  LoadTranslation("qt", QLibraryInfo::location(QLibraryInfo::TranslationsPath),
+-                  language);
 +  // Qt: system path
-   LoadTranslation("qt", QLibraryInfo::location(QLibraryInfo::TranslationsPath), language);
++  LoadTranslation("qt", QLibraryInfo::location(QLibraryInfo::TranslationsPath), language);
 +  // Clementine: system path
 +  LoadTranslation("clementine", QLibraryInfo::location(QLibraryInfo::TranslationsPath), language);
 +  // Clementine: QRC
@@ -38,12 +40,45 @@ Author: Elan Ruusamäe <glen@pld-linux.org>
 +  // Clementine: current dir
    LoadTranslation("clementine", QDir::currentPath(), language);
  
-   // Icons
---- clementine-0.5.3/cmake/Translations.cmake~ 2010-10-18 23:59:51.000000000 +0300
-+++ clementine-0.5.3/cmake/Translations.cmake  2010-10-18 23:59:53.487509786 +0300
-@@ -63,12 +63,12 @@
-     list(APPEND ${outfiles} ${_qm_filepath})
-   endforeach (_lang)
+ #ifdef Q_OS_WIN32
+--- clementine-1.3.0rc1/src/ui/behavioursettingspage.cpp~      2016-01-20 17:03:12.000000000 +0200
++++ clementine-1.3.0rc1/src/ui/behavioursettingspage.cpp       2016-01-20 17:06:51.358232182 +0200
+@@ -21,6 +21,7 @@
+ #include "playlist/playlist.h"
+ #include <QDir>
++#include <QLibraryInfo>
+ BehaviourSettingsPage::BehaviourSettingsPage(SettingsDialog* dialog)
+@@ -60,16 +60,15 @@
+   ui_->menu_previousmode->setItemData(0, Player::PreviousBehaviour_DontRestart);
+   ui_->menu_previousmode->setItemData(1, Player::PreviousBehaviour_Restart);
+-  // Populate the language combo box.  We do this by looking at all the
+-  // compiled in translations.
+-  QDir dir(":/translations/");
+-  QStringList codes(dir.entryList(QStringList() << "*.qm"));
+-  QRegExp lang_re("^clementine_(.*).qm$");
+-  for (const QString& filename : codes) {
+-    // The regex captures the "ru" from "clementine_ru.qm"
+-    if (!lang_re.exactMatch(filename)) continue;
++  // Populate the language combo box
++  // We do this by looking at all the compiled in translations.
++  QDir localeDir(QLibraryInfo::location(QLibraryInfo::TranslationsPath));
++  QStringList dirList = localeDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name);
++  foreach (const QString& code, dirList) {
++    if (!QFile::exists(QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/" + code + "/LC_MESSAGES/clementine.qm")) {
++       continue;
++    }
+-    QString code = lang_re.cap(1);
+     QString lookup_code = QString(code)
+                               .replace("@latin", "_Latn")
+                               .replace("_CN", "_Hans_CN")
+--- clementine-0.5.3/cmake/Translations.cmake  2010-10-18 23:59:53.487509786 +0300
++++ clementine-0.5.3/cmake/Translations.cmake  2010-10-19 01:42:52.112825900 +0300
+@@ -65,10 +65,22 @@
  
 -  # Generate a qrc file for the translations
 -  set(_qrc ${CMAKE_CURRENT_BINARY_DIR}/${ADD_PO_DIRECTORY}/translations.qrc)
@@ -53,6 +88,18 @@ Author: Elan Ruusamäe <glen@pld-linux.org>
 -  endforeach(_lang)
 -  file(APPEND ${_qrc} "</qresource></RCC>")
 -  qt4_add_resources(${outfiles} ${_qrc})
++  # install .qm
++  set(_potBasename "clementine")
++  foreach (_lang ${ADD_PO_LANGUAGES})
++    set(_qm_filename "clementine_${_lang}.qm")
++    set(_qm_filepath "${CMAKE_CURRENT_BINARY_DIR}/${ADD_PO_DIRECTORY}/${_qm_filename}")
++
++    install(FILES ${_qm_filepath} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.qm)
++    set(_gmoFiles ${_gmoFiles} ${_gmoFile})
++  endforeach (_lang)
++
++  add_custom_target(translations ALL DEPENDS ${_gmoFiles})
++
 +#  # Generate a qrc file for the translations
 +#  set(_qrc ${CMAKE_CURRENT_BINARY_DIR}/${ADD_PO_DIRECTORY}/translations.qrc)
 +#  file(WRITE ${_qrc} "<RCC><qresource prefix=\"/${ADD_PO_DIRECTORY}\">")
@@ -62,3 +109,37 @@ Author: Elan Ruusamäe <glen@pld-linux.org>
 +#  file(APPEND ${_qrc} "</qresource></RCC>")
 +#  qt4_add_resources(${outfiles} ${_qrc})
  endmacro(add_po)
+--- clementine-1.1.1/tests/resources_env.h~    2013-09-08 01:29:59.000000000 +0300
++++ clementine-1.1.1/tests/resources_env.h     2013-09-08 01:30:00.886424405 +0300
+@@ -26,7 +26,7 @@
+ public:
+   void SetUp() {
+     Q_INIT_RESOURCE(data);
+-    Q_INIT_RESOURCE(translations);
++//    Q_INIT_RESOURCE(translations);
+     Q_INIT_RESOURCE(testdata);
+   }
+ };
+--- clementine-1.1.1/tests/translations_test.cpp~      2013-09-08 01:34:17.000000000 +0300
++++ clementine-1.1.1/tests/translations_test.cpp       2013-09-08 01:34:21.084475375 +0300
+@@ -23,14 +23,14 @@
+ #include "test_utils.h"
+ TEST(Translations, Basic) {
+-  ASSERT_TRUE(QFile::exists(":/translations"));
+-  ASSERT_TRUE(QFile::exists(":/translations/clementine_es.qm"));
++//  ASSERT_TRUE(QFile::exists(":/translations"));
++//  ASSERT_TRUE(QFile::exists(":/translations/clementine_es.qm"));
+   PoTranslator t;
+   t.load("clementine_es.qm", ":/translations");
+-  EXPECT_EQ(QString::fromUtf8("Colección"),
+-            t.translate("MainWindow", "Library"));
+-  EXPECT_EQ(QString::fromUtf8("Colección"),
+-            t.translate("", "Library"));
++//  EXPECT_EQ(QString::fromUtf8("Colección"),
++//            t.translate("MainWindow", "Library"));
++//  EXPECT_EQ(QString::fromUtf8("Colección"),
++//            t.translate("", "Library"));
+ }
This page took 0.051622 seconds and 4 git commands to generate.