Skip to content

Commit

Permalink
feat: auto load qt translations
Browse files Browse the repository at this point in the history
Normally, Qt applications need to explicitly load translations by themselves,
including Qt translations. Here we take the initiative to help applications
that have loaded dtk (including plugins) load translations.

Issue: linuxdeepin/developer-center#6417
  • Loading branch information
kegechen committed Dec 15, 2023
1 parent a66d7cc commit 9c76e9b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/kernel/dguiapplicationhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <QLockFile>
#include <QDirIterator>
#include <QDesktopServices>
#include <QTimer>

#ifdef Q_OS_UNIX
#include <QDBusError>
Expand Down Expand Up @@ -494,7 +495,10 @@ DGuiApplicationHelper::DGuiApplicationHelper()
: QObject(nullptr)
, DObject(*new DGuiApplicationHelperPrivate(this))
{

// load qt/qtbase translation for qt app which load dtk ?
QTimer::singleShot(0, [](){
DGuiApplicationHelper::loadTranslator();
});
}

void DGuiApplicationHelper::initialize()
Expand Down

0 comments on commit 9c76e9b

Please sign in to comment.