From 988b0257e5967a7174270670a011f83721b5611f Mon Sep 17 00:00:00 2001 From: saturneric Date: Mon, 22 Jul 2024 20:11:36 +0200 Subject: [PATCH] fix: metadata is not translated --- src/m_ver_check/VersionCheckingModule.cpp | 13 +++++++++---- src/m_ver_check/ts/ModuleVersionChecking.de_DE.ts | 8 ++++++++ src/m_ver_check/ts/ModuleVersionChecking.en_US.ts | 8 ++++++++ src/m_ver_check/ts/ModuleVersionChecking.fr_FR.ts | 8 ++++++++ src/m_ver_check/ts/ModuleVersionChecking.zh_CN.ts | 8 ++++++++ 5 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/m_ver_check/VersionCheckingModule.cpp b/src/m_ver_check/VersionCheckingModule.cpp index 0b57a25..c28aaaa 100644 --- a/src/m_ver_check/VersionCheckingModule.cpp +++ b/src/m_ver_check/VersionCheckingModule.cpp @@ -43,6 +43,10 @@ #include "UpdateTab.h" #include "VersionCheckTask.h" +class GTrC { + Q_DECLARE_TR_FUNCTIONS(GTrC) +}; + auto GFGetModuleGFSDKVersion() -> const char* { return DUP(GF_SDK_VERSION_STR); } @@ -73,10 +77,6 @@ auto GFActiveModule() -> int { GFModuleListenEvent(GFGetModuleID(), DUP("APPLICATION_LOADED")); GFModuleListenEvent(GFGetModuleID(), DUP("CHECK_APPLICATION_VERSION")); - GFUIMountEntry(DUP("AboutDialogTabs"), - QMapToMetaDataArray({{"TabTitle", "Update"}}), 1, - UpdateTabFactory); - // load translations QFile f( QString(":/i18n/ModuleVersionChecking.%1.qm").arg(GFAppActiveLocale())); @@ -87,6 +87,11 @@ auto GFActiveModule() -> int { auto b = f.readAll(); GFAppRegisterTranslator(AllocBufferAndCopy(b), b.size()); } + + GFUIMountEntry(DUP("AboutDialogTabs"), + QMapToMetaDataArray({{"TabTitle", GTrC::tr("Update")}}), 1, + UpdateTabFactory); + return 0; } diff --git a/src/m_ver_check/ts/ModuleVersionChecking.de_DE.ts b/src/m_ver_check/ts/ModuleVersionChecking.de_DE.ts index ad113a5..549b674 100644 --- a/src/m_ver_check/ts/ModuleVersionChecking.de_DE.ts +++ b/src/m_ver_check/ts/ModuleVersionChecking.de_DE.ts @@ -1,6 +1,14 @@ + + GTrC + + + Update + Aktualisieren + + UpdateTab diff --git a/src/m_ver_check/ts/ModuleVersionChecking.en_US.ts b/src/m_ver_check/ts/ModuleVersionChecking.en_US.ts index 6e4afc5..2795653 100644 --- a/src/m_ver_check/ts/ModuleVersionChecking.en_US.ts +++ b/src/m_ver_check/ts/ModuleVersionChecking.en_US.ts @@ -1,6 +1,14 @@ + + GTrC + + + Update + + + UpdateTab diff --git a/src/m_ver_check/ts/ModuleVersionChecking.fr_FR.ts b/src/m_ver_check/ts/ModuleVersionChecking.fr_FR.ts index 6e4afc5..2795653 100644 --- a/src/m_ver_check/ts/ModuleVersionChecking.fr_FR.ts +++ b/src/m_ver_check/ts/ModuleVersionChecking.fr_FR.ts @@ -1,6 +1,14 @@ + + GTrC + + + Update + + + UpdateTab diff --git a/src/m_ver_check/ts/ModuleVersionChecking.zh_CN.ts b/src/m_ver_check/ts/ModuleVersionChecking.zh_CN.ts index 6e4afc5..2795653 100644 --- a/src/m_ver_check/ts/ModuleVersionChecking.zh_CN.ts +++ b/src/m_ver_check/ts/ModuleVersionChecking.zh_CN.ts @@ -1,6 +1,14 @@ + + GTrC + + + Update + + + UpdateTab