fix: 修复任务栏个性化配置在控制中心中部分语种环境下搜索结果为英文的问题

1、提供的搜索路径未能覆盖所有语种
2、dtk的loadTranslator函数会导致内存检测崩溃退出,改为qt自己的接口

Log:
Influence: 控制中心中关于任务栏设置的搜索结果
Task: https://pms.uniontech.com/zentao/task-view-93099.html
Change-Id: I9d0c311e04f7fdb9414bb980c1de15fa15f76d97
This commit is contained in:
范朋程 2021-11-29 19:28:00 +08:00 committed by fanpengcheng
parent 254dee8455
commit 2edbfc41c8
2 changed files with 11 additions and 5 deletions

View File

@ -26,5 +26,13 @@
<file>translations/dcc-dock-plugin_zh_CN.ts</file>
<file>translations/dcc-dock-plugin_zh_HK.ts</file>
<file>translations/dcc-dock-plugin_zh_TW.ts</file>
<file>translations/dcc-dock-plugin_de.ts</file>
<file>translations/dcc-dock-plugin_ca.ts</file>
<file>translations/dcc-dock-plugin_es.ts</file>
<file>translations/dcc-dock-plugin_hr.ts</file>
<file>translations/dcc-dock-plugin_it.ts</file>
<file>translations/dcc-dock-plugin_pl.ts</file>
<file>translations/dcc-dock-plugin_pt_BR.ts</file>
<file>translations/dcc-dock-plugin_ru.ts</file>
</qresource>
</RCC>

View File

@ -32,11 +32,9 @@ SettingsModule::SettingsModule()
, ModuleInterface()
, m_moduleWidget(nullptr)
{
const QString &appName = qApp->applicationName();
// 加载任务栏的翻译文件
qApp->setApplicationName("dcc-dock-plugin");
qApp->loadTranslator();
qApp->setApplicationName(appName);
QTranslator *translator = new QTranslator(this);
translator->load(QString("/usr/share/dcc-dock-plugin/translations/dcc-dock-plugin_%1.qm").arg(QLocale::system().name()));
QCoreApplication::installTranslator(translator);
}
SettingsModule::~SettingsModule()