From 5f736c5154f47e2e6987409c0488c83c20b87723 Mon Sep 17 00:00:00 2001 From: Yixue Wang Date: Wed, 17 Apr 2024 17:20:01 +0800 Subject: [PATCH] fix: warning label is not translated Add chinese translation for warn label. Log: warning label is not translated --- dss-network-plugin/network_module.cpp | 3 ++- dss-network-plugin/network_module.h | 10 +++++----- dss-network-plugin/translations/dss-network-plugin.ts | 7 +++++++ .../translations/dss-network-plugin_en_US.ts | 7 +++++++ .../translations/dss-network-plugin_zh_CN.ts | 9 ++++++++- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/dss-network-plugin/network_module.cpp b/dss-network-plugin/network_module.cpp index 3f57ed0f..3cbaf4e7 100644 --- a/dss-network-plugin/network_module.cpp +++ b/dss-network-plugin/network_module.cpp @@ -166,6 +166,7 @@ void NetworkModule::installTranslator(QString locale) QApplication::installTranslator(&translator); dde::network::NetworkController::instance()->retranslate(); m_networkHelper->updateTooltips(); + m_panelContainer->onPluginStateChanged(m_networkHelper->getPluginState()); } const QString NetworkModule::connectionMatchName() const @@ -482,7 +483,7 @@ NetworkPanelContainer::NetworkPanelContainer(dde::networkplugin::NetworkDialog * { m_warnLabel->setFixedWidth(300); m_warnLabel->setAlignment(Qt::AlignCenter); - m_warnLabel->setContentsMargins(10, 2, 10, 2); + m_warnLabel->setContentsMargins(10, 0, 10, 0); m_warnLabel->setWordWrap(true); } diff --git a/dss-network-plugin/network_module.h b/dss-network-plugin/network_module.h index 2db10d3e..0141c545 100644 --- a/dss-network-plugin/network_module.h +++ b/dss-network-plugin/network_module.h @@ -22,11 +22,6 @@ NETWORKPLUGIN_END_NAMESPACE namespace dss { namespace module { class PopupAppletManager; -/** - * @brief The NetworkModule class - * 用于处理插件差异 - * NetworkModule处理信号槽有问题,固增加该类 - */ class NetworkPanelContainer : public QWidget { Q_OBJECT @@ -47,6 +42,11 @@ public Q_SLOTS: QWidget *m_savedParent; QWidget *m_contentWidget; }; +/** + * @brief The NetworkModule class + * 用于处理插件差异 + * NetworkModule处理信号槽有问题,固增加该类 + */ class NetworkModule : public QObject { Q_OBJECT diff --git a/dss-network-plugin/translations/dss-network-plugin.ts b/dss-network-plugin/translations/dss-network-plugin.ts index ae9269fb..9ca428e7 100644 --- a/dss-network-plugin/translations/dss-network-plugin.ts +++ b/dss-network-plugin/translations/dss-network-plugin.ts @@ -278,4 +278,11 @@ + + dss::module::NetworkPanelContainer + + Network cable unplugged + + + diff --git a/dss-network-plugin/translations/dss-network-plugin_en_US.ts b/dss-network-plugin/translations/dss-network-plugin_en_US.ts index ad38459d..c3065c84 100644 --- a/dss-network-plugin/translations/dss-network-plugin_en_US.ts +++ b/dss-network-plugin/translations/dss-network-plugin_en_US.ts @@ -276,4 +276,11 @@ Wired Connection + + dss::module::NetworkPanelContainer + + Network cable unplugged + + + \ No newline at end of file diff --git a/dss-network-plugin/translations/dss-network-plugin_zh_CN.ts b/dss-network-plugin/translations/dss-network-plugin_zh_CN.ts index d2049b99..e5774691 100644 --- a/dss-network-plugin/translations/dss-network-plugin_zh_CN.ts +++ b/dss-network-plugin/translations/dss-network-plugin_zh_CN.ts @@ -276,4 +276,11 @@ 有线连接 - \ No newline at end of file + + dss::module::NetworkPanelContainer + + Network cable unplugged + 未插入网线 + + +