fix: metadata is not translated

This commit is contained in:
saturneric 2024-07-22 20:11:36 +02:00
parent 96e4c85edc
commit 988b0257e5
5 changed files with 41 additions and 4 deletions

View File

@ -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;
}

View File

@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<context>
<name>GTrC</name>
<message>
<location filename="../VersionCheckingModule.cpp" line="92"/>
<source>Update</source>
<translation type="unfinished">Aktualisieren</translation>
</message>
</context>
<context>
<name>UpdateTab</name>
<message>

View File

@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>GTrC</name>
<message>
<location filename="../VersionCheckingModule.cpp" line="92"/>
<source>Update</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateTab</name>
<message>

View File

@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>GTrC</name>
<message>
<location filename="../VersionCheckingModule.cpp" line="92"/>
<source>Update</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateTab</name>
<message>

View File

@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>GTrC</name>
<message>
<location filename="../VersionCheckingModule.cpp" line="92"/>
<source>Update</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UpdateTab</name>
<message>