diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f991645..7636279c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,10 +89,10 @@ endif() find_package(OpenSSL REQUIRED) # Mandatory: KF5 -find_package(KF5 REQUIRED COMPONENTS I18n Archive) - -# Optional: KWallet, KIO, KCrash, KCoreAddons set(KF5_MIN_VERSION "5.54.0") +find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n Archive) + +# Optional: KWallet, KIO, KCrash, KCoreAddons, KPurpose find_package(KF5Wallet ${KF5_MIN_VERSION} CONFIG) set_package_properties(KF5Wallet PROPERTIES DESCRIPTION "KDE Frameworks Integration plugin" TYPE OPTIONAL) find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG) diff --git a/src/lib/Messages.sh b/src/lib/Messages.sh index 5fdebeedd..2f54702d1 100644 --- a/src/lib/Messages.sh +++ b/src/lib/Messages.sh @@ -1,3 +1,3 @@ #! /bin/sh $EXTRACTRC `find . -name \*.ui` >> rc.cpp -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon.pot diff --git a/src/plugins/AutoScroll/CMakeLists.txt b/src/plugins/AutoScroll/CMakeLists.txt index dc3aaa18f..c7d06bd06 100644 --- a/src/plugins/AutoScroll/CMakeLists.txt +++ b/src/plugins/AutoScroll/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_autoscroll") + set( AutoScroll_SRCS autoscrollplugin.cpp autoscroller.cpp @@ -5,12 +7,10 @@ set( AutoScroll_SRCS autoscrollsettings.cpp ) -ecm_create_qm_loader( AutoScroll_SRCS falkon_autoscroll_qt ) - set( AutoScroll_UIS autoscrollsettings.ui ) -qt5_wrap_ui(UIS ${AutoScroll_UIS}) +ki18n_wrap_ui(UIS ${AutoScroll_UIS}) set( AutoScroll_RSCS autoscroll.qrc diff --git a/src/plugins/AutoScroll/Messages.sh b/src/plugins/AutoScroll/Messages.sh index 2b999bd31..362bd6e3a 100644 --- a/src/plugins/AutoScroll/Messages.sh +++ b/src/plugins/AutoScroll/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_autoscroll_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_autoscroll.pot diff --git a/src/plugins/FlashCookieManager/CMakeLists.txt b/src/plugins/FlashCookieManager/CMakeLists.txt index e39f31c62..cb9c30291 100644 --- a/src/plugins/FlashCookieManager/CMakeLists.txt +++ b/src/plugins/FlashCookieManager/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_flashcookiemanager") + set( FlashCookieManager_SRCS fcm_plugin.cpp fcm_dialog.cpp @@ -10,7 +12,7 @@ set( FlashCookieManager_UIS fcm_dialog.ui fcm_notification.ui ) -qt5_wrap_ui(UIS ${FlashCookieManager_UIS}) +ki18n_wrap_ui(UIS ${FlashCookieManager_UIS}) set( FlashCookieManager_RSCS flashcookiemanager.qrc diff --git a/src/plugins/FlashCookieManager/Messages.sh b/src/plugins/FlashCookieManager/Messages.sh index 9b324ea0f..f6cef605d 100644 --- a/src/plugins/FlashCookieManager/Messages.sh +++ b/src/plugins/FlashCookieManager/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_flashcookiemanager_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_flashcookiemanager.pot diff --git a/src/plugins/FlashCookieManager/fcm_dialog.cpp b/src/plugins/FlashCookieManager/fcm_dialog.cpp index 213f5f395..816e5c512 100644 --- a/src/plugins/FlashCookieManager/fcm_dialog.cpp +++ b/src/plugins/FlashCookieManager/fcm_dialog.cpp @@ -31,6 +31,8 @@ #include #include +#include + FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent) : QDialog(parent, Qt::WindowStaysOnTopHint) , ui(new Ui::FCM_Dialog) @@ -73,7 +75,7 @@ FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent) ui->labelNotification->setEnabled(ui->autoMode->isChecked()); - ui->search->setPlaceholderText(tr("Search")); + ui->search->setPlaceholderText(i18n("Search")); ui->flashCookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed); ui->flashCookieTree->sortItems(0, Qt::AscendingOrder); ui->flashCookieTree->header()->setDefaultSectionSize(220); @@ -90,8 +92,8 @@ FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent) void FCM_Dialog::removeAll() { - QMessageBox::StandardButton button = QMessageBox::warning(this, tr("Confirmation"), - tr("Are you sure you want to delete all flash cookies on your computer?"), QMessageBox::Yes | QMessageBox::No); + QMessageBox::StandardButton button = QMessageBox::warning(this, i18n("Confirmation"), + i18n("Are you sure you want to delete all flash cookies on your computer?"), QMessageBox::Yes | QMessageBox::No); if (button != QMessageBox::Yes) { return; } @@ -148,12 +150,12 @@ void FCM_Dialog::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* p ui->textEdit->clear(); const QVariant data = current->data(0, Qt::UserRole + 10); if (data.isNull()) { - ui->name->setText(tr("")); - ui->size->setText(tr("")); - ui->server->setText(tr("")); - ui->lastModified->setText(tr("")); + ui->name->setText(i18n("")); + ui->size->setText(i18n("")); + ui->server->setText(i18n("")); + ui->lastModified->setText(i18n("")); - ui->removeOne->setText(tr("Remove flash cookies")); + ui->removeOne->setText(i18n("Remove flash cookies")); ui->path->hide(); ui->labelPath->hide(); return; @@ -163,16 +165,16 @@ void FCM_Dialog::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* p QString suffix; if (flashCookie.path.startsWith(m_manager->flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys"))) { - suffix = tr(" (settings)"); + suffix = i18n(" (settings)"); } ui->name->setText(flashCookie.name + suffix); - ui->size->setText(QString::number(flashCookie.size) + tr(" Byte")); + ui->size->setText(QString::number(flashCookie.size) + i18n(" Byte")); ui->textEdit->setPlainText(flashCookie.contents); ui->server->setText(flashCookie.origin); ui->path->setText(QString("%2").arg(QUrl::fromLocalFile(flashCookie.path).toString()).arg(QDir::toNativeSeparators(flashCookie.path))); ui->lastModified->setText(flashCookie.lastModification.toString()); - ui->removeOne->setText(tr("Remove flash cookie")); + ui->removeOne->setText(i18n("Remove flash cookie")); ui->labelPath->show(); ui->path->show(); @@ -234,11 +236,11 @@ void FCM_Dialog::refreshFlashCookiesTree() QString suffix; if (flashCookie.path.startsWith(m_manager->flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys"))) { - suffix = tr(" (settings)"); + suffix = i18n(" (settings)"); } if (m_manager->newCookiesList().contains(flashCookie.path + QL1C('/') + flashCookie.name)) { - suffix += tr(" [new]"); + suffix += i18n(" [new]"); QFont font = item->font(0); font.setBold(true); item->setFont(0, font); @@ -274,7 +276,7 @@ void FCM_Dialog::refreshFilters() void FCM_Dialog::addWhitelist() { - const QString origin = QInputDialog::getText(this, tr("Add to whitelist"), tr("Origin:")); + const QString origin = QInputDialog::getText(this, i18n("Add to whitelist"), i18n("Origin:")); addWhitelist(origin); } @@ -286,7 +288,7 @@ void FCM_Dialog::addWhitelist(const QString &origin) } if (!ui->blackList->findItems(origin, Qt::MatchFixedString).isEmpty()) { - QMessageBox::information(this, tr("Already whitelisted!"), tr("The server \"%1\" is already in blacklist, please remove it first.").arg(origin)); + QMessageBox::information(this, i18n("Already whitelisted!"), i18n("The server \"%1\" is already in blacklist, please remove it first.", origin)); return; } @@ -302,7 +304,7 @@ void FCM_Dialog::removeWhitelist() void FCM_Dialog::addBlacklist() { - const QString origin = QInputDialog::getText(this, tr("Add to blacklist"), tr("Origin:")); + const QString origin = QInputDialog::getText(this, i18n("Add to blacklist"), i18n("Origin:")); addBlacklist(origin); } @@ -314,7 +316,7 @@ void FCM_Dialog::addBlacklist(const QString &origin) } if (!ui->whiteList->findItems(origin, Qt::MatchFixedString).isEmpty()) { - QMessageBox::information(this, tr("Already whitelisted!"), tr("The origin \"%1\" is already in whitelist, please remove it first.").arg(origin)); + QMessageBox::information(this, i18n("Already whitelisted!"), i18n("The origin \"%1\" is already in whitelist, please remove it first.", origin)); return; } @@ -371,8 +373,8 @@ void FCM_Dialog::reloadFromDisk() void FCM_Dialog::cookieTreeContextMenuRequested(const QPoint &pos) { QMenu menu; - QAction* actAddBlacklist = menu.addAction(tr("Add to blacklist")); - QAction* actAddWhitelist = menu.addAction(tr("Add to whitelist")); + QAction* actAddBlacklist = menu.addAction(i18n("Add to blacklist")); + QAction* actAddWhitelist = menu.addAction(i18n("Add to whitelist")); QTreeWidgetItem* item = ui->flashCookieTree->itemAt(pos); diff --git a/src/plugins/FlashCookieManager/fcm_notification.cpp b/src/plugins/FlashCookieManager/fcm_notification.cpp index 3f8545523..5d0219f90 100644 --- a/src/plugins/FlashCookieManager/fcm_notification.cpp +++ b/src/plugins/FlashCookieManager/fcm_notification.cpp @@ -20,6 +20,8 @@ #include "iconprovider.h" #include "fcm_plugin.h" +#include + FCM_Notification::FCM_Notification(FCM_Plugin* manager, int newOriginsCount) : AnimatedWidget(AnimatedWidget::Down, 300, 0) , ui(new Ui::FCM_Notification) @@ -31,10 +33,10 @@ FCM_Notification::FCM_Notification(FCM_Plugin* manager, int newOriginsCount) ui->close->setIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton)); if (newOriginsCount == 1) { - ui->textLabel->setText(tr("A new flash cookie was detected")); + ui->textLabel->setText(i18n("A new flash cookie was detected")); } else { - ui->textLabel->setText(tr("%1 new flash cookies were detected").arg(newOriginsCount)); + ui->textLabel->setText(i18n("%1 new flash cookies were detected", newOriginsCount)); } connect(ui->buttonView, SIGNAL(clicked()), m_manager, SLOT(showFlashCookieManager())); connect(ui->buttonView, SIGNAL(clicked()), this, SLOT(hide())); diff --git a/src/plugins/FlashCookieManager/fcm_plugin.cpp b/src/plugins/FlashCookieManager/fcm_plugin.cpp index 7603a87f2..e2205721b 100644 --- a/src/plugins/FlashCookieManager/fcm_plugin.cpp +++ b/src/plugins/FlashCookieManager/fcm_plugin.cpp @@ -34,6 +34,8 @@ #include #include +#include + #if defined(Q_OS_WIN) || defined(Q_OS_OS2) #include #endif @@ -55,7 +57,7 @@ public: QString name() const override { - return tr("Flash Cookie Manager button"); + return i18n("Flash Cookie Manager button"); } }; @@ -123,7 +125,7 @@ void FCM_Plugin::showSettings(QWidget* parent) void FCM_Plugin::populateExtensionsMenu(QMenu* menu) { - QAction* showFCM = new QAction(QIcon(":/flashcookiemanager/data/flash-cookie-manager.png"), tr("Flash Cookie Manager"), menu); + QAction* showFCM = new QAction(QIcon(":/flashcookiemanager/data/flash-cookie-manager.png"), i18n("Flash Cookie Manager"), menu); connect(showFCM, &QAction::triggered, this, &FCM_Plugin::showFlashCookieManager); menu->addAction(showFCM); } @@ -353,8 +355,8 @@ AbstractButtonInterface* FCM_Plugin::createStatusBarIcon(BrowserWindow* mainWind FCM_Button* icon = new FCM_Button(this); icon->setIcon(QIcon(QSL(":/flashcookiemanager/data/flash-cookie-manager.png"))); - icon->setTitle(tr("Flash Cookie Manager")); - icon->setToolTip(tr("Show Flash Cookie Manager")); + icon->setTitle(i18n("Flash Cookie Manager")); + icon->setToolTip(i18n("Show Flash Cookie Manager")); connect(icon, &AbstractButtonInterface::clicked, this, &FCM_Plugin::showFlashCookieManager); m_statusBarIcons.insert(mainWindow, icon); @@ -435,7 +437,7 @@ QString FCM_Plugin::extractOriginFrom(const QString &path) else if (path.startsWith(flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys/"))) { origin.remove(flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys/")); if (origin == QL1S("settings.sol")) { - return tr("!default"); + return i18n("!default"); } else if (origin.startsWith(QL1C('#'))) { origin.remove(0, 1); @@ -447,7 +449,7 @@ QString FCM_Plugin::extractOriginFrom(const QString &path) int index = origin.indexOf(QL1C('/')); if (index == -1) { - return tr("!other"); + return i18n("!other"); } origin = origin.remove(index, origin.size()); if (origin == QL1S("localhost") || origin == QL1S("local")) { diff --git a/src/plugins/GreaseMonkey/CMakeLists.txt b/src/plugins/GreaseMonkey/CMakeLists.txt index a945ed608..a63d090c5 100644 --- a/src/plugins/GreaseMonkey/CMakeLists.txt +++ b/src/plugins/GreaseMonkey/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_greasemonkey") + include_directories(settings) set( GreaseMonkey_SRCS @@ -15,15 +17,13 @@ set( GreaseMonkey_SRCS settings/gm_settingslistwidget.cpp ) -ecm_create_qm_loader( GreaseMonkey_SRCS falkon_greasemonkey_qt ) - set( GreaseMonkey_UIS gm_addscriptdialog.ui gm_notification.ui settings/gm_settings.ui settings/gm_settingsscriptinfo.ui ) -qt5_wrap_ui(UIS ${GreaseMonkey_UIS}) +ki18n_wrap_ui(UIS ${GreaseMonkey_UIS}) set( GreaseMonkey_RSCS greasemonkey.qrc diff --git a/src/plugins/GreaseMonkey/Messages.sh b/src/plugins/GreaseMonkey/Messages.sh index e18ac2d06..4bdc540ef 100644 --- a/src/plugins/GreaseMonkey/Messages.sh +++ b/src/plugins/GreaseMonkey/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_greasemonkey_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_greasemonkey.pot diff --git a/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp b/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp index c66a2d820..6b92a3039 100644 --- a/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp +++ b/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp @@ -31,6 +31,8 @@ #include #include +#include + GM_AddScriptDialog::GM_AddScriptDialog(GM_Manager* manager, GM_Script* script, QWidget* parent) : QDialog(parent) , ui(new Ui::GM_AddScriptDialog) @@ -47,11 +49,11 @@ GM_AddScriptDialog::GM_AddScriptDialog(GM_Manager* manager, GM_Script* script, Q const QStringList exclude = script->exclude(); if (!include.isEmpty()) { - runsAt = tr("

runs at
%1

").arg(include.join("
")); + runsAt = i18n("

runs at
%1

", include.join("
")); } if (!exclude.isEmpty()) { - dontRunsAt = tr("

does not run at
%1

").arg(exclude.join("
")); + dontRunsAt = i18n("

does not run at
%1

", exclude.join("
")); } QString scriptInfo = QString("%1 %2
%3 %4 %5").arg(script->name(), script->version(), script->description(), runsAt, dontRunsAt); @@ -81,10 +83,10 @@ void GM_AddScriptDialog::showSource() void GM_AddScriptDialog::accepted() { - QString message = tr("Cannot install script"); + QString message = i18n("Cannot install script"); if (m_manager->addScript(m_script)) { - message = tr("'%1' installed successfully").arg(m_script->name()); + message = i18n("'%1' installed successfully", m_script->name()); } m_manager->showNotification(message); diff --git a/src/plugins/GreaseMonkey/gm_icon.cpp b/src/plugins/GreaseMonkey/gm_icon.cpp index 15c84eb94..91cc9bcf6 100644 --- a/src/plugins/GreaseMonkey/gm_icon.cpp +++ b/src/plugins/GreaseMonkey/gm_icon.cpp @@ -20,13 +20,15 @@ #include "webview.h" +#include + GM_Icon::GM_Icon(GM_Manager *manager) : AbstractButtonInterface(manager) , m_manager(manager) { setIcon(QIcon(":gm/data/icon.svg")); - setTitle(tr("GreaseMonkey")); - setToolTip(tr("Open GreaseMonkey settings")); + setTitle(i18n("GreaseMonkey")); + setToolTip(i18n("Open GreaseMonkey settings")); connect(this, &AbstractButtonInterface::clicked, this, &GM_Icon::openSettings); } @@ -38,7 +40,7 @@ QString GM_Icon::id() const QString GM_Icon::name() const { - return tr("GreaseMonkey Icon"); + return i18n("GreaseMonkey Icon"); } void GM_Icon::openSettings() diff --git a/src/plugins/GreaseMonkey/gm_manager.cpp b/src/plugins/GreaseMonkey/gm_manager.cpp index d17f61077..508957b13 100644 --- a/src/plugins/GreaseMonkey/gm_manager.cpp +++ b/src/plugins/GreaseMonkey/gm_manager.cpp @@ -39,6 +39,8 @@ #include #include +#include + GM_Manager::GM_Manager(const QString &sPath, QObject* parent) : QObject(parent) , m_settingsPath(sPath) @@ -74,7 +76,7 @@ void GM_Manager::downloadScript(const QUrl &url) deleteScript = dialog.exec() != QDialog::Accepted; } else { - showNotification(tr("'%1' is already installed").arg(script->name())); + showNotification(i18n("'%1' is already installed", script->name())); } } @@ -227,7 +229,7 @@ void GM_Manager::showNotification(const QString &message, const QString &title) { QIcon icon(":gm/data/icon.svg"); - mApp->desktopNotifications()->showNotification(icon.pixmap(48), title.isEmpty() ? tr("GreaseMonkey") : title, message); + mApp->desktopNotifications()->showNotification(icon.pixmap(48), title.isEmpty() ? i18n("GreaseMonkey") : title, message); } void GM_Manager::load() diff --git a/src/plugins/GreaseMonkey/gm_notification.cpp b/src/plugins/GreaseMonkey/gm_notification.cpp index 2f80a0c9b..86aadef1e 100644 --- a/src/plugins/GreaseMonkey/gm_notification.cpp +++ b/src/plugins/GreaseMonkey/gm_notification.cpp @@ -24,6 +24,8 @@ #include +#include + GM_Notification::GM_Notification(GM_Manager* manager, const QString &tmpfileName, const QString &fileName) : AnimatedWidget(AnimatedWidget::Down, 300, 0) , ui(new Ui::GM_Notification) @@ -48,7 +50,7 @@ void GM_Notification::installScript() bool success = false; GM_Script* script = 0; - QString message = tr("Cannot install script"); + QString message = i18n("Cannot install script"); if (QFile::copy(m_tmpFileName, m_fileName)) { script = new GM_Script(m_manager, m_fileName); @@ -56,7 +58,7 @@ void GM_Notification::installScript() } if (success) { - message = tr("'%1' installed successfully").arg(script->name()); + message = i18n("'%1' installed successfully", script->name()); } m_manager->showNotification(message); diff --git a/src/plugins/GreaseMonkey/settings/gm_settings.cpp b/src/plugins/GreaseMonkey/settings/gm_settings.cpp index bf1162872..6edcb4626 100644 --- a/src/plugins/GreaseMonkey/settings/gm_settings.cpp +++ b/src/plugins/GreaseMonkey/settings/gm_settings.cpp @@ -28,6 +28,8 @@ #include #include +#include + GM_Settings::GM_Settings(GM_Manager* manager, QWidget* parent) : QDialog(parent) , ui(new Ui::GM_Settings) @@ -88,8 +90,8 @@ void GM_Settings::removeItem(QListWidgetItem* item) return; } - QMessageBox::StandardButton button = QMessageBox::question(this, tr("Remove script"), - tr("Are you sure you want to remove '%1'?").arg(script->name()), + QMessageBox::StandardButton button = QMessageBox::question(this, i18n("Remove script"), + i18n("Are you sure you want to remove '%1'?", script->name()), QMessageBox::Yes | QMessageBox::No); if (button == QMessageBox::Yes) { @@ -119,7 +121,7 @@ void GM_Settings::openScriptsDirectory() void GM_Settings::newScript() { - const QString name = QInputDialog::getText(this, tr("Add script"), tr("Choose name for script:")); + const QString name = QInputDialog::getText(this, i18n("Add script"), i18n("Choose name for script:")); if (name.isEmpty()) return; diff --git a/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp b/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp index 2f916b6b3..aac40b2d0 100644 --- a/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp +++ b/src/plugins/GreaseMonkey/settings/gm_settingsscriptinfo.cpp @@ -21,6 +21,8 @@ #include +#include + GM_SettingsScriptInfo::GM_SettingsScriptInfo(GM_Script* script, QWidget* parent) : QDialog(parent) , ui(new Ui::GM_SettingsScriptInfo) @@ -42,7 +44,7 @@ void GM_SettingsScriptInfo::editInTextEditor() void GM_SettingsScriptInfo::loadScript() { - setWindowTitle(tr("Script Details of %1").arg(m_script->name())); + setWindowTitle(i18n("Script Details of %1", m_script->name())); ui->name->setText(m_script->name()); ui->nspace->setText(m_script->nameSpace()); diff --git a/src/plugins/KDEFrameworksIntegration/CMakeLists.txt b/src/plugins/KDEFrameworksIntegration/CMakeLists.txt index 86a6786cb..a6fea578c 100644 --- a/src/plugins/KDEFrameworksIntegration/CMakeLists.txt +++ b/src/plugins/KDEFrameworksIntegration/CMakeLists.txt @@ -1,11 +1,11 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_kdeframeworksintegration") + set(KDEFrameworksIntegration_SRCS kdeframeworksintegrationplugin.cpp kwalletpasswordbackend.cpp kioschemehandler.cpp ) -ecm_create_qm_loader(KDEFrameworksIntegration_SRCS falkon_kdeframeworksintegration_qt) - set(KDEFrameworksIntegration_RSCS kdeframeworksintegration.qrc ) diff --git a/src/plugins/KDEFrameworksIntegration/Messages.sh b/src/plugins/KDEFrameworksIntegration/Messages.sh index 1c03178cb..dca21fb5b 100644 --- a/src/plugins/KDEFrameworksIntegration/Messages.sh +++ b/src/plugins/KDEFrameworksIntegration/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_kdeframeworksintegration_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_kdeframeworksintegration.pot diff --git a/src/plugins/KDEFrameworksIntegration/kdeframeworksintegrationplugin.cpp b/src/plugins/KDEFrameworksIntegration/kdeframeworksintegrationplugin.cpp index 87587d212..c85427088 100644 --- a/src/plugins/KDEFrameworksIntegration/kdeframeworksintegrationplugin.cpp +++ b/src/plugins/KDEFrameworksIntegration/kdeframeworksintegrationplugin.cpp @@ -36,6 +36,8 @@ #include #include +#include + KDEFrameworksIntegrationPlugin::KDEFrameworksIntegrationPlugin() : QObject() { @@ -66,7 +68,7 @@ void KDEFrameworksIntegrationPlugin::init(InitState state, const QString &settin } m_sharePageMenu = new Purpose::Menu(); - m_sharePageMenu->setTitle(tr("Share page")); + m_sharePageMenu->setTitle(i18n("Share page")); m_sharePageMenu->setIcon(QIcon::fromTheme(QStringLiteral("document-share"))); m_sharePageMenu->model()->setPluginType(QStringLiteral("ShareUrl")); diff --git a/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp b/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp index c836d2cc3..df45b539f 100644 --- a/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp +++ b/src/plugins/KDEFrameworksIntegration/kwalletpasswordbackend.cpp @@ -23,6 +23,7 @@ #include #include +#include static PasswordEntry decodeEntry(const QByteArray &data) { @@ -48,7 +49,7 @@ KWalletPasswordBackend::KWalletPasswordBackend() QString KWalletPasswordBackend::name() const { - return KDEFrameworksIntegrationPlugin::tr("KWallet"); + return i18n("KWallet"); } QVector KWalletPasswordBackend::getEntries(const QUrl &url) diff --git a/src/plugins/MouseGestures/CMakeLists.txt b/src/plugins/MouseGestures/CMakeLists.txt index 7d7caf4a8..54514bea2 100644 --- a/src/plugins/MouseGestures/CMakeLists.txt +++ b/src/plugins/MouseGestures/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_mousegestures") + include_directories(3rdparty) set( MouseGestures_HDRS @@ -14,12 +16,10 @@ set( MouseGestures_SRCS mousegesturessettingsdialog.cpp ) -ecm_create_qm_loader( MouseGestures_SRCS falkon_mousegestures_qt ) - set( MouseGestures_UIS mousegesturessettingsdialog.ui ) -qt5_wrap_ui(UIS ${MouseGestures_UIS}) +ki18n_wrap_ui(UIS ${MouseGestures_UIS}) set( MouseGestures_RSCS mousegestures.qrc diff --git a/src/plugins/MouseGestures/Messages.sh b/src/plugins/MouseGestures/Messages.sh index 500269f32..a6499c97f 100644 --- a/src/plugins/MouseGestures/Messages.sh +++ b/src/plugins/MouseGestures/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_mousegestures_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_mousegestures.pot diff --git a/src/plugins/PIM/CMakeLists.txt b/src/plugins/PIM/CMakeLists.txt index 8bebe5eca..d7072b76d 100644 --- a/src/plugins/PIM/CMakeLists.txt +++ b/src/plugins/PIM/CMakeLists.txt @@ -1,15 +1,15 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_pim") + set( PIM_SRCS PIM_plugin.cpp PIM_handler.cpp PIM_settings.cpp ) -ecm_create_qm_loader( PIM_SRCS falkon_pim_qt ) - set( PIM_UIS PIM_settings.ui ) -qt5_wrap_ui(UIS ${PIM_UIS}) +ki18n_wrap_ui(UIS ${PIM_UIS}) set( PIM_RSCS PIM_res.qrc diff --git a/src/plugins/PIM/Messages.sh b/src/plugins/PIM/Messages.sh index 1101ee488..44ea18415 100644 --- a/src/plugins/PIM/Messages.sh +++ b/src/plugins/PIM/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_pim_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_pim.pot diff --git a/src/plugins/PIM/PIM_handler.cpp b/src/plugins/PIM/PIM_handler.cpp index ad6601601..7c2d9c529 100644 --- a/src/plugins/PIM/PIM_handler.cpp +++ b/src/plugins/PIM/PIM_handler.cpp @@ -28,6 +28,8 @@ #include #include +#include + PIM_Handler::PIM_Handler(const QString &sPath, QObject* parent) : QObject(parent) , m_settingsFile(sPath + QL1S("/extensions.ini")) @@ -56,20 +58,20 @@ void PIM_Handler::loadSettings() m_allInfo[PI_Special3] = settings.value("Special3", QString()).toString(); settings.endGroup(); - m_translations[PI_LastName] = tr("Last Name"); - m_translations[PI_FirstName] = tr("First Name"); - m_translations[PI_Email] = tr("E-mail"); - m_translations[PI_Mobile] = tr("Mobile"); - m_translations[PI_Phone] = tr("Phone"); - m_translations[PI_Address] = tr("Address"); - m_translations[PI_City] = tr("City"); - m_translations[PI_Zip] = tr("ZIP Code"); - m_translations[PI_State] = tr("State/Region"); - m_translations[PI_Country] = tr("Country"); - m_translations[PI_HomePage] = tr("Home Page"); - m_translations[PI_Special1] = tr("Custom 1"); - m_translations[PI_Special2] = tr("Custom 2"); - m_translations[PI_Special3] = tr("Custom 3"); + m_translations[PI_LastName] = i18n("Last Name"); + m_translations[PI_FirstName] = i18n("First Name"); + m_translations[PI_Email] = i18n("E-mail"); + m_translations[PI_Mobile] = i18n("Mobile"); + m_translations[PI_Phone] = i18n("Phone"); + m_translations[PI_Address] = i18n("Address"); + m_translations[PI_City] = i18n("City"); + m_translations[PI_Zip] = i18n("ZIP Code"); + m_translations[PI_State] = i18n("State/Region"); + m_translations[PI_Country] = i18n("Country"); + m_translations[PI_HomePage] = i18n("Home Page"); + m_translations[PI_Special1] = i18n("Custom 1"); + m_translations[PI_Special2] = i18n("Custom 2"); + m_translations[PI_Special3] = i18n("Custom 3"); m_infoMatches[PI_LastName] << "lastname" << "surname"; m_infoMatches[PI_FirstName] << "firstname" << "name"; @@ -111,7 +113,7 @@ void PIM_Handler::populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTe loadSettings(); } - QMenu* pimMenu = new QMenu(tr("Insert Personal Information")); + QMenu* pimMenu = new QMenu(i18n("Insert Personal Information")); pimMenu->setIcon(QIcon(":/PIM/data/PIM.png")); if (!m_allInfo[PI_FirstName].isEmpty() && !m_allInfo[PI_LastName].isEmpty()) { @@ -132,7 +134,7 @@ void PIM_Handler::populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTe } pimMenu->addSeparator(); - pimMenu->addAction(tr("Edit"), this, SLOT(showSettings())); + pimMenu->addAction(i18n("Edit"), this, SLOT(showSettings())); menu->addMenu(pimMenu); menu->addSeparator(); diff --git a/src/plugins/PyFalkon/CMakeLists.txt b/src/plugins/PyFalkon/CMakeLists.txt index 7251d8086..5ee46de74 100644 --- a/src/plugins/PyFalkon/CMakeLists.txt +++ b/src/plugins/PyFalkon/CMakeLists.txt @@ -3,7 +3,7 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -# Get all relevant Qt include dirs, to pass them on to shiboken. +# Get all relevant include dirs, to pass them on to shiboken. get_property(QT_CORE_INCLUDE_DIRS TARGET Qt5::Core PROPERTY INTERFACE_INCLUDE_DIRECTORIES) get_property(QT_GUI_INCLUDE_DIRS TARGET Qt5::Gui PROPERTY INTERFACE_INCLUDE_DIRECTORIES) get_property(QT_SQL_INCLUDE_DIRS TARGET Qt5::Sql PROPERTY INTERFACE_INCLUDE_DIRECTORIES) @@ -11,7 +11,9 @@ get_property(QT_WIDGETS_INCLUDE_DIRS TARGET Qt5::Widgets PROPERTY INTERFACE_INCL get_property(QT_NETWORK_INCLUDE_DIRS TARGET Qt5::Network PROPERTY INTERFACE_INCLUDE_DIRECTORIES) get_property(QT_WEBENGINECORE_INCLUDE_DIRS TARGET Qt5::WebEngineCore PROPERTY INTERFACE_INCLUDE_DIRECTORIES) get_property(QT_WEBENGINEWIDGETS_INCLUDE_DIRS TARGET Qt5::WebEngineWidgets PROPERTY INTERFACE_INCLUDE_DIRECTORIES) -set(QT_INCLUDE_DIRS +get_property(KF5_I18N_INCLUDE_DIRS TARGET KF5::I18n PROPERTY INTERFACE_INCLUDE_DIRECTORIES) +get_property(FalkonPrivate_INCLUDE_DIRS TARGET FalkonPrivate PROPERTY INCLUDE_DIRECTORIES) +set(INCLUDE_DIRS ${QT_CORE_INCLUDE_DIRS} ${QT_GUI_INCLUDE_DIRS} ${QT_SQL_INCLUDE_DIRS} @@ -19,14 +21,12 @@ set(QT_INCLUDE_DIRS ${QT_NETWORK_INCLUDE_DIRS} ${QT_WEBENGINECORE_INCLUDE_DIRS} ${QT_WEBENGINEWIDGETS_INCLUDE_DIRS} + ${KF5_I18N_INCLUDE_DIRS} + ${FalkonPrivate_INCLUDE_DIRS} ) -set(INCLUDES "") -foreach(INCLUDE_DIR ${QT_INCLUDE_DIRS}) - list(APPEND INCLUDES "-I${INCLUDE_DIR}") -endforeach() -get_property(FalkonPrivate_INCLUDE_DIRS TARGET FalkonPrivate PROPERTY INCLUDE_DIRECTORIES) -foreach(INCLUDE_DIR ${FalkonPrivate_INCLUDE_DIRS}) - list(APPEND INCLUDES "-I${INCLUDE_DIR}") +set(SHIBOKEN_INCLUDES "") +foreach(INCLUDE_DIR ${INCLUDE_DIRS}) + list(APPEND SHIBOKEN_INCLUDES "-I${INCLUDE_DIR}") endforeach() # Set up the options to pass to shiboken. @@ -36,7 +36,7 @@ set(TYPESYSTEM_FILE ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_pyfalkon.xml) set(SHIBOKEN_OPTIONS --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack - ${INCLUDES} + ${SHIBOKEN_INCLUDES} -T${PYSIDE_TYPESYSTEMS} --output-directory=${CMAKE_CURRENT_BINARY_DIR} --api-version="${Qt5_VERSION_MAJOR}.${Qt5_VERSION_MINOR}" diff --git a/src/plugins/PyFalkon/typesystem_pyfalkon.xml b/src/plugins/PyFalkon/typesystem_pyfalkon.xml index 01388ecbc..da4d223e5 100644 --- a/src/plugins/PyFalkon/typesystem_pyfalkon.xml +++ b/src/plugins/PyFalkon/typesystem_pyfalkon.xml @@ -166,13 +166,7 @@ - - - - - - - + diff --git a/src/plugins/StatusBarIcons/CMakeLists.txt b/src/plugins/StatusBarIcons/CMakeLists.txt index 552d81265..61690c287 100644 --- a/src/plugins/StatusBarIcons/CMakeLists.txt +++ b/src/plugins/StatusBarIcons/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_statusbaricons") + set( StatusBarIcons_SRCS statusbariconsplugin.cpp sbi_iconsmanager.cpp @@ -13,14 +15,12 @@ set( StatusBarIcons_SRCS sbi_zoomwidget.cpp ) -ecm_create_qm_loader( StatusBarIcons_SRCS falkon_statusbaricons_qt ) - set( StatusBarIcons_UIS sbi_proxywidget.ui sbi_networkicondialog.ui sbi_settingsdialog.ui ) -qt5_wrap_ui(UIS ${StatusBarIcons_UIS}) +ki18n_wrap_ui(UIS ${StatusBarIcons_UIS}) set( StatusBarIcons_RSCS statusbaricons.qrc diff --git a/src/plugins/StatusBarIcons/Messages.sh b/src/plugins/StatusBarIcons/Messages.sh index 7981bf618..6528e0060 100644 --- a/src/plugins/StatusBarIcons/Messages.sh +++ b/src/plugins/StatusBarIcons/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_statusbaricons_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_statusbaricons.pot diff --git a/src/plugins/StatusBarIcons/sbi_imagesicon.cpp b/src/plugins/StatusBarIcons/sbi_imagesicon.cpp index db61f92ce..a7dec8a55 100644 --- a/src/plugins/StatusBarIcons/sbi_imagesicon.cpp +++ b/src/plugins/StatusBarIcons/sbi_imagesicon.cpp @@ -26,12 +26,14 @@ #include #include +#include + SBI_ImagesIcon::SBI_ImagesIcon(BrowserWindow* window, const QString &settingsPath) : SBI_Icon(window, settingsPath) { setObjectName(QSL("sbi_imagesicon")); setCursor(Qt::PointingHandCursor); - setToolTip(tr("Modify images loading settings per-site and globally")); + setToolTip(i18n("Modify images loading settings per-site and globally")); m_icon = QIcon::fromTheme("image-x-generic", QIcon(":sbi/data/images.png")); setPixmap(m_icon.pixmap(16)); @@ -55,19 +57,19 @@ void SBI_ImagesIcon::showMenu(const QPoint &point) boldFont.setBold(true); QMenu menu; - menu.addAction(m_icon, tr("Current Page Settings"))->setFont(boldFont); + menu.addAction(m_icon, i18n("Current Page Settings"))->setFont(boldFont); if (testCurrentPageWebAttribute(QWebEngineSettings::AutoLoadImages)) { - menu.addAction(tr("Disable loading images (temporarily)"), this, &SBI_ImagesIcon::toggleLoadingImages); + menu.addAction(i18n("Disable loading images (temporarily)"), this, &SBI_ImagesIcon::toggleLoadingImages); } else { - menu.addAction(tr("Enable loading images (temporarily)"), this, &SBI_ImagesIcon::toggleLoadingImages); + menu.addAction(i18n("Enable loading images (temporarily)"), this, &SBI_ImagesIcon::toggleLoadingImages); } menu.addSeparator(); - menu.addAction(m_icon, tr("Global Settings"))->setFont(boldFont); + menu.addAction(m_icon, i18n("Global Settings"))->setFont(boldFont); - QAction* act = menu.addAction(tr("Automatically load images")); + QAction* act = menu.addAction(i18n("Automatically load images")); act->setCheckable(true); act->setChecked(m_loadingImages); connect(act, &QAction::toggled, this, &SBI_ImagesIcon::setGlobalLoadingImages); diff --git a/src/plugins/StatusBarIcons/sbi_javascripticon.cpp b/src/plugins/StatusBarIcons/sbi_javascripticon.cpp index c646af78b..74dba2635 100644 --- a/src/plugins/StatusBarIcons/sbi_javascripticon.cpp +++ b/src/plugins/StatusBarIcons/sbi_javascripticon.cpp @@ -26,12 +26,14 @@ #include #include +#include + SBI_JavaScriptIcon::SBI_JavaScriptIcon(BrowserWindow* window) : SBI_Icon(window) { setObjectName(QSL("sbi_javascripticon")); setCursor(Qt::PointingHandCursor); - setToolTip(tr("Modify JavaScript settings per-site and globally")); + setToolTip(i18n("Modify JavaScript settings per-site and globally")); m_icon = QIcon::fromTheme("application-x-javascript", QIcon(":sbi/data/javascript.png")); setPixmap(m_icon.pixmap(16)); @@ -48,13 +50,13 @@ void SBI_JavaScriptIcon::showMenu(const QPoint &point) boldFont.setBold(true); QMenu menu; - menu.addAction(m_icon, tr("Current Page Settings"))->setFont(boldFont); + menu.addAction(m_icon, i18n("Current Page Settings"))->setFont(boldFont); if (testCurrentPageWebAttribute(QWebEngineSettings::JavascriptEnabled)) { - menu.addAction(tr("Disable JavaScript (temporarily)"), this, &SBI_JavaScriptIcon::toggleJavaScript); + menu.addAction(i18n("Disable JavaScript (temporarily)"), this, &SBI_JavaScriptIcon::toggleJavaScript); } else { - menu.addAction(tr("Enable JavaScript (temporarily)"), this, &SBI_JavaScriptIcon::toggleJavaScript); + menu.addAction(i18n("Enable JavaScript (temporarily)"), this, &SBI_JavaScriptIcon::toggleJavaScript); } // JavaScript needs to be always enabled for falkon: sites @@ -63,8 +65,8 @@ void SBI_JavaScriptIcon::showMenu(const QPoint &point) } menu.addSeparator(); - menu.addAction(m_icon, tr("Global Settings"))->setFont(boldFont); - menu.addAction(tr("Manage JavaScript settings"), this, &SBI_JavaScriptIcon::openJavaScriptSettings); + menu.addAction(m_icon, i18n("Global Settings"))->setFont(boldFont); + menu.addAction(i18n("Manage JavaScript settings"), this, &SBI_JavaScriptIcon::openJavaScriptSettings); menu.exec(point); } diff --git a/src/plugins/StatusBarIcons/sbi_networkicon.cpp b/src/plugins/StatusBarIcons/sbi_networkicon.cpp index 80a72f987..9a91b0522 100644 --- a/src/plugins/StatusBarIcons/sbi_networkicon.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkicon.cpp @@ -25,6 +25,8 @@ #include #include +#include + SBI_NetworkIcon::SBI_NetworkIcon(BrowserWindow* window) : SBI_Icon(window) , m_networkConfiguration(new QNetworkConfigurationManager(this)) @@ -62,9 +64,9 @@ void SBI_NetworkIcon::showMenu(const QPoint &pos) boldFont.setBold(true); QMenu menu; - menu.addAction(QIcon::fromTheme("preferences-system-network", QIcon(":sbi/data/preferences-network.png")), tr("Proxy Configuration"))->setFont(boldFont); + menu.addAction(QIcon::fromTheme("preferences-system-network", QIcon(":sbi/data/preferences-network.png")), i18n("Proxy Configuration"))->setFont(boldFont); - QMenu* proxyMenu = menu.addMenu(tr("Select proxy")); + QMenu* proxyMenu = menu.addMenu(i18n("Select proxy")); const QHash &proxies = SBINetManager->proxies(); @@ -78,11 +80,11 @@ void SBI_NetworkIcon::showMenu(const QPoint &pos) } if (proxyMenu->actions().count() == 0) { - proxyMenu->addAction(tr("Empty"))->setEnabled(false); + proxyMenu->addAction(i18n("Empty"))->setEnabled(false); } menu.addSeparator(); - menu.addAction(tr("Manage proxies"), this, &SBI_NetworkIcon::showDialog); + menu.addAction(i18n("Manage proxies"), this, &SBI_NetworkIcon::showDialog); menu.exec(pos); } @@ -98,23 +100,23 @@ void SBI_NetworkIcon::updateToolTip() QString tooltip = tr("Shows network status and manages proxy

Network:
%1

Proxy:
%2"); if (m_networkConfiguration->isOnline()) { - tooltip = tooltip.arg(tr("Connected")); + tooltip = tooltip.arg(i18n("Connected")); } else { - tooltip = tooltip.arg(tr("Offline")); + tooltip = tooltip.arg(i18n("Offline")); } switch (QNetworkProxy::applicationProxy().type()) { case QNetworkProxy::DefaultProxy: - tooltip = tooltip.arg(tr("System proxy")); + tooltip = tooltip.arg(i18n("System proxy")); break; case QNetworkProxy::NoProxy: - tooltip = tooltip.arg(tr("No proxy")); + tooltip = tooltip.arg(i18n("No proxy")); break; default: - tooltip = tooltip.arg(tr("User defined")); + tooltip = tooltip.arg(i18n("User defined")); break; } diff --git a/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp b/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp index 6536a369c..9de80ba70 100644 --- a/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkicondialog.cpp @@ -23,6 +23,8 @@ #include #include +#include + SBI_NetworkIconDialog::SBI_NetworkIconDialog(QWidget* parent) : QDialog(parent) , ui(new Ui::SBI_NetworkIconDialog) @@ -54,7 +56,7 @@ SBI_NetworkIconDialog::SBI_NetworkIconDialog(QWidget* parent) void SBI_NetworkIconDialog::addProxy() { - const QString name = QInputDialog::getText(this, tr("Add proxy"), tr("Name of proxy:")); + const QString name = QInputDialog::getText(this, i18n("Add proxy"), i18n("Name of proxy:")); if (name.isEmpty() || ui->comboBox->findText(name) > -1) { return; } @@ -67,7 +69,7 @@ void SBI_NetworkIconDialog::addProxy() void SBI_NetworkIconDialog::removeProxy() { - QMessageBox::StandardButton button = QMessageBox::warning(this, tr("Remove current proxy"), tr("Are you sure you want to remove current proxy?"), + QMessageBox::StandardButton button = QMessageBox::warning(this, i18n("Remove current proxy"), i18n("Are you sure you want to remove current proxy?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if (button != QMessageBox::Yes) { diff --git a/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp b/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp index 39becd94c..b378a8b1d 100644 --- a/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp +++ b/src/plugins/StatusBarIcons/sbi_zoomwidget.cpp @@ -20,6 +20,8 @@ #include "browserwindow.h" #include "tabwidget.h" +#include + SBI_ZoomWidget::SBI_ZoomWidget(BrowserWindow* parent) : QSlider(parent) , m_window(parent) @@ -45,7 +47,7 @@ void SBI_ZoomWidget::valueChanged(int value) if (view) { view->setZoomLevel(value); - setToolTip(tr("Zoom: %1%").arg(view->zoomFactor() * 100)); + setToolTip(i18n("Zoom: %1%", view->zoomFactor() * 100)); } } diff --git a/src/plugins/TabManager/CMakeLists.txt b/src/plugins/TabManager/CMakeLists.txt index d3beae177..b1fd485c1 100644 --- a/src/plugins/TabManager/CMakeLists.txt +++ b/src/plugins/TabManager/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_tabmanager") + set( TabManager_SRCS tabmanagerplugin.cpp tabmanagerwidget.cpp @@ -7,13 +9,11 @@ set( TabManager_SRCS tldextractor/tldextractor.cpp ) -ecm_create_qm_loader( TabManager_SRCS falkon_tabmanager_qt ) - set( TabManager_UIS tabmanagerwidget.ui tabmanagersettings.ui ) -qt5_wrap_ui(UIS ${TabManager_UIS}) +ki18n_wrap_ui(UIS ${TabManager_UIS}) set( TabManager_RSCS tabmanagerplugin.qrc diff --git a/src/plugins/TabManager/Messages.sh b/src/plugins/TabManager/Messages.sh index 282658745..195d0c9dc 100644 --- a/src/plugins/TabManager/Messages.sh +++ b/src/plugins/TabManager/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_tabmanager_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_tabmanager.pot diff --git a/src/plugins/TabManager/tabmanagerwidget.cpp b/src/plugins/TabManager/tabmanagerwidget.cpp index 516e84d95..7716f932a 100644 --- a/src/plugins/TabManager/tabmanagerwidget.cpp +++ b/src/plugins/TabManager/tabmanagerwidget.cpp @@ -42,6 +42,7 @@ #include #include +#include TLDExtractor* TabManagerWidget::s_tldExtractor = 0; @@ -108,13 +109,13 @@ QString TabManagerWidget::domainFromUrl(const QUrl &url, bool useHostName) QString urlString = url.toString(); if (url.scheme() == "file") { - return tr("Local File System:"); + return i18n("Local File System:"); } else if (url.scheme() == "falkon" || urlString.isEmpty()) { - return tr("Falkon:"); + return i18n("Falkon:"); } else if (url.scheme() == "ftp") { - appendString.prepend(tr(" [FTP]")); + appendString.prepend(i18n(" [FTP]")); } QString host = url.host(); @@ -303,18 +304,18 @@ void TabManagerWidget::customContextMenuRequested(const QPoint &pos) menu->setAttribute(Qt::WA_DeleteOnClose); QAction* action; - QMenu groupTypeSubmenu(tr("Group by")); - action = groupTypeSubmenu.addAction(tr("&Window"), this, &TabManagerWidget::changeGroupType); + QMenu groupTypeSubmenu(i18n("Group by")); + action = groupTypeSubmenu.addAction(i18n("&Window"), this, &TabManagerWidget::changeGroupType); action->setData(GroupByWindow); action->setCheckable(true); action->setChecked(m_groupType == GroupByWindow); - action = groupTypeSubmenu.addAction(tr("&Domain"), this, &TabManagerWidget::changeGroupType); + action = groupTypeSubmenu.addAction(i18n("&Domain"), this, &TabManagerWidget::changeGroupType); action->setData(GroupByDomain); action->setCheckable(true); action->setChecked(m_groupType == GroupByDomain); - action = groupTypeSubmenu.addAction(tr("&Host"), this, &TabManagerWidget::changeGroupType); + action = groupTypeSubmenu.addAction(i18n("&Host"), this, &TabManagerWidget::changeGroupType); action->setData(GroupByHost); action->setCheckable(true); action->setChecked(m_groupType == GroupByHost); @@ -322,16 +323,16 @@ void TabManagerWidget::customContextMenuRequested(const QPoint &pos) menu->addMenu(&groupTypeSubmenu); if (m_isDefaultWidget) { - menu->addAction(QIcon(":/tabmanager/data/side-by-side.png"), tr("&Show side by side"), this, &TabManagerWidget::showSideBySide)->setObjectName("sideBySide"); + menu->addAction(QIcon(":/tabmanager/data/side-by-side.png"), i18n("&Show side by side"), this, &TabManagerWidget::showSideBySide)->setObjectName("sideBySide"); } menu->addSeparator(); if (isTabSelected()) { - menu->addAction(QIcon(":/tabmanager/data/tab-detach.png"), tr("&Detach checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("detachSelection"); - menu->addAction(QIcon(":/tabmanager/data/tab-bookmark.png"), tr("Book&mark checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("bookmarkSelection"); - menu->addAction(QIcon(":/tabmanager/data/tab-close.png"), tr("&Close checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("closeSelection"); - menu->addAction(tr("&Unload checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("unloadSelection"); + menu->addAction(QIcon(":/tabmanager/data/tab-detach.png"), i18n("&Detach checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("detachSelection"); + menu->addAction(QIcon(":/tabmanager/data/tab-bookmark.png"), i18n("Book&mark checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("bookmarkSelection"); + menu->addAction(QIcon(":/tabmanager/data/tab-close.png"), i18n("&Close checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("closeSelection"); + menu->addAction(i18n("&Unload checked tabs"), this, &TabManagerWidget::processActions)->setObjectName("unloadSelection"); } menu->exec(ui->treeWidget->viewport()->mapToGlobal(pos)); @@ -583,8 +584,8 @@ bool TabManagerWidget::bookmarkSelectedTabs(const QHash layout->addWidget(folderButton); layout->addWidget(box); - label->setText(tr("Choose folder for bookmarks:")); - dialog->setWindowTitle(tr("Bookmark Selected Tabs")); + label->setText(i18n("Choose folder for bookmarks:")); + dialog->setWindowTitle(i18n("Bookmark Selected Tabs")); QSize size = dialog->size(); size.setWidth(350); @@ -702,8 +703,8 @@ QTreeWidgetItem* TabManagerWidget::groupByWindow() BrowserWindow* mainWin = windows.at(win); TabItem* winItem = new TabItem(ui->treeWidget, true, false); winItem->setBrowserWindow(mainWin); - winItem->setText(0, tr("Window %1").arg(QString::number(win + 1))); - winItem->setToolTip(0, tr("Double click to switch")); + winItem->setText(0, i18n("Window %1", win + 1)); + winItem->setToolTip(0, i18n("Double click to switch")); winItem->setIsActiveOrCaption(win == currentWindowIdx); QList tabs = mainWin->tabWidget()->allTabs(); diff --git a/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp b/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp index 999f9678e..c18b406a4 100644 --- a/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp +++ b/src/plugins/TabManager/tabmanagerwidgetcontroller.cpp @@ -29,9 +29,10 @@ #include #include #include - #include +#include + class TabManagerButton : public AbstractButtonInterface { public: @@ -47,7 +48,7 @@ public: QString name() const override { - return tr("Tab Manager button"); + return i18n("Tab Manager button"); } }; @@ -65,12 +66,12 @@ TabManagerWidgetController::~TabManagerWidgetController() QString TabManagerWidgetController::title() const { - return tr("Tab Manager"); + return i18n("Tab Manager"); } QAction* TabManagerWidgetController::createMenuAction() { - QAction* act = new QAction(tr("Tab Manager"), this); + QAction* act = new QAction(i18n("Tab Manager"), this); act->setCheckable(true); act->setIcon(QIcon(":tabmanager/data/tabmanager.png")); act->setShortcut(QKeySequence("Ctrl+Shift+M")); @@ -96,8 +97,8 @@ AbstractButtonInterface* TabManagerWidgetController::createStatusBarIcon(Browser TabManagerButton* icon = new TabManagerButton(this); icon->setIcon(QPixmap(":tabmanager/data/tabmanager.png")); - icon->setTitle(tr("Tab Manager")); - icon->setToolTip(tr("Show Tab Manager")); + icon->setTitle(i18n("Tab Manager")); + icon->setToolTip(i18n("Show Tab Manager")); connect(icon, &AbstractButtonInterface::clicked, this, [=](AbstractButtonInterface::ClickController *c) { if (!defaultTabManager()) { return; diff --git a/src/plugins/TabManager/tldextractor/tldextractor.cpp b/src/plugins/TabManager/tldextractor/tldextractor.cpp index 830dc3ee9..b0844dbf1 100644 --- a/src/plugins/TabManager/tldextractor/tldextractor.cpp +++ b/src/plugins/TabManager/tldextractor/tldextractor.cpp @@ -23,6 +23,8 @@ #include #include +#include + TLDExtractor* TLDExtractor::s_instance = 0; TLDExtractor::TLDExtractor(QObject* parent) @@ -257,10 +259,10 @@ void TLDExtractor::loadData() if (!parsedDataFileExist) { const QString tldDataFileDownloadLink = QLatin1String("http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1"); - QMessageBox::information(0, tr("File not found!"), - tr("File \'effective_tld_names.dat\' was not found!\n" - "You can download it from \'here\' to one of the following paths:\n%2") - .arg(tldDataFileDownloadLink).arg(m_dataSearchPaths.join("\n"))); + QMessageBox::information(0, i18n("File not found!"), + i18n("File \'effective_tld_names.dat\' was not found!\n" + "You can download it from \'here\' to one of the following paths:\n%2", + tldDataFileDownloadLink, m_dataSearchPaths.join("\n"))); return; } @@ -360,10 +362,10 @@ bool TLDExtractor::test() if (!testDataFileExist) { const QString testFileDownloadLink = QLatin1String("http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1"); - QMessageBox::information(0, tr("File not found!"), - tr("File \'test_psl.txt\' was not found!\n" - "You can download it from \'here\' to one of the following paths:\n%2") - .arg(testFileDownloadLink).arg(m_dataSearchPaths.join("\n"))); + QMessageBox::information(0, i18n("File not found!"), + i18n("File \'test_psl.txt\' was not found!\n" + "You can download it from \'here\' to one of the following paths:\n%2", + testFileDownloadLink, m_dataSearchPaths.join("\n"))); return false; } diff --git a/src/plugins/TestPlugin/CMakeLists.txt b/src/plugins/TestPlugin/CMakeLists.txt index e907ed834..900450b71 100644 --- a/src/plugins/TestPlugin/CMakeLists.txt +++ b/src/plugins/TestPlugin/CMakeLists.txt @@ -1,10 +1,10 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_testplugin") + set( TestPlugin_SRCS testplugin.cpp testplugin_sidebar.cpp ) -ecm_create_qm_loader( TestPlugin_SRCS falkon_testplugin_qt ) - add_library(TestPlugin MODULE ${TestPlugin_SRCS} ${RSCS}) install(TARGETS TestPlugin DESTINATION ${FALKON_INSTALL_PLUGINDIR}) target_link_libraries(TestPlugin FalkonPrivate) diff --git a/src/plugins/TestPlugin/Messages.sh b/src/plugins/TestPlugin/Messages.sh index 35ba0d260..5374c317d 100644 --- a/src/plugins/TestPlugin/Messages.sh +++ b/src/plugins/TestPlugin/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_testplugin_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_testplugin.pot diff --git a/src/plugins/TestPlugin/testplugin.cpp b/src/plugins/TestPlugin/testplugin.cpp index d884449d1..48f3bc0b4 100644 --- a/src/plugins/TestPlugin/testplugin.cpp +++ b/src/plugins/TestPlugin/testplugin.cpp @@ -28,6 +28,8 @@ #include #include +#include + TestPlugin::TestPlugin() : QObject() , m_view(0) @@ -95,7 +97,7 @@ void TestPlugin::showSettings(QWidget* parent) if (!m_settings) { m_settings = new QDialog(parent); QPushButton* b = new QPushButton("Example Plugin v0.0.1"); - QPushButton* closeButton = new QPushButton(tr("Close")); + QPushButton* closeButton = new QPushButton(i18n("Close")); QLabel* label = new QLabel(); label->setPixmap(QPixmap(":icons/other/about.svg")); @@ -106,7 +108,7 @@ void TestPlugin::showSettings(QWidget* parent) m_settings.data()->setLayout(l); m_settings.data()->setAttribute(Qt::WA_DeleteOnClose); - m_settings.data()->setWindowTitle(tr("Example Plugin Settings")); + m_settings.data()->setWindowTitle(i18n("Example Plugin Settings")); m_settings.data()->setWindowIcon(QIcon(":icons/falkon.svg")); connect(closeButton, SIGNAL(clicked()), m_settings.data(), SLOT(close())); } @@ -136,7 +138,7 @@ void TestPlugin::populateWebViewMenu(QMenu* menu, WebView* view, const WebHitTes title += " on input"; } - menu->addAction(tr("My first plugin action") + title, this, SLOT(actionSlot())); + menu->addAction(i18n("My first plugin action") + title, this, SLOT(actionSlot())); } bool TestPlugin::mousePress(Qz::ObjectName type, QObject* obj, QMouseEvent* event) @@ -151,5 +153,5 @@ bool TestPlugin::mousePress(Qz::ObjectName type, QObject* obj, QMouseEvent* even void TestPlugin::actionSlot() { - QMessageBox::information(m_view, tr("Hello"), tr("First plugin action works :-)")); + QMessageBox::information(m_view, i18n("Hello"), i18n("First plugin action works :-)")); } diff --git a/src/plugins/TestPlugin/testplugin_sidebar.cpp b/src/plugins/TestPlugin/testplugin_sidebar.cpp index 74d04219e..bc8604cff 100644 --- a/src/plugins/TestPlugin/testplugin_sidebar.cpp +++ b/src/plugins/TestPlugin/testplugin_sidebar.cpp @@ -22,6 +22,8 @@ #include #include +#include + TestPlugin_Sidebar::TestPlugin_Sidebar(QObject* parent) : SideBarInterface(parent) { @@ -29,7 +31,7 @@ TestPlugin_Sidebar::TestPlugin_Sidebar(QObject* parent) QString TestPlugin_Sidebar::title() const { - return tr("Testing Sidebar"); + return i18n("Testing Sidebar"); } QAction* TestPlugin_Sidebar::createMenuAction() @@ -37,7 +39,7 @@ QAction* TestPlugin_Sidebar::createMenuAction() // The action must be parented to some object from plugin, otherwise // there may be a crash when unloading the plugin. - QAction* act = new QAction(tr("Testing Sidebar"), this); + QAction* act = new QAction(i18n("Testing Sidebar"), this); act->setCheckable(true); return act; diff --git a/src/plugins/VerticalTabs/CMakeLists.txt b/src/plugins/VerticalTabs/CMakeLists.txt index 943973472..c2e989f98 100644 --- a/src/plugins/VerticalTabs/CMakeLists.txt +++ b/src/plugins/VerticalTabs/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DTRANSLATION_DOMAIN="falkon_verticaltabs") + set( VerticalTabs_SRCS verticaltabsplugin.cpp verticaltabscontroller.cpp @@ -12,12 +14,10 @@ set( VerticalTabs_SRCS verticaltabsschemehandler.cpp ) -ecm_create_qm_loader( VerticalTabs_SRCS falkon_verticaltabs_qt ) - set( VerticalTabs_UIS verticaltabssettings.ui ) -qt5_wrap_ui(UIS ${VerticalTabs_UIS}) +ki18n_wrap_ui(UIS ${VerticalTabs_UIS}) set( VerticalTabs_RSCS verticaltabs.qrc diff --git a/src/plugins/VerticalTabs/Messages.sh b/src/plugins/VerticalTabs/Messages.sh index 34e0f4c3c..10b90548a 100644 --- a/src/plugins/VerticalTabs/Messages.sh +++ b/src/plugins/VerticalTabs/Messages.sh @@ -1,2 +1,2 @@ #! /bin/sh -$EXTRACT_TR_STRINGS `find . -name '*.cpp' -o -name '*.h' -o -name '*.ui'` -o $podir/falkon_verticaltabs_qt.pot +$XGETTEXT `find . -name '*.cpp' -o -name '*.h'` -o $podir/falkon_verticaltabs.pot diff --git a/src/plugins/VerticalTabs/tablistview.cpp b/src/plugins/VerticalTabs/tablistview.cpp index 476cf9de3..6c373f667 100644 --- a/src/plugins/VerticalTabs/tablistview.cpp +++ b/src/plugins/VerticalTabs/tablistview.cpp @@ -27,6 +27,8 @@ #include #include +#include + TabListView::TabListView(BrowserWindow *window, QWidget *parent) : QListView(parent) , m_window(window) @@ -193,7 +195,7 @@ bool TabListView::viewportEvent(QEvent *event) DelegateButton button = buttonAt(he->pos(), index); if (button == AudioButton) { const bool muted = index.data(TabModel::AudioMutedRole).toBool(); - QToolTip::showText(he->globalPos(), muted ? tr("Unmute Tab") : tr("Mute Tab"), this, visualRect(index)); + QToolTip::showText(he->globalPos(), muted ? i18n("Unmute Tab") : i18n("Mute Tab"), this, visualRect(index)); he->accept(); return true; } else if (button == NoButton) { diff --git a/src/plugins/VerticalTabs/tabtreeview.cpp b/src/plugins/VerticalTabs/tabtreeview.cpp index c2168e1c9..27bde1aea 100644 --- a/src/plugins/VerticalTabs/tabtreeview.cpp +++ b/src/plugins/VerticalTabs/tabtreeview.cpp @@ -28,6 +28,8 @@ #include #include +#include + TabTreeView::TabTreeView(BrowserWindow *window, QWidget *parent) : QTreeView(parent) , m_window(window) @@ -303,11 +305,11 @@ bool TabTreeView::viewportEvent(QEvent *event) DelegateButton button = buttonAt(he->pos(), index); if (button == AudioButton) { const bool muted = index.data(TabModel::AudioMutedRole).toBool(); - QToolTip::showText(he->globalPos(), muted ? tr("Unmute Tab") : tr("Mute Tab"), this, visualRect(index)); + QToolTip::showText(he->globalPos(), muted ? i18n("Unmute Tab") : i18n("Mute Tab"), this, visualRect(index)); he->accept(); return true; } else if (button == CloseButton) { - QToolTip::showText(he->globalPos(), tr("Close Tab"), this, visualRect(index)); + QToolTip::showText(he->globalPos(), i18n("Close Tab"), this, visualRect(index)); he->accept(); return true; } else if (button == NoButton) { @@ -374,21 +376,21 @@ void TabTreeView::addMenuActions(QMenu *menu, const QModelIndex &index) } menu->addSeparator(); - QMenu *m = menu->addMenu(tr("Tab Tree")); + QMenu *m = menu->addMenu(i18n("Tab Tree")); if (index.isValid() && model()->rowCount(index) > 0) { QPersistentModelIndex pindex = index; - m->addAction(tr("Close Tree"), this, [=]() { + m->addAction(i18n("Close Tree"), this, [=]() { closeTree(pindex); }); - m->addAction(tr("Unload Tree"), this, [=]() { + m->addAction(i18n("Unload Tree"), this, [=]() { unloadTree(pindex); }); } m->addSeparator(); - m->addAction(tr("Expand All"), this, &TabTreeView::expandAll); - m->addAction(tr("Collapse All"), this, &TabTreeView::collapseAll); + m->addAction(i18n("Expand All"), this, &TabTreeView::expandAll); + m->addAction(i18n("Collapse All"), this, &TabTreeView::collapseAll); } void TabTreeView::reverseTraverse(const QModelIndex &root, const std::function &callback) const diff --git a/src/plugins/VerticalTabs/verticaltabscontroller.cpp b/src/plugins/VerticalTabs/verticaltabscontroller.cpp index 7135175e5..5f66ee704 100644 --- a/src/plugins/VerticalTabs/verticaltabscontroller.cpp +++ b/src/plugins/VerticalTabs/verticaltabscontroller.cpp @@ -24,6 +24,8 @@ #include #include +#include + VerticalTabsController::VerticalTabsController(VerticalTabsPlugin *plugin) : SideBarInterface(plugin) , m_plugin(plugin) @@ -32,7 +34,7 @@ VerticalTabsController::VerticalTabsController(VerticalTabsPlugin *plugin) QString VerticalTabsController::title() const { - return tr("Vertical Tabs"); + return i18n("Vertical Tabs"); } QAction *VerticalTabsController::createMenuAction() diff --git a/src/plugins/VerticalTabs/verticaltabsschemehandler.cpp b/src/plugins/VerticalTabs/verticaltabsschemehandler.cpp index dc3520386..abe1dc758 100644 --- a/src/plugins/VerticalTabs/verticaltabsschemehandler.cpp +++ b/src/plugins/VerticalTabs/verticaltabsschemehandler.cpp @@ -23,6 +23,8 @@ #include #include +#include + VerticalTabsSchemeHandler::VerticalTabsSchemeHandler(QObject *parent) : ExtensionSchemeHandler(parent) { @@ -44,7 +46,7 @@ QByteArray VerticalTabsSchemeHandler::indexPage() const { QString page = QzTools::readAllFileContents(QSL(":verticaltabs/data/index.html")); - page.replace(QSL("%NAME%"), tr("Vertical Tabs")); + page.replace(QSL("%NAME%"), i18n("Vertical Tabs")); return page.toUtf8(); } @@ -54,7 +56,7 @@ QByteArray VerticalTabsSchemeHandler::groupPage() const QString page = QzTools::readAllFileContents(QSL(":verticaltabs/data/group.html")); page.replace(QSL("%FAVICON%"), QzTools::pixmapToDataUrl(QIcon(QSL(":verticaltabs/data/group.svg")).pixmap(16)).toString()); - page.replace(QSL("%NEW-GROUP%"), tr("New Group")); + page.replace(QSL("%NEW-GROUP%"), i18n("New Group")); return page.toUtf8(); } diff --git a/src/plugins/VerticalTabs/verticaltabssettings.cpp b/src/plugins/VerticalTabs/verticaltabssettings.cpp index 7dacb6ac2..647535daf 100644 --- a/src/plugins/VerticalTabs/verticaltabssettings.cpp +++ b/src/plugins/VerticalTabs/verticaltabssettings.cpp @@ -22,6 +22,8 @@ #include #include +#include + VerticalTabsSettings::VerticalTabsSettings(VerticalTabsPlugin *plugin, QWidget *parent) : QDialog(parent) , ui(new Ui::VerticalTabsSettings) @@ -58,7 +60,7 @@ void VerticalTabsSettings::themeValueChanged(int index) { const int customIndex = ui->theme->count() - 1; if (index == customIndex) { - const QString path = QFileDialog::getOpenFileName(this, tr("Theme file"), QDir::homePath(), {QSL("*.css")}); + const QString path = QFileDialog::getOpenFileName(this, i18n("Theme file"), QDir::homePath(), {QSL("*.css")}); if (path.isEmpty()) { loadThemes(); } else { @@ -83,7 +85,7 @@ void VerticalTabsSettings::loadThemes() } } ui->theme->setToolTip(m_plugin->theme()); - ui->theme->addItem(tr("Custom..."), found ? QString() : m_plugin->theme()); + ui->theme->addItem(i18n("Custom..."), found ? QString() : m_plugin->theme()); if (!found) { ui->theme->setCurrentIndex(ui->theme->count() - 1); } diff --git a/src/plugins/VerticalTabs/verticaltabswidget.cpp b/src/plugins/VerticalTabs/verticaltabswidget.cpp index 05d40221e..6a467489c 100644 --- a/src/plugins/VerticalTabs/verticaltabswidget.cpp +++ b/src/plugins/VerticalTabs/verticaltabswidget.cpp @@ -32,6 +32,8 @@ #include #include +#include + VerticalTabsWidget::VerticalTabsWidget(BrowserWindow *window) : QWidget() , m_window(window) @@ -55,7 +57,7 @@ VerticalTabsWidget::VerticalTabsWidget(BrowserWindow *window) buttonAddTab->setObjectName(QSL("verticaltabs-button-addtab")); buttonAddTab->setAutoRaise(true); buttonAddTab->setFocusPolicy(Qt::NoFocus); - buttonAddTab->setToolTip(tr("New Tab")); + buttonAddTab->setToolTip(i18n("New Tab")); buttonAddTab->setIcon(QIcon::fromTheme(QSL("list-add"))); buttonAddTab->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); connect(buttonAddTab, &QAbstractButton::clicked, m_window, &BrowserWindow::addTab); @@ -197,7 +199,7 @@ void VerticalTabsWidget::updateGroupMenu() } m_groupMenu->addSeparator(); - m_groupMenu->addAction(tr("Add New Group..."), this, [this]() { + m_groupMenu->addAction(i18n("Add New Group..."), this, [this]() { m_window->tabWidget()->addView(QUrl(QSL("extension://verticaltabs/group")), Qz::NT_SelectedTab); }); }