Перевод Сервера работает

This commit is contained in:
2025-10-21 12:42:12 +03:00
parent b9a39287cf
commit ff6f70c967
3 changed files with 17 additions and 0 deletions

View File

@@ -111,6 +111,11 @@ ServerLMSWidget::~ServerLMSWidget()
delete ui; delete ui;
} }
QString ServerLMSWidget::getLanguage()
{
return language;
}
void ServerLMSWidget::slotUpdateListClients() void ServerLMSWidget::slotUpdateListClients()
{ {

View File

@@ -53,6 +53,9 @@ public:
static const QString languageENG; static const QString languageENG;
static const QString languageRUS; static const QString languageRUS;
public:
QString getLanguage();
void setError(int code); void setError(int code);
protected: protected:

View File

@@ -21,6 +21,9 @@ MainWindow::MainWindow(QWidget *parent) :
connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged); connect(serverLMSWidget, &ServerLMSWidget::signal_LanguageChanged, this, &MainWindow::slot_LanguageChanged);
qtLanguageTranslator.load(QString("translations/TrayServerLMS_") + serverLMSWidget->getLanguage(), ".");
qApp->installTranslator(&qtLanguageTranslator);
//this->move(0, 0); //this->move(0, 0);
//this->showNormal(); //this->showNormal();
//this->showMaximized(); //this->showMaximized();
@@ -64,6 +67,8 @@ MainWindow::MainWindow(QWidget *parent) :
this, SLOT(slot_IconActivated(QSystemTrayIcon::ActivationReason))); this, SLOT(slot_IconActivated(QSystemTrayIcon::ActivationReason)));
slot_Menu_HideWindow(); slot_Menu_HideWindow();
} }
/* Метод, который обрабатывает событие закрытия окна приложения /* Метод, который обрабатывает событие закрытия окна приложения
@@ -123,6 +128,10 @@ void MainWindow::changeEvent(QEvent *event)
if (event->type() == QEvent::LanguageChange) if (event->type() == QEvent::LanguageChange)
{// переведём окно заново {// переведём окно заново
ui->retranslateUi(this); ui->retranslateUi(this);
action_ShowWindow->setText(tr("Expand window"));
action_HideWindow->setText(tr("Minimize window"));
action_Exit->setText(tr("Exit"));
} }
} }