Android: Convert to using Tr::tr

Change-Id: Ie9110093101b0f49808b4da7b13ac3f47c3bb994
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2022-10-06 17:53:35 +02:00
parent 8741ce6afc
commit 5c65115271
50 changed files with 753 additions and 4360 deletions

View File

@@ -1,6 +1,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "androidtr.h"
#include "createandroidmanifestwizard.h"
#include <android/androidconfigurations.h>
@@ -41,8 +42,6 @@ namespace Internal {
class NoApplicationProFilePage : public QWizardPage
{
Q_DECLARE_TR_FUNCTIONS(Android::NoApplicationProFilePage)
public:
NoApplicationProFilePage(CreateAndroidManifestWizard *wizard);
};
@@ -52,9 +51,9 @@ NoApplicationProFilePage::NoApplicationProFilePage(CreateAndroidManifestWizard *
auto layout = new QVBoxLayout(this);
auto label = new QLabel(this);
label->setWordWrap(true);
label->setText(tr("No application .pro file found in this project."));
label->setText(Tr::tr("No application .pro file found in this project."));
layout->addWidget(label);
setTitle(tr("No Application .pro File"));
setTitle(Tr::tr("No Application .pro File"));
}
@@ -64,8 +63,6 @@ NoApplicationProFilePage::NoApplicationProFilePage(CreateAndroidManifestWizard *
class ChooseProFilePage : public QWizardPage
{
Q_DECLARE_TR_FUNCTIONS(Android::ChooseProfilePage)
public:
explicit ChooseProFilePage(CreateAndroidManifestWizard *wizard);
@@ -82,7 +79,7 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard)
auto fl = new QFormLayout(this);
QLabel *label = new QLabel(this);
label->setWordWrap(true);
label->setText(tr("Select the .pro file for which you want to create the Android template files."));
label->setText(Tr::tr("Select the .pro file for which you want to create the Android template files."));
fl->addRow(label);
BuildSystem *buildSystem = wizard->buildSystem();
@@ -99,8 +96,8 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard)
nodeSelected(m_comboBox->currentIndex());
connect(m_comboBox, &QComboBox::currentIndexChanged, this, &ChooseProFilePage::nodeSelected);
fl->addRow(tr(".pro file:"), m_comboBox);
setTitle(tr("Select a .pro File"));
fl->addRow(Tr::tr(".pro file:"), m_comboBox);
setTitle(Tr::tr("Select a .pro File"));
}
void ChooseProFilePage::nodeSelected(int index)
@@ -116,8 +113,6 @@ void ChooseProFilePage::nodeSelected(int index)
class ChooseDirectoryPage : public QWizardPage
{
Q_DECLARE_TR_FUNCTIONS(Android::ChooseDirectoryPage)
public:
ChooseDirectoryPage(CreateAndroidManifestWizard *wizard);
@@ -144,11 +139,11 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
m_androidPackageSourceDir = new PathChooser(this);
m_androidPackageSourceDir->setExpectedKind(PathChooser::Directory);
m_layout->addRow(tr("Android package source directory:"), m_androidPackageSourceDir);
m_layout->addRow(Tr::tr("Android package source directory:"), m_androidPackageSourceDir);
m_sourceDirectoryWarning =
new InfoLabel(tr("The Android package source directory cannot be the same as "
"the project directory."), InfoLabel::Error, this);
new InfoLabel(Tr::tr("The Android package source directory cannot be the same as "
"the project directory."), InfoLabel::Error, this);
m_sourceDirectoryWarning->setVisible(false);
m_sourceDirectoryWarning->setElideMode(Qt::ElideNone);
m_sourceDirectoryWarning->setWordWrap(true);
@@ -162,8 +157,8 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
auto checkBox = new QCheckBox(this);
connect(checkBox, &QCheckBox::toggled, wizard, &CreateAndroidManifestWizard::setCopyGradle);
checkBox->setChecked(false);
checkBox->setText(tr("Copy the Gradle files to Android directory"));
checkBox->setToolTip(tr("It is highly recommended if you are planning to extend the Java part of your Qt application."));
checkBox->setText(Tr::tr("Copy the Gradle files to Android directory"));
checkBox->setToolTip(Tr::tr("It is highly recommended if you are planning to extend the Java part of your Qt application."));
m_layout->addRow(checkBox);
}
}
@@ -201,9 +196,9 @@ void ChooseDirectoryPage::initializePage()
androidPackageDir = FilePath::fromVariant(node->data(Android::Constants::AndroidPackageSourceDir));
if (androidPackageDir.isEmpty()) {
m_label->setText(tr("Select the Android package source directory.\n\n"
"The files in the Android package source directory are copied to the build directory's "
"Android directory and the default files are overwritten."));
m_label->setText(Tr::tr("Select the Android package source directory.\n\n"
"The files in the Android package source directory are copied to the build directory's "
"Android directory and the default files are overwritten."));
const FilePath projectPath = bti.projectFilePath.isFile()
? bti.projectFilePath.parentDir() : bti.projectFilePath;
@@ -212,8 +207,8 @@ void ChooseDirectoryPage::initializePage()
connect(m_androidPackageSourceDir, &PathChooser::rawPathChanged,
this, &ChooseDirectoryPage::checkPackageSourceDir);
} else {
m_label->setText(tr("The Android template files will be created in the %1 set in the .pro "
"file.").arg(QLatin1String(Constants::ANDROID_PACKAGE_SOURCE_DIR)));
m_label->setText(Tr::tr("The Android template files will be created in the %1 set in the .pro "
"file.").arg(QLatin1String(Constants::ANDROID_PACKAGE_SOURCE_DIR)));
m_androidPackageSourceDir->setFilePath(androidPackageDir);
m_androidPackageSourceDir->setReadOnly(true);
}
@@ -228,7 +223,7 @@ void ChooseDirectoryPage::initializePage()
CreateAndroidManifestWizard::CreateAndroidManifestWizard(BuildSystem *buildSystem)
: m_buildSystem(buildSystem)
{
setWindowTitle(tr("Create Android Template Files Wizard"));
setWindowTitle(Tr::tr("Create Android Template Files Wizard"));
const QList<BuildTargetInfo> buildTargets = buildSystem->applicationTargets();
QtSupport::QtVersion *version = QtSupport::QtKitAspect::qtVersion(buildSystem->kit());
@@ -319,9 +314,9 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
if (!result) {
QMessageBox::warning(this,
tr("Project File not Updated"),
tr("Could not update the project file %1.")
.arg(bti.projectFilePath.toUserOutput()));
Tr::tr("Project File not Updated"),
Tr::tr("Could not update the project file %1.")
.arg(bti.projectFilePath.toUserOutput()));
}
}
}