Tr/Python: Fix translation issues

- Use parametrization
- Split message that relied on sentence structure of the language

Change-Id: I5c0cca684bc9c94219e740fe0292e358a91714da
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Eike Ziller
2023-05-31 10:11:15 +02:00
parent deb974de05
commit 0b863af8a1
2 changed files with 6 additions and 3 deletions

View File

@@ -81,8 +81,10 @@ void PipInstallTask::cancel()
m_process.stop();
m_process.waitForFinished();
Core::MessageManager::writeFlashing(
Tr::tr("The %1 installation was canceled by %2.")
.arg(packagesDisplayName(), m_killTimer.isActive() ? Tr::tr("user") : Tr::tr("time out")));
m_killTimer.isActive()
? Tr::tr("The installation of \"%1\" was canceled by timeout.").arg(packagesDisplayName())
: Tr::tr("The installation of \"%1\" was canceled by the user.")
.arg(packagesDisplayName()));
}
void PipInstallTask::handleDone()

View File

@@ -634,7 +634,8 @@ static void addPythonsFromRegistry(QList<Interpreter> &pythons)
const FilePath &executable = FilePath::fromUserInput(regVal.toString());
if (executable.exists() && !alreadyRegistered(pythons, executable)) {
pythons << Interpreter{QUuid::createUuid().toString(),
name + Tr::tr(" (Windowed)"),
//: <python display name> (Windowed)
Tr::tr("%1 (Windowed)").arg(name),
FilePath::fromUserInput(regVal.toString())};
}
}