From 37178b22739783185a6c706d67e6339b0c37e563 Mon Sep 17 00:00:00 2001 From: Emir SARI Date: Tue, 31 Oct 2023 14:37:13 +0300 Subject: [PATCH] Improve context --- src/modules/finished/Config.cpp | 14 ++++---- src/modules/finished/FinishedPage.cpp | 12 +++---- src/modules/finished/FinishedViewStep.cpp | 2 +- src/modules/finishedq/FinishedQmlViewStep.cpp | 2 +- src/modules/finishedq/finishedq-qt6.qml | 11 +++--- src/modules/finishedq/finishedq@mobile.qml | 9 ++--- src/modules/fsresizer/ResizeFSJob.cpp | 36 +++++++++---------- src/modules/hostinfo/HostInfoJob.cpp | 2 +- src/modules/initcpio/InitcpioJob.cpp | 2 +- src/modules/initramfs/InitramfsJob.cpp | 2 +- .../InteractiveTerminalPage.cpp | 6 ++-- .../InteractiveTerminalViewStep.cpp | 2 +- src/modules/keyboard/Config.cpp | 4 +-- src/modules/keyboard/KeyboardPage.ui | 4 +-- src/modules/keyboard/KeyboardViewStep.cpp | 2 +- src/modules/keyboard/SetKeyboardLayoutJob.cpp | 15 ++++---- src/modules/keyboardq/KeyboardQmlViewStep.cpp | 2 +- src/modules/keyboardq/keyboardq-qt6.qml | 10 +++--- src/modules/keyboardq/keyboardq.qml | 10 +++--- src/modules/license/LicensePage.cpp | 12 +++---- src/modules/license/LicenseViewStep.cpp | 2 +- src/modules/license/LicenseWidget.cpp | 20 +++++------ src/modules/locale/Config.cpp | 6 ++-- src/modules/locale/LCLocaleDialog.cpp | 8 ++--- src/modules/locale/LocalePage.cpp | 8 ++--- src/modules/locale/LocaleViewStep.cpp | 2 +- src/modules/locale/SetTimezoneJob.cpp | 14 ++++---- src/modules/localeq/LocaleQmlViewStep.cpp | 2 +- src/modules/localeq/Map-qt6.qml | 4 +-- src/modules/localeq/Map.qml | 4 +-- src/modules/localeq/Offline-qt6.qml | 14 ++++---- src/modules/localeq/Offline.qml | 14 ++++---- src/modules/localeq/localeq-qt6.qml | 8 ++--- src/modules/localeq/localeq.qml | 8 ++--- 34 files changed, 138 insertions(+), 135 deletions(-) diff --git a/src/modules/finished/Config.cpp b/src/modules/finished/Config.cpp index 36f4a0bae..136717f31 100644 --- a/src/modules/finished/Config.cpp +++ b/src/modules/finished/Config.cpp @@ -139,17 +139,17 @@ Config::doNotify( bool hasFailed, bool sendAnyway ) QString message; if ( hasFailed ) { - title = Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Failed" ) : tr( "Installation Failed" ); + title = Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Failed", "@title" ) : tr( "Installation Failed", "@title" ); message = Calamares::Settings::instance()->isSetupMode() - ? tr( "The setup of %1 did not complete successfully." ) - : tr( "The installation of %1 did not complete successfully." ); + ? tr( "The setup of %1 did not complete successfully.", "@info" ) + : tr( "The installation of %1 did not complete successfully.", "@info" ); } else { - title = Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Complete" ) - : tr( "Installation Complete" ); - message = Calamares::Settings::instance()->isSetupMode() ? tr( "The setup of %1 is complete." ) - : tr( "The installation of %1 is complete." ); + title = Calamares::Settings::instance()->isSetupMode() ? tr( "Setup Complete", "@title" ) + : tr( "Installation Complete", "@title" ); + message = Calamares::Settings::instance()->isSetupMode() ? tr( "The setup of %1 is complete.", "@info" ) + : tr( "The installation of %1 is complete.", "@info" ); } const auto* branding = Calamares::Branding::instance(); diff --git a/src/modules/finished/FinishedPage.cpp b/src/modules/finished/FinishedPage.cpp index 949c5f64c..23cb194c4 100644 --- a/src/modules/finished/FinishedPage.cpp +++ b/src/modules/finished/FinishedPage.cpp @@ -74,26 +74,26 @@ FinishedPage::retranslate() { ui->mainText->setText( tr( "

All done.


" "%1 has been set up on your computer.
" - "You may now start using your new system." ) + "You may now start using your new system.", "@info" ) .arg( branding->versionedName() ) ); ui->restartCheckBox->setToolTip( tr( "" "

When this box is checked, your system will " "restart immediately when you click on " "Done " - "or close the setup program.

" ) ); + "or close the setup program.

", "@tooltip" ) ); } else { ui->mainText->setText( tr( "

All done.


" "%1 has been installed on your computer.
" "You may now restart into your new system, or continue " - "using the %2 Live environment." ) + "using the %2 Live environment.", "@info" ) .arg( branding->versionedName(), branding->productName() ) ); ui->restartCheckBox->setToolTip( tr( "" "

When this box is checked, your system will " "restart immediately when you click on " "Done " - "or close the installer.

" ) ); + "or close the installer.

", "@tooltip" ) ); } } else @@ -104,7 +104,7 @@ FinishedPage::retranslate() { ui->mainText->setText( tr( "

Setup Failed


" "%1 has not been set up on your computer.
" - "The error message was: %2." ) + "The error message was: %2.", "@info, %1 is product name with version" ) .arg( branding->versionedName() ) .arg( message ) ); } @@ -112,7 +112,7 @@ FinishedPage::retranslate() { ui->mainText->setText( tr( "

Installation Failed


" "%1 has not been installed on your computer.
" - "The error message was: %2." ) + "The error message was: %2.", "@info, %1 is product name with version" ) .arg( branding->versionedName() ) .arg( message ) ); } diff --git a/src/modules/finished/FinishedViewStep.cpp b/src/modules/finished/FinishedViewStep.cpp index 5ba9c1897..6fe1687ad 100644 --- a/src/modules/finished/FinishedViewStep.cpp +++ b/src/modules/finished/FinishedViewStep.cpp @@ -43,7 +43,7 @@ FinishedViewStep::~FinishedViewStep() QString FinishedViewStep::prettyName() const { - return tr( "Finish" ); + return tr( "Finish", "@label" ); } diff --git a/src/modules/finishedq/FinishedQmlViewStep.cpp b/src/modules/finishedq/FinishedQmlViewStep.cpp index 531d7380e..bf605acf7 100644 --- a/src/modules/finishedq/FinishedQmlViewStep.cpp +++ b/src/modules/finishedq/FinishedQmlViewStep.cpp @@ -32,7 +32,7 @@ FinishedQmlViewStep::FinishedQmlViewStep( QObject* parent ) QString FinishedQmlViewStep::prettyName() const { - return tr( "Finish" ); + return tr( "Finish", "@label" ); } bool diff --git a/src/modules/finishedq/finishedq-qt6.qml b/src/modules/finishedq/finishedq-qt6.qml index bbd5428e7..885a66f0d 100644 --- a/src/modules/finishedq/finishedq-qt6.qml +++ b/src/modules/finishedq/finishedq-qt6.qml @@ -32,7 +32,7 @@ Page { horizontalAlignment: Qt.AlignHCenter color: Kirigami.Theme.textColor level: 1 - text: qsTr("Installation Completed") + text: qsTr("Installation Completed", "@title") Text { anchors.top: header.bottom @@ -40,7 +40,8 @@ Page { horizontalAlignment: Text.AlignHCenter font.pointSize: 12 text: qsTr("%1 has been installed on your computer.
- You may now restart into your new system, or continue using the Live environment.").arg(Branding.string(Branding.ProductName)) + You may now restart into your new system, or continue using the Live environment.", "@info, %1 is the product name") + .arg(Branding.string(Branding.ProductName)) } Image { @@ -61,13 +62,13 @@ Page { Button { id: button - text: qsTr("Close Installer") + text: qsTr("Close Installer", "@button") icon.name: "application-exit" onClicked: { ViewManager.quit(); } } Button { - text: qsTr("Restart System") + text: qsTr("Restart System", "@button") icon.name: "system-reboot" onClicked: { config.doRestart(true); } } @@ -86,7 +87,7 @@ Page { anchors.top: parent.top horizontalAlignment: Text.AlignHCenter text: qsTr("

A full log of the install is available as installation.log in the home directory of the Live user.
- This log is copied to /var/log/installation.log of the target system.

") + This log is copied to /var/log/installation.log of the target system.

", "@info") } } diff --git a/src/modules/finishedq/finishedq@mobile.qml b/src/modules/finishedq/finishedq@mobile.qml index d1ed7d1b0..2e6fe0492 100644 --- a/src/modules/finishedq/finishedq@mobile.qml +++ b/src/modules/finishedq/finishedq@mobile.qml @@ -33,7 +33,7 @@ Page { horizontalAlignment: Qt.AlignHCenter color: Kirigami.Theme.textColor level: 1 - text: qsTr("Installation Completed") + text: qsTr("Installation Completed", "@title") Text { anchors.top: header.bottom @@ -41,7 +41,8 @@ Page { horizontalAlignment: Text.AlignHCenter font.pointSize: 12 text: qsTr("%1 has been installed on your computer.
- You may now restart your device.").arg(Branding.string(Branding.ProductName)) + You may now restart your device.", "@info, %1 is the product name") + .arg(Branding.string(Branding.ProductName)) } Image { @@ -62,13 +63,13 @@ Page { Button { id: button - text: qsTr("Close") + text: qsTr("Close", "@button") icon.name: "application-exit" onClicked: { ViewManager.quit(); } } Button { - text: qsTr("Restart") + text: qsTr("Restart", "@button") icon.name: "system-reboot" onClicked: { config.doRestart(true); } } diff --git a/src/modules/fsresizer/ResizeFSJob.cpp b/src/modules/fsresizer/ResizeFSJob.cpp index 3b90c04b8..e3f2fef30 100644 --- a/src/modules/fsresizer/ResizeFSJob.cpp +++ b/src/modules/fsresizer/ResizeFSJob.cpp @@ -40,7 +40,7 @@ ResizeFSJob::~ResizeFSJob() {} QString ResizeFSJob::prettyName() const { - return tr( "Resize Filesystem Job" ); + return tr( "Performing file system resize…", "@status" ); } ResizeFSJob::PartitionMatch @@ -159,15 +159,15 @@ ResizeFSJob::exec() if ( !isValid() ) { return Calamares::JobResult::error( - tr( "Invalid configuration" ), - tr( "The file-system resize job has an invalid configuration and will not run." ) ); + tr( "Invalid configuration", "@error" ), + tr( "The file-system resize job has an invalid configuration and will not run.", "@error" ) ); } if ( !m_kpmcore ) { cWarning() << "Could not load KPMCore backend (2)."; - return Calamares::JobResult::error( tr( "KPMCore not Available" ), - tr( "Calamares cannot start KPMCore for the file-system resize job." ) ); + return Calamares::JobResult::error( tr( "KPMCore not available", "@error" ), + tr( "Calamares cannot start KPMCore for the file system resize job.", "@error" ) ); } m_kpmcore.backend()->initFSSupport(); // Might not be enough, see below @@ -176,20 +176,20 @@ ResizeFSJob::exec() if ( !m.first || !m.second ) { return Calamares::JobResult::error( - tr( "Resize Failed" ), + tr( "Resize failed.", "@error" ), !m_fsname.isEmpty() - ? tr( "The filesystem %1 could not be found in this system, and cannot be resized." ).arg( m_fsname ) - : tr( "The device %1 could not be found in this system, and cannot be resized." ).arg( m_devicename ) ); + ? tr( "The filesystem %1 could not be found in this system, and cannot be resized.", "@info" ).arg( m_fsname ) + : tr( "The device %1 could not be found in this system, and cannot be resized.", "@info" ).arg( m_devicename ) ); } m.second->fileSystem().init(); // Initialize support for specific FS if ( !ResizeOperation::canGrow( m.second ) ) { cDebug() << "canGrow() returned false."; - return Calamares::JobResult::error( tr( "Resize Failed" ), + return Calamares::JobResult::error( tr( "Resize Failed", "@error" ), !m_fsname.isEmpty() - ? tr( "The filesystem %1 cannot be resized." ).arg( m_fsname ) - : tr( "The device %1 cannot be resized." ).arg( m_devicename ) ); + ? tr( "The filesystem %1 cannot be resized.", "@error" ).arg( m_fsname ) + : tr( "The device %1 cannot be resized.", "@error" ).arg( m_devicename ) ); } qint64 new_end = findGrownEnd( m ); @@ -198,10 +198,10 @@ ResizeFSJob::exec() if ( new_end < 0 ) { - return Calamares::JobResult::error( tr( "Resize Failed" ), + return Calamares::JobResult::error( tr( "Resize Failed", "@error" ), !m_fsname.isEmpty() - ? tr( "The filesystem %1 cannot be resized." ).arg( m_fsname ) - : tr( "The device %1 cannot be resized." ).arg( m_devicename ) ); + ? tr( "The filesystem %1 cannot be resized.", "@error" ).arg( m_fsname ) + : tr( "The device %1 cannot be resized.", "@error" ).arg( m_devicename ) ); } if ( new_end == 0 ) { @@ -209,9 +209,9 @@ ResizeFSJob::exec() if ( m_required ) { return Calamares::JobResult::error( - tr( "Resize Failed" ), - !m_fsname.isEmpty() ? tr( "The filesystem %1 must be resized, but cannot." ).arg( m_fsname ) - : tr( "The device %1 must be resized, but cannot" ).arg( m_fsname ) ); + tr( "Resize Failed", "@error" ), + !m_fsname.isEmpty() ? tr( "The file system %1 must be resized, but cannot.", "@info" ).arg( m_fsname ) + : tr( "The device %1 must be resized, but cannot", "@info" ).arg( m_fsname ) ); } return Calamares::JobResult::ok(); @@ -228,7 +228,7 @@ ResizeFSJob::exec() else { cDebug() << "Resize failed." << op_report.output(); - return Calamares::JobResult::error( tr( "Resize Failed" ), op_report.toText() ); + return Calamares::JobResult::error( tr( "Resize Failed", "@error" ), op_report.toText() ); } } diff --git a/src/modules/hostinfo/HostInfoJob.cpp b/src/modules/hostinfo/HostInfoJob.cpp index 40dbdc531..d09de3ae2 100644 --- a/src/modules/hostinfo/HostInfoJob.cpp +++ b/src/modules/hostinfo/HostInfoJob.cpp @@ -36,7 +36,7 @@ HostInfoJob::~HostInfoJob() {} QString HostInfoJob::prettyName() const { - return tr( "Collecting information about your machine." ); + return tr( "Collecting information about your machine…", "@status" ); } QString diff --git a/src/modules/initcpio/InitcpioJob.cpp b/src/modules/initcpio/InitcpioJob.cpp index 91520d9b3..ad569fa5a 100644 --- a/src/modules/initcpio/InitcpioJob.cpp +++ b/src/modules/initcpio/InitcpioJob.cpp @@ -28,7 +28,7 @@ InitcpioJob::~InitcpioJob() {} QString InitcpioJob::prettyName() const { - return tr( "Creating initramfs with mkinitcpio." ); + return tr( "Creating initramfs with mkinitcpio…", "@status" ); } /** @brief Sets secure permissions on each initramfs diff --git a/src/modules/initramfs/InitramfsJob.cpp b/src/modules/initramfs/InitramfsJob.cpp index 56e6e0383..f61679fe5 100644 --- a/src/modules/initramfs/InitramfsJob.cpp +++ b/src/modules/initramfs/InitramfsJob.cpp @@ -24,7 +24,7 @@ InitramfsJob::~InitramfsJob() {} QString InitramfsJob::prettyName() const { - return tr( "Creating initramfs." ); + return tr( "Creating initramfs…", "@status" ); } Calamares::JobResult diff --git a/src/modules/interactiveterminal/InteractiveTerminalPage.cpp b/src/modules/interactiveterminal/InteractiveTerminalPage.cpp index 46bc6d831..2e6440569 100644 --- a/src/modules/interactiveterminal/InteractiveTerminalPage.cpp +++ b/src/modules/interactiveterminal/InteractiveTerminalPage.cpp @@ -46,8 +46,8 @@ void InteractiveTerminalPage::errorKonsoleNotInstalled() { QMessageBox mb( QMessageBox::Critical, - tr( "Konsole not installed" ), - tr( "Please install KDE Konsole and try again!" ), + tr( "Konsole not installed.", "@error" ), + tr( "Please install KDE Konsole and try again!", "@info" ), QMessageBox::Ok ); Calamares::fixButtonLabels( &mb ); mb.exec(); @@ -119,5 +119,5 @@ InteractiveTerminalPage::setCommand( const QString& command ) { m_command = command; CALAMARES_RETRANSLATE( - m_headerLabel->setText( tr( "Executing script:  %1" ).arg( m_command ) ); ); + m_headerLabel->setText( tr( "Executing script:  %1", "@info" ).arg( m_command ) ); ); } diff --git a/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp b/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp index 9b47e44bc..6f0457f38 100644 --- a/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp +++ b/src/modules/interactiveterminal/InteractiveTerminalViewStep.cpp @@ -37,7 +37,7 @@ InteractiveTerminalViewStep::~InteractiveTerminalViewStep() QString InteractiveTerminalViewStep::prettyName() const { - return tr( "Script" ); + return tr( "Script", "@label" ); } QWidget* diff --git a/src/modules/keyboard/Config.cpp b/src/modules/keyboard/Config.cpp index 8fa549bf9..d8b1e8e86 100644 --- a/src/modules/keyboard/Config.cpp +++ b/src/modules/keyboard/Config.cpp @@ -502,14 +502,14 @@ QString Config::prettyStatus() const { QString status; - status += tr( "Set keyboard model to %1.
" ) + status += tr( "Keyboard model has been set to %1
.", "@label, %1 is keyboard model, as in Apple Magic Keyboard" ) .arg( m_keyboardModelsModel->label( m_keyboardModelsModel->currentIndex() ) ); QString layout = m_keyboardLayoutsModel->item( m_keyboardLayoutsModel->currentIndex() ).second.description; QString variant = m_keyboardVariantsModel->currentIndex() >= 0 ? m_keyboardVariantsModel->label( m_keyboardVariantsModel->currentIndex() ) : QString( "" ); - status += tr( "Set keyboard layout to %1/%2." ).arg( layout, variant ); + status += tr( "Keyboard layout has been set to %1/%2.", "@label, %1 is layout, %2 is layout variant" ).arg( layout, variant ); return status; } diff --git a/src/modules/keyboard/KeyboardPage.ui b/src/modules/keyboard/KeyboardPage.ui index 7d30655f0..f57040a65 100644 --- a/src/modules/keyboard/KeyboardPage.ui +++ b/src/modules/keyboard/KeyboardPage.ui @@ -71,7 +71,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - Keyboard Model: + Keyboard model: @@ -150,7 +150,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - Keyboard Switch: + Keyboard switch: diff --git a/src/modules/keyboard/KeyboardViewStep.cpp b/src/modules/keyboard/KeyboardViewStep.cpp index bd7f2db35..3eaf4dcc5 100644 --- a/src/modules/keyboard/KeyboardViewStep.cpp +++ b/src/modules/keyboard/KeyboardViewStep.cpp @@ -38,7 +38,7 @@ KeyboardViewStep::~KeyboardViewStep() QString KeyboardViewStep::prettyName() const { - return tr( "Keyboard" ); + return tr( "Keyboard", "@label" ); } diff --git a/src/modules/keyboard/SetKeyboardLayoutJob.cpp b/src/modules/keyboard/SetKeyboardLayoutJob.cpp index a30cb8dcb..be2adbb77 100644 --- a/src/modules/keyboard/SetKeyboardLayoutJob.cpp +++ b/src/modules/keyboard/SetKeyboardLayoutJob.cpp @@ -63,7 +63,8 @@ SetKeyboardLayoutJob::SetKeyboardLayoutJob( const QString& model, QString SetKeyboardLayoutJob::prettyName() const { - return tr( "Set keyboard model to %1, layout to %2-%3" ).arg( m_model ).arg( m_layout ).arg( m_variant ); + return tr( "Setting keyboard model to %1, layout as %2-%3…", "@status, %1 model, %2 layout, %3 variant" ) + .arg( m_model ).arg( m_layout ).arg( m_variant ); } @@ -364,8 +365,8 @@ SetKeyboardLayoutJob::exec() if ( !writeVConsoleData( vconsoleConfPath, convertedKeymapPath ) ) { - return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for the virtual console." ), - tr( "Failed to write to %1" ).arg( vconsoleConfPath ) ); + return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for the virtual console.", "@error" ), + tr( "Failed to write to %1", "@error, %1 is virtual console configuration path" ).arg( vconsoleConfPath ) ); } // Get the path to the destination's /etc/X11/xorg.conf.d/00-keyboard.conf @@ -390,8 +391,8 @@ SetKeyboardLayoutJob::exec() if ( !writeX11Data( keyboardConfPath ) ) { - return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for X11." ), - tr( "Failed to write to %1" ).arg( keyboardConfPath ) ); + return Calamares::JobResult::error( tr( "Failed to write keyboard configuration for X11.", "@error" ), + tr( "Failed to write to %1", "@error, %1 is keyboard configuration path" ).arg( keyboardConfPath ) ); } } @@ -407,8 +408,8 @@ SetKeyboardLayoutJob::exec() if ( !writeDefaultKeyboardData( defaultKeyboardPath ) ) { return Calamares::JobResult::error( - tr( "Failed to write keyboard configuration to existing /etc/default directory." ), - tr( "Failed to write to %1" ).arg( defaultKeyboardPath ) ); + tr( "Failed to write keyboard configuration to existing /etc/default directory.", "@error" ), + tr( "Failed to write to %1", "@error, %1 is default keyboard path" ).arg( defaultKeyboardPath ) ); } } } diff --git a/src/modules/keyboardq/KeyboardQmlViewStep.cpp b/src/modules/keyboardq/KeyboardQmlViewStep.cpp index 231d2a090..f63d03b81 100644 --- a/src/modules/keyboardq/KeyboardQmlViewStep.cpp +++ b/src/modules/keyboardq/KeyboardQmlViewStep.cpp @@ -29,7 +29,7 @@ KeyboardQmlViewStep::KeyboardQmlViewStep( QObject* parent ) QString KeyboardQmlViewStep::prettyName() const { - return tr( "Keyboard" ); + return tr( "Keyboard", "@label" ); } QString diff --git a/src/modules/keyboardq/keyboardq-qt6.qml b/src/modules/keyboardq/keyboardq-qt6.qml index a969140e9..d0b1f8517 100644 --- a/src/modules/keyboardq/keyboardq-qt6.qml +++ b/src/modules/keyboardq/keyboardq-qt6.qml @@ -58,7 +58,7 @@ Item { Label { id: header anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("To activate keyboard preview, select a layout.") + text: qsTr("Select a layout to activate keyboard preview", "@label") color: textColor font.bold: true } @@ -141,7 +141,7 @@ Item { } Text { anchors.centerIn: parent - text: qsTr("Keyboard Model:  ") + models.currentItem.currentModel.label + text: qsTr("Keyboard model:  ", "@label") + models.currentItem.currentModel.label color: textColor } Image { @@ -182,7 +182,7 @@ Item { z: 2 color:backgroundColor Text { - text: qsTr("Layout") + text: qsTr("Layout", "@label") anchors.centerIn: parent color: textColor font.bold: true @@ -255,7 +255,7 @@ Item { z: 2 color:backgroundColor Text { - text: qsTr("Variant") + text: qsTr("Variant", "@label") anchors.centerIn: parent color: textColor font.bold: true @@ -308,7 +308,7 @@ Item { TextField { id: textInput - placeholderText: qsTr("Type here to test your keyboard") + placeholderText: qsTr("Type here to test your keyboard…", "@label") height: 36 width: parent.width / 1.6 horizontalAlignment: TextInput.AlignHCenter diff --git a/src/modules/keyboardq/keyboardq.qml b/src/modules/keyboardq/keyboardq.qml index 70ddeed25..ad83a996f 100644 --- a/src/modules/keyboardq/keyboardq.qml +++ b/src/modules/keyboardq/keyboardq.qml @@ -58,7 +58,7 @@ Item { Label { id: header anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("To activate keyboard preview, select a layout.") + text: qsTr("Select a layout to activate keyboard preview", "@label") color: textColor font.bold: true } @@ -141,7 +141,7 @@ Item { } Text { anchors.centerIn: parent - text: qsTr("Keyboard Model:  ") + models.currentItem.currentModel.label + text: qsTr("Keyboard model:  ", "@label") + models.currentItem.currentModel.label color: textColor } Image { @@ -182,7 +182,7 @@ Item { z: 2 color:backgroundColor Text { - text: qsTr("Layout") + text: qsTr("Layout", "@label") anchors.centerIn: parent color: textColor font.bold: true @@ -255,7 +255,7 @@ Item { z: 2 color:backgroundColor Text { - text: qsTr("Variant") + text: qsTr("Variant", "@label") anchors.centerIn: parent color: textColor font.bold: true @@ -308,7 +308,7 @@ Item { TextField { id: textInput - placeholderText: qsTr("Type here to test your keyboard") + placeholderText: qsTr("Type here to test your keyboard…", "@label") height: 36 width: parent.width / 1.6 horizontalAlignment: TextInput.AlignHCenter diff --git a/src/modules/license/LicensePage.cpp b/src/modules/license/LicensePage.cpp index 4331c1371..185ed615d 100644 --- a/src/modules/license/LicensePage.cpp +++ b/src/modules/license/LicensePage.cpp @@ -139,17 +139,17 @@ LicensePage::setEntries( const QList< LicenseEntry >& entriesList ) void LicensePage::retranslate() { - ui->acceptCheckBox->setText( tr( "I accept the terms and conditions above." ) ); + ui->acceptCheckBox->setText( tr( "I accept the terms and conditions above.", "@info" ) ); - QString review = tr( "Please review the End User License Agreements (EULAs)." ); + QString review = tr( "Please review the End User License Agreements (EULAs).", "@info" ); const auto br = QStringLiteral( "
" ); if ( !m_allLicensesOptional ) { ui->mainText->setText( tr( "This setup procedure will install proprietary " - "software that is subject to licensing terms." ) + "software that is subject to licensing terms.", "@info" ) + br + review ); - QString mustAcceptText( tr( "If you do not agree with the terms, the setup procedure cannot continue." ) ); + QString mustAcceptText( tr( "If you do not agree with the terms, the setup procedure cannot continue.", "@info" ) ); ui->acceptCheckBox->setToolTip( mustAcceptText ); } else @@ -157,10 +157,10 @@ LicensePage::retranslate() ui->mainText->setText( tr( "This setup procedure can install proprietary " "software that is subject to licensing terms " "in order to provide additional features and enhance the user " - "experience." ) + "experience.", "@info" ) + br + review ); QString okAcceptText( tr( "If you do not agree with the terms, proprietary software will not " - "be installed, and open source alternatives will be used instead." ) ); + "be installed, and open source alternatives will be used instead.", "@info" ) ); ui->acceptCheckBox->setToolTip( okAcceptText ); } ui->retranslateUi( this ); diff --git a/src/modules/license/LicenseViewStep.cpp b/src/modules/license/LicenseViewStep.cpp index 27612ffc9..52305c34f 100644 --- a/src/modules/license/LicenseViewStep.cpp +++ b/src/modules/license/LicenseViewStep.cpp @@ -42,7 +42,7 @@ LicenseViewStep::~LicenseViewStep() QString LicenseViewStep::prettyName() const { - return tr( "License" ); + return tr( "License", "@label" ); } diff --git a/src/modules/license/LicenseWidget.cpp b/src/modules/license/LicenseWidget.cpp index a8d581ab5..4fa59cfd7 100644 --- a/src/modules/license/LicenseWidget.cpp +++ b/src/modules/license/LicenseWidget.cpp @@ -85,7 +85,7 @@ LicenseWidget::LicenseWidget( LicenseEntry entry, QWidget* parent ) } else { - m_licenceTextLabel->setText( tr( "URL: %1" ).arg( m_entry.m_url.toDisplayString() ) ); + m_licenceTextLabel->setText( tr( "URL: %1", "@label" ).arg( m_entry.m_url.toDisplayString() ) ); connect( m_viewLicenseButton, &QAbstractButton::clicked, this, &LicenseWidget::viewClicked ); } m_licenceTextLabel->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); @@ -107,38 +107,38 @@ LicenseWidget::retranslateUi() case LicenseEntry::Type::Driver: //: %1 is an untranslatable product name, example: Creative Audigy driver productDescription = tr( "%1 driver
" - "by %2" ) + "by %2", "@label, %1 is product name, %2 is product vendor" ) .arg( m_entry.m_prettyName ) .arg( m_entry.m_prettyVendor ); break; case LicenseEntry::Type::GpuDriver: //: %1 is usually a vendor name, example: Nvidia graphics driver productDescription = tr( "%1 graphics driver
" - "by %2" ) + "by %2", "@label, %1 is product name, %2 is product vendor" ) .arg( m_entry.m_prettyName ) .arg( m_entry.m_prettyVendor ); break; case LicenseEntry::Type::BrowserPlugin: productDescription = tr( "%1 browser plugin
" - "by %2" ) + "by %2", "@label, %1 is product name, %2 is product vendor" ) .arg( m_entry.m_prettyName ) .arg( m_entry.m_prettyVendor ); break; case LicenseEntry::Type::Codec: productDescription = tr( "%1 codec
" - "by %2" ) + "by %2", "@label, %1 is product name, %2 is product vendor" ) .arg( m_entry.m_prettyName ) .arg( m_entry.m_prettyVendor ); break; case LicenseEntry::Type::Package: productDescription = tr( "%1 package
" - "by %2" ) + "by %2", "@label, %1 is product name, %2 is product vendor" ) .arg( m_entry.m_prettyName ) .arg( m_entry.m_prettyVendor ); break; case LicenseEntry::Type::Software: productDescription = tr( "%1
" - "by %2" ) + "by %2", "@label, %1 is product name, %2 is product vendor" ) .arg( m_entry.m_prettyName ) .arg( m_entry.m_prettyVendor ); } @@ -160,7 +160,7 @@ LicenseWidget::showLocalLicenseText() { fileName = fileName.remove( 0, 5 ); } - m_licenceTextLabel->setText( tr( "File: %1" ).arg( fileName ) ); + m_licenceTextLabel->setText( tr( "File: %1", "@label" ).arg( fileName ) ); } } @@ -183,11 +183,11 @@ LicenseWidget::updateExpandToolTip() { if ( m_entry.isLocal() ) { - m_viewLicenseButton->setText( m_isExpanded ? tr( "Hide license text" ) : tr( "Show the license text" ) ); + m_viewLicenseButton->setText( m_isExpanded ? tr( "Hide the license text", "@tooltip" ) : tr( "Show the license text", "@tooltip" ) ); } else { - m_viewLicenseButton->setText( tr( "Open license agreement in browser." ) ); + m_viewLicenseButton->setText( tr( "Open the license agreement in browser", "@tooltip" ) ); } } diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index 226bdfc85..15f84fe75 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -370,7 +370,7 @@ Config::setLCLocaleExplicitly( const QString& locale ) QString Config::currentLocationStatus() const { - return tr( "Set timezone to %1/%2." ) + return tr( "Set timezone to %1/%2", "@action" ) .arg( m_currentLocation ? m_currentLocation->region() : QString(), m_currentLocation ? m_currentLocation->zone() : QString() ); } @@ -407,14 +407,14 @@ localeLabel( const QString& s ) QString Config::currentLanguageStatus() const { - return tr( "The system language will be set to %1." ) + return tr( "The system language will be set to %1", "@info" ) .arg( localeLabel( m_selectedLocaleConfiguration.language() ) ); } QString Config::currentLCStatus() const { - return tr( "The numbers and dates locale will be set to %1." ) + return tr( "The numbers and dates locale will be set to %1", "@info" ) .arg( localeLabel( m_selectedLocaleConfiguration.lc_numeric ) ); } diff --git a/src/modules/locale/LCLocaleDialog.cpp b/src/modules/locale/LCLocaleDialog.cpp index afdceb2a1..1b6d6aaf9 100644 --- a/src/modules/locale/LCLocaleDialog.cpp +++ b/src/modules/locale/LCLocaleDialog.cpp @@ -20,7 +20,7 @@ LCLocaleDialog::LCLocaleDialog( const QString& guessedLCLocale, const QStringLis : QDialog( parent ) { setModal( true ); - setWindowTitle( tr( "System locale setting" ) ); + setWindowTitle( tr( "System Locale Setting", "@title" ) ); QBoxLayout* mainLayout = new QVBoxLayout; setLayout( mainLayout ); @@ -29,7 +29,7 @@ LCLocaleDialog::LCLocaleDialog( const QString& guessedLCLocale, const QStringLis upperText->setWordWrap( true ); upperText->setText( tr( "The system locale setting affects the language and character " "set for some command line user interface elements.
" - "The current setting is %1." ) + "The current setting is %1.", "@info" ) .arg( guessedLCLocale ) ); mainLayout->addWidget( upperText ); setMinimumWidth( upperText->fontMetrics().height() * 24 ); @@ -51,8 +51,8 @@ LCLocaleDialog::LCLocaleDialog( const QString& guessedLCLocale, const QStringLis QDialogButtonBox* dbb = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this ); - dbb->button( QDialogButtonBox::Cancel )->setText( tr( "&Cancel" ) ); - dbb->button( QDialogButtonBox::Ok )->setText( tr( "&OK" ) ); + dbb->button( QDialogButtonBox::Cancel )->setText( tr( "&Cancel", "@button" ) ); + dbb->button( QDialogButtonBox::Ok )->setText( tr( "&OK", "@button" ) ); mainLayout->addWidget( dbb ); diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index dadaf7fd9..e74373ad7 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -127,10 +127,10 @@ LocalePage::~LocalePage() {} void LocalePage::updateLocaleLabels() { - m_regionLabel->setText( tr( "Region:" ) ); - m_zoneLabel->setText( tr( "Zone:" ) ); - m_localeChangeButton->setText( tr( "&Change..." ) ); - m_formatsChangeButton->setText( tr( "&Change..." ) ); + m_regionLabel->setText( tr( "Region:", "@label" ) ); + m_zoneLabel->setText( tr( "Zone:", "@label" ) ); + m_localeChangeButton->setText( tr( "&Change…", "@button" ) ); + m_formatsChangeButton->setText( tr( "&Change…", "@button" ) ); m_localeLabel->setText( m_config->currentLanguageStatus() ); m_formatsLabel->setText( m_config->currentLCStatus() ); } diff --git a/src/modules/locale/LocaleViewStep.cpp b/src/modules/locale/LocaleViewStep.cpp index 3d069e72b..c40e3ae51 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -68,7 +68,7 @@ LocaleViewStep::setUpPage() QString LocaleViewStep::prettyName() const { - return tr( "Location" ); + return tr( "Location", "@label" ); } QString diff --git a/src/modules/locale/SetTimezoneJob.cpp b/src/modules/locale/SetTimezoneJob.cpp index b5fcb1bef..1a3070a52 100644 --- a/src/modules/locale/SetTimezoneJob.cpp +++ b/src/modules/locale/SetTimezoneJob.cpp @@ -29,7 +29,7 @@ SetTimezoneJob::SetTimezoneJob( const QString& region, const QString& zone ) QString SetTimezoneJob::prettyName() const { - return tr( "Set timezone to %1/%2" ).arg( m_region ).arg( m_zone ); + return tr( "Setting timezone to %1/%2…", "@status" ).arg( m_region ).arg( m_zone ); } Calamares::JobResult @@ -57,8 +57,8 @@ SetTimezoneJob::exec() QFileInfo zoneFile( gs->value( "rootMountPoint" ).toString() + zoneinfoPath ); if ( !zoneFile.exists() || !zoneFile.isReadable() ) { - return Calamares::JobResult::error( tr( "Cannot access selected timezone path." ), - tr( "Bad path: %1" ).arg( zoneFile.absolutePath() ) ); + return Calamares::JobResult::error( tr( "Cannot access selected timezone path.", "@error" ), + tr( "Bad path: %1", "@error" ).arg( zoneFile.absolutePath() ) ); } // Make sure /etc/localtime doesn't exist, otherwise symlinking will fail @@ -68,16 +68,16 @@ SetTimezoneJob::exec() if ( ec ) { return Calamares::JobResult::error( - tr( "Cannot set timezone." ), - tr( "Link creation failed, target: %1; link name: %2" ).arg( zoneinfoPath ).arg( "/etc/localtime" ) ); + tr( "Cannot set timezone.", "@error" ), + tr( "Link creation failed, target: %1; link name: %2", "@info" ).arg( zoneinfoPath ).arg( "/etc/localtime" ) ); } QFile timezoneFile( gs->value( "rootMountPoint" ).toString() + "/etc/timezone" ); if ( !timezoneFile.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate ) ) { - return Calamares::JobResult::error( tr( "Cannot set timezone," ), - tr( "Cannot open /etc/timezone for writing" ) ); + return Calamares::JobResult::error( tr( "Cannot set timezone.", "@error" ), + tr( "Cannot open /etc/timezone for writing", "@info" ) ); } QTextStream out( &timezoneFile ); diff --git a/src/modules/localeq/LocaleQmlViewStep.cpp b/src/modules/localeq/LocaleQmlViewStep.cpp index 6139d3a45..6863bb78a 100644 --- a/src/modules/localeq/LocaleQmlViewStep.cpp +++ b/src/modules/localeq/LocaleQmlViewStep.cpp @@ -29,7 +29,7 @@ LocaleQmlViewStep::getConfig() QString LocaleQmlViewStep::prettyName() const { - return tr( "Location" ); + return tr( "Location", "@label" ); } QString diff --git a/src/modules/localeq/Map-qt6.qml b/src/modules/localeq/Map-qt6.qml index bba8629cc..b485dcadf 100644 --- a/src/modules/localeq/Map-qt6.qml +++ b/src/modules/localeq/Map-qt6.qml @@ -234,7 +234,7 @@ Column { Text { id: tzText - text: qsTr("Timezone: %1").arg(config.currentTimezoneName) + text: qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) color: Kirigami.Theme.textColor anchors.centerIn: parent } @@ -257,7 +257,7 @@ Column { Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor text: qsTr("Please select your preferred location on the map so the installer can suggest the locale and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging - to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming.") + to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming.", "@label") } } } diff --git a/src/modules/localeq/Map.qml b/src/modules/localeq/Map.qml index ab0a01a58..d6b55d5a1 100644 --- a/src/modules/localeq/Map.qml +++ b/src/modules/localeq/Map.qml @@ -234,7 +234,7 @@ Column { Text { id: tzText - text: qsTr("Timezone: %1").arg(config.currentTimezoneName) + text: qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) color: Kirigami.Theme.textColor anchors.centerIn: parent } @@ -257,7 +257,7 @@ Column { Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor text: qsTr("Please select your preferred location on the map so the installer can suggest the locale and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging - to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming.") + to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming.", "@info") } } } diff --git a/src/modules/localeq/Offline-qt6.qml b/src/modules/localeq/Offline-qt6.qml index c980c4ed6..7d319a158 100644 --- a/src/modules/localeq/Offline-qt6.qml +++ b/src/modules/localeq/Offline-qt6.qml @@ -44,7 +44,7 @@ Page { anchors.horizontalCenter: parent.horizontalCenter color: textColor horizontalAlignment: Text.AlignCenter - text: qsTr("Select your preferred Region, or use the default settings.") + text: qsTr("Select your preferred region, or use the default settings", "@label") } ListView { @@ -100,7 +100,7 @@ Page { list.currentIndex = index control.currentRegion = model.name config.regionalZonesModel.region = control.currentRegion - tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName) + tztext.text = qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) stack.push(zoneView) } } @@ -117,7 +117,7 @@ Page { id: zone anchors.horizontalCenter: parent.horizontalCenter color: textColor - text: qsTr("Select your preferred Zone within your Region.") + text: qsTr("Select your preferred zone within your region", "@label") } ListView { @@ -177,7 +177,7 @@ Page { list2.positionViewAtIndex(index, ListView.Center) control.currentZone = model.name config.setCurrentLocation(control.currentRegion, control.currentZone) - tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName) + tztext.text = qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) } } } @@ -190,7 +190,7 @@ Page { anchors.left: parent.left anchors.leftMargin: parent.width / 15 icon.name: "go-previous" - text: qsTr("Zones") + text: qsTr("Zones", "@button") onClicked: stack.pop() } } @@ -221,7 +221,7 @@ Page { Text { id: tztext - text: qsTr("Timezone: %1").arg(config.currentTimezoneName) + text: qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) color: Kirigami.Theme.textColor anchors.centerIn: parent } @@ -237,7 +237,7 @@ Page { wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor - text: qsTr("You can fine-tune Language and Locale settings below.") + text: qsTr("You can fine-tune language and locale settings below", "@label") } } } diff --git a/src/modules/localeq/Offline.qml b/src/modules/localeq/Offline.qml index 4683dfbc3..9a4aef0e3 100644 --- a/src/modules/localeq/Offline.qml +++ b/src/modules/localeq/Offline.qml @@ -44,7 +44,7 @@ Page { anchors.horizontalCenter: parent.horizontalCenter color: textColor horizontalAlignment: Text.AlignCenter - text: qsTr("Select your preferred Region, or use the default settings.") + text: qsTr("Select your preferred region, or use the default settings", "@label") } ListView { @@ -100,7 +100,7 @@ Page { list.currentIndex = index control.currentRegion = model.name config.regionalZonesModel.region = control.currentRegion - tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName) + tztext.text = qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) stack.push(zoneView) } } @@ -117,7 +117,7 @@ Page { id: zone anchors.horizontalCenter: parent.horizontalCenter color: textColor - text: qsTr("Select your preferred Zone within your Region.") + text: qsTr("Select your preferred zone within your region", "@label") } ListView { @@ -177,7 +177,7 @@ Page { list2.positionViewAtIndex(index, ListView.Center) control.currentZone = model.name config.setCurrentLocation(control.currentRegion, control.currentZone) - tztext.text = qsTr("Timezone: %1").arg(config.currentTimezoneName) + tztext.text = qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) } } } @@ -190,7 +190,7 @@ Page { anchors.left: parent.left anchors.leftMargin: parent.width / 15 icon.name: "go-previous" - text: qsTr("Zones") + text: qsTr("Zones", "@button") onClicked: stack.pop() } } @@ -221,7 +221,7 @@ Page { Text { id: tztext - text: qsTr("Timezone: %1").arg(config.currentTimezoneName) + text: qsTr("Timezone: %1", "@label").arg(config.currentTimezoneName) color: Kirigami.Theme.textColor anchors.centerIn: parent } @@ -237,7 +237,7 @@ Page { wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter Kirigami.Theme.backgroundColor: Kirigami.Theme.backgroundColor - text: qsTr("You can fine-tune Language and Locale settings below.") + text: qsTr("You can fine-tune language and locale settings below", "@label") } } } diff --git a/src/modules/localeq/localeq-qt6.qml b/src/modules/localeq/localeq-qt6.qml index 4a030e776..956f07d96 100644 --- a/src/modules/localeq/localeq-qt6.qml +++ b/src/modules/localeq/localeq-qt6.qml @@ -73,7 +73,7 @@ Page { Button { Layout.alignment: Qt.AlignRight|Qt.AlignVCenter Layout.columnSpan: 2 - text: qsTr("Change") + text: qsTr("Change", "@button") onClicked: { drawerLanguage.open() } @@ -103,7 +103,7 @@ Page { Button { Layout.alignment: Qt.AlignRight|Qt.AlignVCenter Layout.columnSpan: 2 - text: qsTr("Change") + text: qsTr("Change", "@button") onClicked: { drawerLocale.open() } @@ -140,7 +140,7 @@ Page { anchors.fill: parent wrapMode: Text.WordWrap text: qsTr("

Languages


- The system locale setting affects the language and character set for some command line user interface elements. The current setting is %1.").arg(config.currentLanguageCode) + The system locale setting affects the language and character set for some command line user interface elements. The current setting is %1.", "@info").arg(config.currentLanguageCode) font.pointSize: 10 } } @@ -211,7 +211,7 @@ Page { anchors.fill: parent wrapMode: Text.WordWrap text: qsTr("

Locales


- The system locale setting affects the numbers and dates format. The current setting is %1.").arg(config.currentLCCode) + The system locale setting affects the numbers and dates format. The current setting is %1.", "@info").arg(config.currentLCCode) font.pointSize: 10 } } diff --git a/src/modules/localeq/localeq.qml b/src/modules/localeq/localeq.qml index c109adbb7..f1806b942 100644 --- a/src/modules/localeq/localeq.qml +++ b/src/modules/localeq/localeq.qml @@ -73,7 +73,7 @@ Page { Button { Layout.alignment: Qt.AlignRight|Qt.AlignVCenter Layout.columnSpan: 2 - text: qsTr("Change") + text: qsTr("Change", "@button") onClicked: { drawerLanguage.open() } @@ -103,7 +103,7 @@ Page { Button { Layout.alignment: Qt.AlignRight|Qt.AlignVCenter Layout.columnSpan: 2 - text: qsTr("Change") + text: qsTr("Change", "@button") onClicked: { drawerLocale.open() } @@ -140,7 +140,7 @@ Page { anchors.fill: parent wrapMode: Text.WordWrap text: qsTr("

Languages


- The system locale setting affects the language and character set for some command line user interface elements. The current setting is %1.").arg(config.currentLanguageCode) + The system locale setting affects the language and character set for some command line user interface elements. The current setting is %1.". "@info").arg(config.currentLanguageCode) font.pointSize: 10 } } @@ -211,7 +211,7 @@ Page { anchors.fill: parent wrapMode: Text.WordWrap text: qsTr("

Locales


- The system locale setting affects the numbers and dates format. The current setting is %1.").arg(config.currentLCCode) + The system locale setting affects the numbers and dates format. The current setting is %1.", "@info").arg(config.currentLCCode) font.pointSize: 10 } }