diff --git a/src/modules/partition/gui/AlongsidePage.cpp b/src/modules/partition/gui/AlongsidePage.cpp index d896ec2b7..3904e0c80 100644 --- a/src/modules/partition/gui/AlongsidePage.cpp +++ b/src/modules/partition/gui/AlongsidePage.cpp @@ -32,6 +32,7 @@ #include "GlobalStorage.h" #include "utils/Logger.h" #include "utils/CalamaresUtilsGui.h" +#include "utils/Retranslator.h" #include "Branding.h" #include @@ -51,7 +52,6 @@ AlongsidePage::AlongsidePage( QWidget* parent ) mainLayout->addLayout( partitionsComboLayout ); QLabel* partitionsLabel = new QLabel; - partitionsLabel->setText( tr( "Choose partition to shrink:" ) ); partitionsComboLayout->addWidget( partitionsLabel ); m_partitionsComboBox = new QComboBox; @@ -60,7 +60,13 @@ AlongsidePage::AlongsidePage( QWidget* parent ) partitionsComboLayout->addStretch(); - mainLayout->addWidget( new QLabel( tr( "Allocate drive space by dragging the divider below:" ) ) ); + QLabel* allocateSpaceLabel = new QLabel(); + mainLayout->addWidget( allocateSpaceLabel ); + + CALAMARES_RETRANSLATE( + partitionsLabel->setText( tr( "Choose partition to shrink:" ) ); + allocateSpaceLabel->setText( tr( "Allocate drive space by dragging the divider below:" ) ); + ) m_splitterWidget = new PartitionSplitterWidget; mainLayout->addWidget( m_splitterWidget ); diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 396293284..c1e294528 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -27,6 +27,7 @@ #include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" +#include "utils/Retranslator.h" #include "Branding.h" #include @@ -102,14 +103,16 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn if ( osproberEntries.count() == 0 ) { - m_messageLabel->setText( tr( "This computer currently does not seem to have an operating system on it. " - "What would you like to do?" ) ); + CALAMARES_RETRANSLATE( + m_messageLabel->setText( tr( "This computer currently does not seem to have an operating system on it. " + "What would you like to do?" ) ); - eraseButton->setText( tr( "Erase disk and install %1
" - "Warning: This will delete all of your programs, " - "documents, photos, music, and any other files." ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::VersionedName ) ) ); + eraseButton->setText( tr( "Erase disk and install %1
" + "Warning: This will delete all of your programs, " + "documents, photos, music, and any other files." ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::VersionedName ) ) ); + ) alongsideButton->hide(); } @@ -119,43 +122,47 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn if ( !osName.isEmpty() ) { - m_messageLabel->setText( tr( "This computer currently has %1 on it. " - "What would you like to do?" ) - .arg( osName ) ); - - alongsideButton->setText( tr( "Install %2 alongside %1
" - "Documents, music and other personal files will be kept. " - "You can choose which operating system you want each time the " - "computer starts up." ) + CALAMARES_RETRANSLATE( + m_messageLabel->setText( tr( "This computer currently has %1 on it. " + "What would you like to do?" ) + .arg( osName ) ); + + alongsideButton->setText( tr( "Install %2 alongside %1
" + "Documents, music and other personal files will be kept. " + "You can choose which operating system you want each time the " + "computer starts up." ) + .arg( osName ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::VersionedName ) ) ); + + eraseButton->setText( tr( "Replace %1 with %2
" + "Warning: This will erase the whole disk and " + "delete all of your %1 programs, " + "documents, photos, music, and any other files." ) .arg( osName ) .arg( Calamares::Branding::instance()-> string( Calamares::Branding::VersionedName ) ) ); - - eraseButton->setText( tr( "Replace %1 with %2
" - "Warning: This will erase the whole disk and " - "delete all of your %1 programs, " - "documents, photos, music, and any other files." ) - .arg( osName ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::VersionedName ) ) ); + ) } else { - m_messageLabel->setText( tr( "This computer already has an operating system on it. " - "What would you like to do?" ) ); - - alongsideButton->setText( tr( "Install %1 alongside your current operating system
" - "Documents, music and other personal files will be kept. " - "You can choose which operating system you want each time the " - "computer starts up." ) + CALAMARES_RETRANSLATE( + m_messageLabel->setText( tr( "This computer already has an operating system on it. " + "What would you like to do?" ) ); + + alongsideButton->setText( tr( "Install %1 alongside your current operating system
" + "Documents, music and other personal files will be kept. " + "You can choose which operating system you want each time the " + "computer starts up." ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::VersionedName ) ) ); + + eraseButton->setText( tr( "Erase disk and install %1
" + "Warning: This will delete all of your Windows 7 programs, " + "documents, photos, music, and any other files." ) .arg( Calamares::Branding::instance()-> string( Calamares::Branding::VersionedName ) ) ); - - eraseButton->setText( tr( "Erase disk and install %1
" - "Warning: This will delete all of your Windows 7 programs, " - "documents, photos, music, and any other files." ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::VersionedName ) ) ); + ) } if ( !osproberEntries.first().canBeResized ) alongsideButton->hide(); @@ -175,21 +182,23 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn } } - m_messageLabel->setText( tr( "This computer currently has multiple operating systems on it. " - "What would you like to do?" ) ); + CALAMARES_RETRANSLATE( + m_messageLabel->setText( tr( "This computer currently has multiple operating systems on it. " + "What would you like to do?" ) ); + + alongsideButton->setText( tr( "Install %1 alongside your current operating systems
" + "Documents, music and other personal files will be kept. " + "You can choose which operating system you want each time the " + "computer starts up." ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::VersionedName ) ) ); - alongsideButton->setText( tr( "Install %1 alongside your current operating systems
" - "Documents, music and other personal files will be kept. " - "You can choose which operating system you want each time the " - "computer starts up." ) + eraseButton->setText( tr( "Erase disk and install %1
" + "Warning: This will delete all of your Windows 7 programs, " + "documents, photos, music, and any other files." ) .arg( Calamares::Branding::instance()-> string( Calamares::Branding::VersionedName ) ) ); - - eraseButton->setText( tr( "Erase disk and install %1
" - "Warning: This will delete all of your Windows 7 programs, " - "documents, photos, music, and any other files." ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::VersionedName ) ) ); + ) if ( !atLeastOneCanBeResized ) alongsideButton->hide(); @@ -200,11 +209,13 @@ ChoicePage::init( PartitionCoreModule* core, const OsproberEntryList& osproberEn m_itemsLayout->addWidget( hLine ); PrettyRadioButton* somethingElseButton = new PrettyRadioButton; - somethingElseButton->setText( tr( "Something else
" - "You can create or resize partitions yourself, or choose " - "multiple partitions for %1." ) - .arg( Calamares::Branding::instance()-> - string( Calamares::Branding::ShortVersionedName ) ) ); + CALAMARES_RETRANSLATE( + somethingElseButton->setText( tr( "Something else
" + "You can create or resize partitions yourself, or choose " + "multiple partitions for %1." ) + .arg( Calamares::Branding::instance()-> + string( Calamares::Branding::ShortVersionedName ) ) ); + ) somethingElseButton->setIconSize( iconSize ); somethingElseButton->setIcon( CalamaresUtils::defaultPixmap( CalamaresUtils::Partitions, CalamaresUtils::Original, diff --git a/src/modules/partition/gui/EraseDiskPage.cpp b/src/modules/partition/gui/EraseDiskPage.cpp index e2aaef9b8..86a1dff3d 100644 --- a/src/modules/partition/gui/EraseDiskPage.cpp +++ b/src/modules/partition/gui/EraseDiskPage.cpp @@ -29,6 +29,7 @@ #include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" +#include "utils/Retranslator.h" #include #include @@ -44,8 +45,9 @@ EraseDiskPage::EraseDiskPage( QWidget* parent ) QVBoxLayout* mainLayout = new QVBoxLayout; setLayout( mainLayout ); - QLabel* driveLabel = new QLabel( tr( "Select drive:" ) ); + QLabel* driveLabel = new QLabel( this ); mainLayout->addWidget( driveLabel ); + CALAMARES_RETRANSLATE( driveLabel->setText( tr( "Select drive:" ) ); ) m_drivesView = new QListView; mainLayout->addWidget( m_drivesView ); diff --git a/src/modules/partition/gui/PartitionPage.cpp b/src/modules/partition/gui/PartitionPage.cpp index c4bc58f17..175ad0f47 100644 --- a/src/modules/partition/gui/PartitionPage.cpp +++ b/src/modules/partition/gui/PartitionPage.cpp @@ -34,6 +34,8 @@ #include #include +#include "utils/Retranslator.h" + // Qt #include #include @@ -74,6 +76,8 @@ PartitionPage::PartitionPage( PartitionCoreModule* core, QWidget* parent ) connect( m_ui->createButton, &QAbstractButton::clicked, this, &PartitionPage::onCreateClicked ); connect( m_ui->editButton, &QAbstractButton::clicked, this, &PartitionPage::onEditClicked ); connect( m_ui->deleteButton, &QAbstractButton::clicked, this, &PartitionPage::onDeleteClicked ); + + CALAMARES_RETRANSLATE( m_ui->retranslateUi( this ); ) } PartitionPage::~PartitionPage() diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index 0711c6f80..8dad7c1e8 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -34,6 +34,7 @@ #include "CalamaresVersion.h" #include "utils/CalamaresUtilsGui.h" #include "utils/Logger.h" +#include "utils/Retranslator.h" #include "widgets/WaitingWidget.h" #include "GlobalStorage.h" #include "JobQueue.h" @@ -57,8 +58,9 @@ PartitionViewStep::PartitionViewStep( QObject* parent ) { m_widget->setContentsMargins( 0, 0, 0, 0 ); - QWidget* waitingWidget = new WaitingWidget( tr( "Gathering system information..." ) ); + WaitingWidget* waitingWidget = new WaitingWidget( QString() ); m_widget->addWidget( waitingWidget ); + CALAMARES_RETRANSLATE( waitingWidget->setText( tr( "Gathering system information..." ) ); ) QTimer* timer = new QTimer; timer->setSingleShot( true );