diff --git a/mainwindow.cpp b/mainwindow.cpp index 2c32327..22375ba 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -38,20 +38,10 @@ void MainWindow::rec() { #define ACTION(english, menu) \ [&]() -> QAction * { \ - QAction *a = menu->addAction(tr(english)); \ - acts.insert(a, english); \ + QAction *a = menu->addAction(english); \ return a; \ }() -void MainWindow::changeEvent(QEvent *e) { - if (e->type() == QEvent::LocaleChange) { - ui->retranslateUi(this); - for (auto key : acts.keys()) { - key->setText(tr(acts.value(key))); - } - } -} - void addHotkey(QString name, std::function action) { hotkeying::load(name, action); } @@ -64,19 +54,19 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi tray->setToolTip("KShare"); tray->setVisible(true); menu = new QMenu(this); - QAction *quit = ACTION("Quit", menu); - QAction *shtoggle = ACTION("Show/Hide", menu); - QAction *fullscreen = ACTION("Take fullscreen shot", menu); - QAction *area = ACTION("Take area shot", menu); + QAction *quit = ACTION(tr("Quit"), menu); + QAction *shtoggle = ACTION(tr("Show/Hide"), menu); + QAction *fullscreen = ACTION(tr("Take fullscreen shot"), menu); + QAction *area = ACTION(tr("Take area shot"), menu); #ifdef PLATFORM_CAPABILITY_ACTIVEWINDOW - QAction *active = ACTION("Screenshot active window", menu); + QAction *active = ACTION(tr("Screenshot active window"), menu); connect(active, &QAction::triggered, this, [] { screenshotter::activeDelayed(); }); #endif - QAction *picker = ACTION("Show color picker", menu); - QAction *rec = ACTION("Record screen", menu); - QAction *recoff = ACTION("Stop recording", menu); - QAction *recabort = ACTION("Abort recording", menu); + QAction *picker = ACTION(tr("Show color picker"), menu); + QAction *rec = ACTION(tr("Record screen"), menu); + QAction *recoff = ACTION(tr("Stop recording"), menu); + QAction *recabort = ACTION(tr("Abort recording"), menu); menu->addActions({ quit, shtoggle, picker }); menu->addSeparator(); menu->addActions({ fullscreen, area }); diff --git a/mainwindow.hpp b/mainwindow.hpp index bd2d0d1..c130c76 100644 --- a/mainwindow.hpp +++ b/mainwindow.hpp @@ -45,7 +45,6 @@ public slots: private: bool val = false; - QMap acts; QMenu *menu; static MainWindow *instance; diff --git a/translations/sr_RS.qm b/translations/sr_RS.qm index 72cd5da..3690bca 100644 Binary files a/translations/sr_RS.qm and b/translations/sr_RS.qm differ diff --git a/translations/sr_RS.ts b/translations/sr_RS.ts index 5ba70b0..266eff6 100644 --- a/translations/sr_RS.ts +++ b/translations/sr_RS.ts @@ -285,7 +285,7 @@ Otkaži - + KShare Crop Editor KShare Urednik Slika @@ -740,6 +740,51 @@ p, li { white-space: pre-wrap; } Recording format not set in settings. Aborting. Format snjimanja nije podešen! Otkazujem. + + + Quit + Izađi + + + + Show/Hide + Prikaži/Sakrij + + + + Take fullscreen shot + Slikaj ceo ekran + + + + Take area shot + Slikaj deo ekrana + + + + Screenshot active window + Slikaj trenutni prozor + + + + Show color picker + Prikaži birač boja + + + + Record screen + Snjimi ekran + + + + Stop recording + Zaustavi snjimanje + + + + Abort recording + Obustavi snjimanje + QObject