diff --git a/ci/txpull.sh b/ci/txpull.sh index 44a7d846b..624da0bd4 100755 --- a/ci/txpull.sh +++ b/ci/txpull.sh @@ -10,16 +10,22 @@ git config --global http.sslVerify false export QT_SELECT=5 tx pull --force --source --all + git add --verbose lang/calamares*.ts git commit --author='Calamares CI ' --message='[core] Automatic merge of Transifex translations' | true +# Transifex updates the PO-Created timestamp also when nothing interesting +# has happened, so drop the files which have just 1 line changed (the +# PO-Created line). This applies only to modules which use po-files. +git diff --numstat src/modules | awk '($1==1 && $2==1){print $3}' | xargs git checkout -- + for MODULE_DIR in `find src/modules -maxdepth 1 -mindepth 1 -type d`; do FILES=(${MODULE_DIR}/*.py) if [ ${#FILES[@]} -gt 0 ]; then MODULE_NAME=$(basename ${MODULE_DIR}) if [ -d ${MODULE_DIR}/lang ]; then # Convert PO files to MO files - for POFILE in `find . -name "*.po"` ; do + for POFILE in `find ${MODULE_DIR} -name "*.po"` ; do msgfmt -o ${POFILE/.po/.mo} $POFILE done git add --verbose ${MODULE_DIR}/lang/* diff --git a/lang/translations.cmake b/lang/translations.cmake index dddad3149..fc18f4f11 100644 --- a/lang/translations.cmake +++ b/lang/translations.cmake @@ -7,12 +7,6 @@ macro(add_calamares_translations language) set( calamares_i18n_qrc_content "${calamares_i18n_qrc_content}\n" ) foreach( lang ${CALAMARES_LANGUAGES} ) set( calamares_i18n_qrc_content "${calamares_i18n_qrc_content}calamares_${lang}.qm\n" ) - if( NOT lang STREQUAL "en" AND EXISTS ${QT_TRANSLATIONS_DIR}/qt_${lang}.qm ) - file( COPY ${QT_TRANSLATIONS_DIR}/qt_${lang}.qm DESTINATION ${CMAKE_CURRENT_BINARY_DIR} ) - set( calamares_i18n_qrc_content "${calamares_i18n_qrc_content}qt_${lang}.qm\n" ) - endif() - - # build explicitly enabled languages list( APPEND TS_FILES "${CMAKE_SOURCE_DIR}/lang/calamares_${lang}.ts" ) endforeach() diff --git a/src/libcalamares/utils/CalamaresUtils.cpp b/src/libcalamares/utils/CalamaresUtils.cpp index 9df222217..db748ec94 100644 --- a/src/libcalamares/utils/CalamaresUtils.cpp +++ b/src/libcalamares/utils/CalamaresUtils.cpp @@ -47,7 +47,6 @@ static bool s_isAppDataDirOverridden = false; static QTranslator* s_brandingTranslator = nullptr; static QTranslator* s_translator = nullptr; -static QTranslator* s_qtTranslator = nullptr; static QString s_translatorLocaleName; @@ -207,25 +206,6 @@ installTranslator( const QLocale& locale, QCoreApplication::installTranslator( translator ); s_translator = translator; - // Qt translations - translator = new QTranslator( parent ); - if ( translator->load( QString( ":/lang/qt_" ) + localeName ) ) - { - qDebug() << "Translation: Qt: Using system locale:" << localeName; - } - else - { - qDebug() << "Translation: Qt: Using default locale, system locale one not found:" << localeName; - } - - if ( s_qtTranslator ) - { - QCoreApplication::removeTranslator( s_qtTranslator ); - delete s_qtTranslator; - } - QCoreApplication::installTranslator( translator ); - s_qtTranslator = translator; - s_translatorLocaleName = localeName; } diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index 98476767c..7c9f1897d 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -94,12 +94,16 @@ ViewManager::ViewManager( QObject* parent ) if ( !( m_currentStep == m_steps.count() -1 && m_steps.last()->isAtEnd() ) ) { - int response = QMessageBox::question( m_widget, + QMessageBox mb( QMessageBox::Question, tr( "Cancel installation?" ), tr( "Do you really want to cancel the current install process?\n" "The installer will quit and all changes will be lost." ), QMessageBox::Yes | QMessageBox::No, - QMessageBox::No ); + m_widget ); + mb.setDefaultButton( QMessageBox::No ); + mb.button( QMessageBox::Yes )->setText( tr( "&Yes" ) ); + mb.button( QMessageBox::No )->setText( tr( "&No" ) ); + int response = mb.exec(); if ( response == QMessageBox::Yes ) qApp->quit(); }