From d92be80610de0c519a21330cf0e9a24a9c63917d Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 20 Jan 2023 10:04:40 +0100 Subject: [PATCH] UpdateInfo: Tr::tr Change-Id: I7167f675bf58793cb38e11bfd58902bb7537c4b9 Reviewed-by: hjk --- share/qtcreator/translations/qtcreator_cs.ts | 10 ++--- share/qtcreator/translations/qtcreator_da.ts | 15 +------ share/qtcreator/translations/qtcreator_de.ts | 4 +- share/qtcreator/translations/qtcreator_fr.ts | 10 ++--- share/qtcreator/translations/qtcreator_hr.ts | 14 +----- share/qtcreator/translations/qtcreator_ja.ts | 43 ++----------------- share/qtcreator/translations/qtcreator_pl.ts | 12 ++---- share/qtcreator/translations/qtcreator_ru.ts | 12 +----- share/qtcreator/translations/qtcreator_uk.ts | 16 ++----- .../qtcreator/translations/qtcreator_zh_CN.ts | 6 --- .../qtcreator/translations/qtcreator_zh_TW.ts | 2 +- src/plugins/updateinfo/settingspage.cpp | 42 +++++++++--------- src/plugins/updateinfo/updateinfoplugin.cpp | 27 ++++++------ 13 files changed, 58 insertions(+), 155 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_cs.ts b/share/qtcreator/translations/qtcreator_cs.ts index f3f12eebac4..b06ad2127c2 100644 --- a/share/qtcreator/translations/qtcreator_cs.ts +++ b/share/qtcreator/translations/qtcreator_cs.ts @@ -39691,7 +39691,7 @@ Filtr: %2 - UpdateInfo::Internal::UpdateInfoPlugin + ::UpdateInfo Could not determine location of maintenance tool. Please check your installation if you did not enable this plugin manually. Nepodařilo se najít umístění nástroje na správu. Prověřte, prosím, svoji instalaci, pokud jste tento přídavný modul nezapnuli ručně. @@ -53948,7 +53948,7 @@ monitor reset - UpdateInfo::Internal::SettingsWidget + ::UpdateInfo Configure Filters Nastavit filtry @@ -55406,11 +55406,7 @@ se vyskytla chyba - Update - - Update - Aktualizovat - + ::UpdateInfo ::Valgrind diff --git a/share/qtcreator/translations/qtcreator_da.ts b/share/qtcreator/translations/qtcreator_da.ts index 3eb342f730a..25529c2f11c 100644 --- a/share/qtcreator/translations/qtcreator_da.ts +++ b/share/qtcreator/translations/qtcreator_da.ts @@ -36367,14 +36367,11 @@ Vil blive anvendt på blanktegn i kommentarer og strenge. - Update + ::UpdateInfo Update Opdater - - - UpdateInfo::Internal::SettingsPage Daily Dagligt @@ -36403,9 +36400,6 @@ Vil blive anvendt på blanktegn i kommentarer og strenge. Not checked yet Endnu ikke tjekket - - - UpdateInfo::Internal::SettingsWidget Configure Filters Konfigurer filtre @@ -36426,10 +36420,6 @@ Vil blive anvendt på blanktegn i kommentarer og strenge. Last check date: Sidste tjekdato: - - Not checked yet - Endnu ikke tjekket - Check Now Tjek nu @@ -36438,9 +36428,6 @@ Vil blive anvendt på blanktegn i kommentarer og strenge. Automatically runs a scheduled check for updates on a time interval basis. The automatic check for updates will be performed at the scheduled date, or the next startup following it. Kører automatisk en planlagt søgning efter opdateringer på et tidsinterval basis. Den automatiske søgning efter opdateringer udføres på den planlagte dato eller den næste opstart som kommer efter. - - - UpdateInfo::Internal::UpdateInfoPlugin Qt Updater Qt opdatering diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index e2390976580..378992bbe1f 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -21063,7 +21063,7 @@ Außer: %3 - UpdateInfo::Internal::UpdateInfoPlugin + ::UpdateInfo Checking for Updates Aktualisierungen werden gesucht @@ -45718,7 +45718,7 @@ Do you want to display them anyway? - UpdateInfo::Internal::UpdateInfoSettingsPage + ::UpdateInfo Daily Täglich diff --git a/share/qtcreator/translations/qtcreator_fr.ts b/share/qtcreator/translations/qtcreator_fr.ts index 9a513dd9931..9a121410970 100644 --- a/share/qtcreator/translations/qtcreator_fr.ts +++ b/share/qtcreator/translations/qtcreator_fr.ts @@ -38227,7 +38227,7 @@ Filtre : %2 - UpdateInfo::Internal::UpdateInfoPlugin + ::UpdateInfo Could not determine location of maintenance tool. Please check your installation if you did not enable this plugin manually. Impossible de déterminer l'emplacement de l'outil de maintenant. Veuillez vérifier votre installation si vous n'avez pas activé ce module manuellement. @@ -50651,7 +50651,7 @@ réinitialisation du moniteur - UpdateInfo::Internal::SettingsWidget + ::UpdateInfo Configure Filters Configurer les filtres @@ -52056,11 +52056,7 @@ Veuillez fermer toutes les instances de votre application en cours d'exécu - Update - - Update - Mettre à jour - + ::UpdateInfo ::Valgrind diff --git a/share/qtcreator/translations/qtcreator_hr.ts b/share/qtcreator/translations/qtcreator_hr.ts index 478f5a66035..f485416d375 100644 --- a/share/qtcreator/translations/qtcreator_hr.ts +++ b/share/qtcreator/translations/qtcreator_hr.ts @@ -8586,7 +8586,7 @@ Utječe na uvlačenje neprekinutih redaka. - UpdateInfo::Internal::SettingsWidget + ::UpdateInfo Configure Filters Konfiguriraj filtre @@ -35324,14 +35324,11 @@ Neće se primijeniti na bjeline u komentarima i znakovnim nizovima. - Update + ::UpdateInfo Update Aktualiziraj - - - UpdateInfo::Internal::SettingsPage Daily Dnevno @@ -35356,13 +35353,6 @@ Neće se primijeniti na bjeline u komentarima i znakovnim nizovima.Checking for updates... Provjeravanje nadogradnji … - - Not checked yet - Još nije provjereno - - - - UpdateInfo::Internal::UpdateInfoPlugin Qt Updater Qt Updater diff --git a/share/qtcreator/translations/qtcreator_ja.ts b/share/qtcreator/translations/qtcreator_ja.ts index c74ff7a5023..2fb2000ea68 100644 --- a/share/qtcreator/translations/qtcreator_ja.ts +++ b/share/qtcreator/translations/qtcreator_ja.ts @@ -6776,7 +6776,7 @@ Influences the indentation of continuation lines. - UpdateInfo::Internal::SettingsWidget + ::UpdateInfo Configure Filters フィルタの設定 @@ -30565,7 +30565,7 @@ Will not be applied to whitespace in comments and strings. - UpdateInfo::Internal::UpdateInfoPlugin + ::UpdateInfo Updater 更新プログラム @@ -30591,9 +30591,6 @@ Will not be applied to whitespace in comments and strings. Check for Updates 更新の確認 - - - Update Update 更新 @@ -41643,7 +41640,7 @@ Android パッケージソースディレクトリのファイルはビルドデ - UpdateInfo::Internal::SettingsPage + ::UpdateInfo Daily 毎日 @@ -41668,10 +41665,6 @@ Android パッケージソースディレクトリのファイルはビルドデ Checking for updates... 更新の確認中... - - Not checked yet - 未確認 - ::Valgrind @@ -48674,35 +48667,7 @@ Row: %4, Column: %5 - UpdateInfo::Internal::UpdateInfoSettingsPage - - Daily - 毎日 - - - Weekly - 毎週 - - - Monthly - 毎月 - - - New updates are available. - 新しい更新を利用できます。 - - - No new updates are available. - 新しい更新はありません。 - - - Checking for updates... - 更新の確認中... - - - Not checked yet - 未確認 - + ::UpdateInfo Update Update diff --git a/share/qtcreator/translations/qtcreator_pl.ts b/share/qtcreator/translations/qtcreator_pl.ts index 6d2e74b50b0..da9697b6eff 100644 --- a/share/qtcreator/translations/qtcreator_pl.ts +++ b/share/qtcreator/translations/qtcreator_pl.ts @@ -18231,7 +18231,7 @@ Wykluczenia: %3 - UpdateInfo::Internal::UpdateInfoPlugin + ::UpdateInfo Updater Aktualizator @@ -25566,7 +25566,7 @@ Zdalny: %4 - UpdateInfo::Internal::SettingsWidget + ::UpdateInfo Configure Filters Konfiguracja filtrów @@ -26846,7 +26846,7 @@ Proszę zamknąć wszystkie instancje tej aplikacji przed uruchomieniem budowani - Update + ::UpdateInfo Update Uaktualnij @@ -33326,7 +33326,7 @@ Ustawianie pułapek w liniach plików może się nie udać. - UpdateInfo::Internal::SettingsPage + ::UpdateInfo Daily Codziennie @@ -33351,10 +33351,6 @@ Ustawianie pułapek w liniach plików może się nie udać. Checking for updates... Sprawdzanie dostępności aktualizacji... - - Not checked yet - Jeszcze nie sprawdzano - ::VcsBase diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index a9203d155ee..6eb893b485a 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -46127,7 +46127,7 @@ The trace data is lost. - UpdateInfo::Internal::SettingsWidget + ::UpdateInfo Configure Filters Настройка фильтров @@ -46160,9 +46160,6 @@ The trace data is lost. Automatically runs a scheduled check for updates on a time interval basis. The automatic check for updates will be performed at the scheduled date, or the next startup following it. Проверка на наличие обновлений будет запускаться периодически. Она осуществляется в запланированное время или при следующем запуске среды разработки. - - - UpdateInfo::Internal::UpdateInfoPlugin Checking for Updates Проверка обновлений @@ -46195,9 +46192,6 @@ The trace data is lost. Check for Updates Проверить обновления - - - UpdateInfo::Internal::UpdateInfoSettingsPage Daily Ежедневно @@ -46222,10 +46216,6 @@ The trace data is lost. Checking for updates... Проверка обновлений... - - Not checked yet - не выполнялась - Update Update diff --git a/share/qtcreator/translations/qtcreator_uk.ts b/share/qtcreator/translations/qtcreator_uk.ts index 5108ad8d768..695efe9c20a 100644 --- a/share/qtcreator/translations/qtcreator_uk.ts +++ b/share/qtcreator/translations/qtcreator_uk.ts @@ -20078,7 +20078,7 @@ Will not be applied to whitespace in comments and strings. - UpdateInfo::Internal::UpdateInfoPlugin + ::UpdateInfo Updater Оновлючач @@ -20119,10 +20119,6 @@ Will not be applied to whitespace in comments and strings. Updates available Доступні оновлення - - Update - Оновити - Utils::CheckableMessageBox @@ -33349,7 +33345,7 @@ monitor reset - UpdateInfo::Internal::SettingsWidget + ::UpdateInfo Configure Filters Налаштування фільтрів @@ -34755,7 +34751,7 @@ Please close all running instances of your application before starting a build.< - Update + ::UpdateInfo Update Оновити @@ -42698,7 +42694,7 @@ Output: - UpdateInfo::Internal::SettingsPage + ::UpdateInfo Daily Щоденно @@ -42723,10 +42719,6 @@ Output: Checking for updates... Перевірка оновлень... - - Not checked yet - Ще не перевірялось - ::VcsBase diff --git a/share/qtcreator/translations/qtcreator_zh_CN.ts b/share/qtcreator/translations/qtcreator_zh_CN.ts index 46ece18614d..b23dc5c022b 100644 --- a/share/qtcreator/translations/qtcreator_zh_CN.ts +++ b/share/qtcreator/translations/qtcreator_zh_CN.ts @@ -45228,9 +45228,6 @@ The trace data is lost. Start Maintenance Tool - - - UpdateInfo::Internal::UpdateInfoPlugin Could not determine location of maintenance tool. Please check your installation if you did not enable this plugin manually. 无法确定维护工具所在位置,请检查安装(有可能没有手动开启插件支持)。 @@ -45280,9 +45277,6 @@ The trace data is lost. Check for Updates - - - UpdateInfo::Internal::UpdateInfoSettingsPage Configure Filters 配置过滤器 diff --git a/share/qtcreator/translations/qtcreator_zh_TW.ts b/share/qtcreator/translations/qtcreator_zh_TW.ts index ca901833eaa..64e768248b0 100644 --- a/share/qtcreator/translations/qtcreator_zh_TW.ts +++ b/share/qtcreator/translations/qtcreator_zh_TW.ts @@ -24982,7 +24982,7 @@ Filter: %2 - UpdateInfo::Internal::UpdateInfoPlugin + ::UpdateInfo Could not determine location of maintenance tool. Please check your installation if you did not enable this plugin manually. 無法決定維護工具所在位置。請檢查您的安裝,確定您是否沒有手動開啟此外掛程式的支援。 diff --git a/src/plugins/updateinfo/settingspage.cpp b/src/plugins/updateinfo/settingspage.cpp index c9a97e8eeff..587102bce75 100644 --- a/src/plugins/updateinfo/settingspage.cpp +++ b/src/plugins/updateinfo/settingspage.cpp @@ -24,28 +24,26 @@ namespace Internal { class UpdateInfoSettingsPageWidget final : public Core::IOptionsPageWidget { - Q_DECLARE_TR_FUNCTIONS(UpdateInfo::Internal::UpdateInfoSettingsPage) - public: UpdateInfoSettingsPageWidget(UpdateInfoPlugin *plugin) : m_plugin(plugin) { - setWindowTitle(tr("Configure Filters")); + setWindowTitle(Tr::tr("Configure Filters")); - m_updatesGroupBox = new QGroupBox(tr("Automatic Check for Updates")); + m_updatesGroupBox = new QGroupBox(Tr::tr("Automatic Check for Updates")); m_updatesGroupBox->setCheckable(true); m_updatesGroupBox->setChecked(true); - m_infoLabel = new QLabel(tr("Automatically runs a scheduled check for updates on " - "a time interval basis. The automatic check for updates " - "will be performed at the scheduled date, or the next " - "startup following it.")); + m_infoLabel = new QLabel(Tr::tr("Automatically runs a scheduled check for updates on " + "a time interval basis. The automatic check for updates " + "will be performed at the scheduled date, or the next " + "startup following it.")); m_infoLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); m_infoLabel->setWordWrap(true); m_checkIntervalComboBox = new QComboBox; m_nextCheckDateLabel = new QLabel; - m_checkForNewQtVersions = new QCheckBox(tr("Check for new Qt versions")); + m_checkForNewQtVersions = new QCheckBox(Tr::tr("Check for new Qt versions")); using namespace Utils::Layouting; @@ -53,8 +51,8 @@ public: m_infoLabel, Row { Form { - new QLabel(tr("Check interval basis:")), m_checkIntervalComboBox, br, - new QLabel(tr("Next check date:")), m_nextCheckDateLabel + new QLabel(Tr::tr("Check interval basis:")), m_checkIntervalComboBox, br, + new QLabel(Tr::tr("Next check date:")), m_nextCheckDateLabel }, st }, @@ -63,14 +61,14 @@ public: m_lastCheckDateLabel = new QLabel; - m_checkNowButton = new QPushButton(tr("Check Now")); + m_checkNowButton = new QPushButton(Tr::tr("Check Now")); m_messageLabel = new QLabel; Column { m_updatesGroupBox, Row { - new QLabel(tr("Last check date:")), + new QLabel(Tr::tr("Last check date:")), m_lastCheckDateLabel, st, Row { @@ -84,11 +82,11 @@ public: m_checkIntervalComboBox->setCurrentIndex(-1); - m_lastCheckDateLabel->setText(tr("Not checked yet")); + m_lastCheckDateLabel->setText(Tr::tr("Not checked yet")); - m_checkIntervalComboBox->addItem(tr("Daily"), UpdateInfoPlugin::DailyCheck); - m_checkIntervalComboBox->addItem(tr("Weekly"), UpdateInfoPlugin::WeeklyCheck); - m_checkIntervalComboBox->addItem(tr("Monthly"), UpdateInfoPlugin::MonthlyCheck); + m_checkIntervalComboBox->addItem(Tr::tr("Daily"), UpdateInfoPlugin::DailyCheck); + m_checkIntervalComboBox->addItem(Tr::tr("Weekly"), UpdateInfoPlugin::WeeklyCheck); + m_checkIntervalComboBox->addItem(Tr::tr("Monthly"), UpdateInfoPlugin::MonthlyCheck); UpdateInfoPlugin::CheckUpdateInterval interval = m_plugin->checkUpdateInterval(); for (int i = 0; i < m_checkIntervalComboBox->count(); i++) { if (m_checkIntervalComboBox->itemData(i).toInt() == interval) { @@ -147,8 +145,8 @@ UpdateInfoPlugin::CheckUpdateInterval UpdateInfoSettingsPageWidget::currentCheck void UpdateInfoSettingsPageWidget::newUpdatesAvailable(bool available) { const QString message = available - ? tr("New updates are available.") - : tr("No new updates are available."); + ? Tr::tr("New updates are available.") + : Tr::tr("No new updates are available."); m_messageLabel->setText(message); } @@ -169,7 +167,7 @@ void UpdateInfoSettingsPageWidget::checkRunningChanged(bool running) } const QString message = running - ? tr("Checking for updates...") : QString(); + ? Tr::tr("Checking for updates...") : QString(); m_messageLabel->setText(message); } @@ -180,7 +178,7 @@ void UpdateInfoSettingsPageWidget::updateLastCheckDate() if (date.isValid()) lastCheckDateString = date.toString(); else - lastCheckDateString = tr("Not checked yet"); + lastCheckDateString = Tr::tr("Not checked yet"); m_lastCheckDateLabel->setText(lastCheckDateString); @@ -209,7 +207,7 @@ SettingsPage::SettingsPage(UpdateInfoPlugin *plugin) { setId(FILTER_OPTIONS_PAGE_ID); setCategory(Core::Constants::SETTINGS_CATEGORY_CORE); - setDisplayName(UpdateInfoSettingsPageWidget::tr("Update", "Update")); + setDisplayName(Tr::tr("Update")); setWidgetCreator([plugin] { return new UpdateInfoSettingsPageWidget(plugin); }); } diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index d9c9a25be3c..decce3a47a9 100644 --- a/src/plugins/updateinfo/updateinfoplugin.cpp +++ b/src/plugins/updateinfo/updateinfoplugin.cpp @@ -153,7 +153,7 @@ void UpdateInfoPlugin::startCheckForUpdates() connect(d->m_taskTree.get(), &TaskTree::errorOccurred, this, doCleanup); d->m_progress = new TaskProgress(d->m_taskTree.get()); d->m_progress->setHalfLifeTimePerTask(30000); // 30 seconds - d->m_progress->setDisplayName(tr("Checking for Updates")); + d->m_progress->setDisplayName(Tr::tr("Checking for Updates")); d->m_progress->setKeepOnFinish(FutureProgress::KeepOnFinishTillUserInteraction); d->m_progress->setSubtitleVisibleInStatusBar(true); d->m_taskTree->start(); @@ -179,14 +179,14 @@ static QString infoTitle(const QList &updates, const std::optionalQt blog for details.") .arg(newQt->displayName, blogUrl); } else if (newQt) { - return UpdateInfoPlugin::tr("%1 is available. Check the Qt blog for details.") + return Tr::tr("%1 is available. Check the Qt blog for details.") .arg(newQt->displayName, blogUrl); } - return UpdateInfoPlugin::tr("New updates are available. Start the update?"); + return Tr::tr("New updates are available. Start the update?"); } static void showUpdateInfo(const QList &updates, @@ -195,17 +195,17 @@ static void showUpdateInfo(const QList &updates, const std::function &startPackageManager) { InfoBarEntry info(InstallUpdates, infoTitle(updates, newQt)); - info.addCustomButton(UpdateInfoPlugin::tr("Open Settings"), [] { + info.addCustomButton(Tr::tr("Open Settings"), [] { ICore::infoBar()->removeInfo(InstallQtUpdates); ICore::showOptionsDialog(FILTER_OPTIONS_PAGE_ID); }); if (newQt) { - info.addCustomButton(UpdateInfoPlugin::tr("Start Package Manager"), [startPackageManager] { + info.addCustomButton(Tr::tr("Start Package Manager"), [startPackageManager] { ICore::infoBar()->removeInfo(InstallQtUpdates); startPackageManager(); }); } else { - info.addCustomButton(UpdateInfoPlugin::tr("Start Update"), [startUpdater] { + info.addCustomButton(Tr::tr("Start Update"), [startUpdater] { ICore::infoBar()->removeInfo(InstallUpdates); startUpdater(); }); @@ -216,12 +216,11 @@ static void showUpdateInfo(const QList &updates, const QStringList packageNames = Utils::transform(updates, [](const Update &u) { if (u.version.isEmpty()) return u.name; - return UpdateInfoPlugin::tr("%1 (%2)", "Package name and version") - .arg(u.name, u.version); + return Tr::tr("%1 (%2)", "Package name and version").arg(u.name, u.version); }); const QString updateText = packageNames.join("
  • "); auto label = new QLabel; - label->setText("

    " + UpdateInfoPlugin::tr("Available updates:") + "

    • " + label->setText("

      " + Tr::tr("Available updates:") + "

      • " + qtText + updateText + "

      "); label->setContentsMargins(2, 2, 2, 2); auto scrollArea = new QScrollArea; @@ -272,7 +271,7 @@ void UpdateInfoPlugin::checkForUpdatesFinished() updates, qtToNag, [this] { startUpdater(); }, [this] { startPackageManager(); }); } else { if (d->m_progress) - d->m_progress->setSubtitle(tr("No updates found.")); + d->m_progress->setSubtitle(Tr::tr("No updates found.")); emit newUpdatesAvailable(false); } } @@ -293,13 +292,13 @@ bool UpdateInfoPlugin::initialize(const QStringList & /* arguments */, QString * loadSettings(); if (d->m_maintenanceTool.isEmpty()) { - *errorMessage = tr("Could not determine location of maintenance tool. Please check " + *errorMessage = Tr::tr("Could not determine location of maintenance tool. Please check " "your installation if you did not enable this plugin manually."); return false; } if (!d->m_maintenanceTool.isExecutableFile()) { - *errorMessage = tr("The maintenance tool at \"%1\" is not an executable. Check your installation.") + *errorMessage = Tr::tr("The maintenance tool at \"%1\" is not an executable. Check your installation.") .arg(d->m_maintenanceTool.toUserOutput()); d->m_maintenanceTool.clear(); return false; @@ -316,7 +315,7 @@ bool UpdateInfoPlugin::initialize(const QStringList & /* arguments */, QString * mmaintenanceTool->menu()->setTitle(Tr::tr("Qt Maintenance Tool")); mtools->addMenu(mmaintenanceTool); - QAction *checkForUpdatesAction = new QAction(tr("Check for Updates"), this); + QAction *checkForUpdatesAction = new QAction(Tr::tr("Check for Updates"), this); checkForUpdatesAction->setMenuRole(QAction::ApplicationSpecificRole); Command *checkForUpdatesCommand = ActionManager::registerAction(checkForUpdatesAction, "Updates.CheckForUpdates");