diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-05-31 12:19:30 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-06-03 10:01:33 +0300 |
commit | 684b19f90b056fbd15d382b96823b798cf31c0c4 (patch) | |
tree | b461c6dbd802cce73011ae3da3eaf4fef3ff803e /src/libs | |
parent | 66aa6ac999405578de9c62c5028cd90e71ebf513 (diff) |
Translations: exclude leading and trailing newlines from source strings
A follow-up for the translation update round for 4.4.0 release, fix
the noted issue of some strings having strange formatting in the
.ts files. This makes it less likely that the translated strings miss
the newlines in cases where it matters to the text presentation.
Change-Id: I0fc9c2c8014a6ffa30dc510701b7bfad72e8eb82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 19 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 24 |
2 files changed, 26 insertions, 17 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index dde813140..ae87b96f0 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -831,7 +831,8 @@ int PackageManagerCore::downloadNeededArchives(double partProgressSize) if (archivesToDownload.isEmpty()) return 0; - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nDownloading packages...")); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Downloading packages...")); DownloadArchivesJob archivesJob(this); archivesJob.setAutoDelete(false); @@ -2509,7 +2510,7 @@ bool PackageManagerCore::checkComponentsForInstallation(const QStringList &compo foreach (const QString &name, components) { Component *component = componentByName(name); if (!component) { - errorMessage.append(tr("Cannot install %1. Component not found.\n").arg(name)); + errorMessage.append(tr("Cannot install %1. Component not found.").arg(name) + QLatin1Char('\n')); continue; } const QModelIndex &idx = model->indexFromComponentName(component->treeName()); @@ -2518,16 +2519,16 @@ bool PackageManagerCore::checkComponentsForInstallation(const QStringList &compo // User cannot select the component, check why if (component->autoDependencies().count() > 0) { errorMessage.append(tr("Cannot install component %1. Component is installed only as automatic " - "dependency to %2.\n").arg(name, component->autoDependencies().join(QLatin1Char(',')))); + "dependency to %2.").arg(name, component->autoDependencies().join(QLatin1Char(','))) + QLatin1Char('\n')); } else if (!component->isCheckable()) { errorMessage.append(tr("Cannot install component %1. Component is not checkable, meaning you " - "have to select one of the subcomponents.\n").arg(name)); + "have to select one of the subcomponents.").arg(name) + QLatin1Char('\n')); } else if (component->isUnstable()) { errorMessage.append(tr("Cannot install component %1. There was a problem loading this component, " - "so it is marked unstable and cannot be selected.\n").arg(name)); + "so it is marked unstable and cannot be selected.").arg(name) + QLatin1Char('\n')); } } else if (component->isInstalled()) { - errorMessage.append(tr("Component %1 already installed\n").arg(name)); + errorMessage.append(tr("Component %1 already installed").arg(name) + QLatin1Char('\n')); } else { model->setData(idx, Qt::Checked, Qt::CheckStateRole); installComponentsFound = true; @@ -2542,16 +2543,16 @@ bool PackageManagerCore::checkComponentsForInstallation(const QStringList &compo return false; } else if (trace->isVirtual()) { errorMessage.append(tr("Cannot install %1. Component is a descendant " - "of a virtual component %2.\n").arg(name, trace->name())); + "of a virtual component %2.").arg(name, trace->name()) + QLatin1Char('\n')); return true; } } }; // idx is invalid and component valid when we have invisible virtual component if (component->isVirtual()) - errorMessage.append(tr("Cannot install %1. Component is virtual.\n").arg(name)); + errorMessage.append(tr("Cannot install %1. Component is virtual.").arg(name) + QLatin1Char('\n')); else if (!isDescendantOfVirtual()) - errorMessage.append(tr("Cannot install %1. Component not found.\n").arg(name)); + errorMessage.append(tr("Cannot install %1. Component not found.").arg(name) + QLatin1Char('\n')); } } if (!installComponentsFound) diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp index 8723af76f..9b574b3f8 100644 --- a/src/libs/installer/packagemanagercore_p.cpp +++ b/src/libs/installer/packagemanagercore_p.cpp @@ -1794,7 +1794,8 @@ bool PackageManagerCorePrivate::runInstaller() if (progress < 100) ProgressCoordinator::instance()->addManualPercentagePoints(100 - progress); - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nInstallation finished!")); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Installation finished!")); if (adminRightsGained) m_core->dropAdminRights(); @@ -1812,7 +1813,9 @@ bool PackageManagerCorePrivate::runInstaller() m_core->rollBackInstallation(); - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nInstallation aborted!")); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Installation aborted!")); + if (adminRightsGained) m_core->dropAdminRights(); emit installationFinished(); @@ -1971,7 +1974,8 @@ bool PackageManagerCorePrivate::runPackageUpdater() // usually this should be only the reserved one from the beginning if (progress < 100) ProgressCoordinator::instance()->addManualPercentagePoints(100 - progress); - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nUpdate finished!")); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Update finished!")); if (adminRightsGained) m_core->dropAdminRights(); @@ -1991,7 +1995,9 @@ bool PackageManagerCorePrivate::runPackageUpdater() m_core->rollBackInstallation(); - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nUpdate aborted!")); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Update aborted!")); + if (adminRightsGained) m_core->dropAdminRights(); emit installationFinished(); @@ -2209,7 +2215,8 @@ void PackageManagerCorePrivate::unpackComponents(const QList<Component *> &compo OperationList unpackOperations; bool becameAdmin = false; - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nPreparing to unpack components...")); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Preparing to unpack components...")); // 1. Collect operations quint64 totalOperationsSizeHint = 0; @@ -2290,7 +2297,8 @@ void PackageManagerCorePrivate::unpackComponents(const QList<Component *> &compo return lhs->sizeHint() > rhs->sizeHint(); }); - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nUnpacking components...")); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Unpacking components...")); runner.setType(Operation::Perform); const QHash<Operation *, bool> results = runner.run(); @@ -2354,8 +2362,8 @@ void PackageManagerCorePrivate::installComponent(Component *component, double pr // show only components which do something, MinimumProgress is only for progress calculation safeness bool showDetailsLog = false; if (opCount > 1 || (opCount == 1 && operations.at(0)->name() != QLatin1String("MinimumProgress"))) { - ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(tr("\nInstalling component %1") - .arg(component->displayName())); + ProgressCoordinator::instance()->emitLabelAndDetailTextChanged(QLatin1Char('\n') + + tr("Installing component %1").arg(component->displayName())); showDetailsLog = true; } |