This commit is contained in:
朱子楚\zhuzi
2024-03-11 18:55:33 +08:00
parent 38a277801d
commit 463aa38bc2
31 changed files with 506 additions and 313 deletions

View File

@ -19,6 +19,7 @@ void TranslateHelper::init(QQmlEngine* engine){
_translator = new QTranslator(this);
qApp->installTranslator(_translator);
QString translatorPath = QGuiApplication::applicationDirPath()+"/i18n";
_translator->load(QString::fromStdString("%1/example_%2.qm").arg(translatorPath,_current));
_engine->retranslate();
if(_translator->load(QString::fromStdString("%1/example_%2.qm").arg(translatorPath,_current))){
_engine->retranslate();
}
}