mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 12:52:04 +08:00
添加翻译(终于)
This commit is contained in:
@@ -24,7 +24,8 @@ set(REQUIRED_LIBS
|
|||||||
Gui
|
Gui
|
||||||
Widgets
|
Widgets
|
||||||
Network
|
Network
|
||||||
Concurrent)
|
Concurrent
|
||||||
|
LinguistTools)
|
||||||
set(REQUIRED_LIBS_QUALIFIED
|
set(REQUIRED_LIBS_QUALIFIED
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
Qt5::Gui
|
Qt5::Gui
|
||||||
@@ -123,7 +124,9 @@ QT5_WRAP_UI(WRAPPED_UI_FILES
|
|||||||
gui/page/ui/settings.ui
|
gui/page/ui/settings.ui
|
||||||
gui/page/ui/homepage.ui)
|
gui/page/ui/homepage.ui)
|
||||||
|
|
||||||
add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES})
|
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} lang/zh.ts)
|
||||||
|
|
||||||
|
add_executable(${EXECUTABLE_NAME} ${SOURCE_FILES} ${QM_FILES})
|
||||||
|
|
||||||
if(SPARK_BUILD_DTK_PLUGIN)
|
if(SPARK_BUILD_DTK_PLUGIN)
|
||||||
add_subdirectory(plugin/dtkplugin)
|
add_subdirectory(plugin/dtkplugin)
|
||||||
|
|||||||
1042
lang/zh.ts
Normal file
1042
lang/zh.ts
Normal file
File diff suppressed because it is too large
Load Diff
12
src/main.cpp
12
src/main.cpp
@@ -1,5 +1,6 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QTranslator>
|
||||||
#include <spklogging.h>
|
#include <spklogging.h>
|
||||||
#include "spkui_general.h"
|
#include "spkui_general.h"
|
||||||
#include "spkstore.h"
|
#include "spkstore.h"
|
||||||
@@ -16,6 +17,17 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QString LogPath = "";
|
QString LogPath = "";
|
||||||
|
|
||||||
|
QTranslator tr;
|
||||||
|
QLocale loc;
|
||||||
|
QString trDir;
|
||||||
|
#ifndef NDEBUG
|
||||||
|
trDir = ".";
|
||||||
|
#else // Translation files (zh.qm etc) installed to this path!
|
||||||
|
trDir = "/usr/share/spark-store/translations/";
|
||||||
|
#endif
|
||||||
|
if(tr.load(loc, "", "", "."))
|
||||||
|
a.installTranslator(&tr);
|
||||||
|
|
||||||
SpkStore store(false, LogPath);
|
SpkStore store(false, LogPath);
|
||||||
|
|
||||||
// SpkDownloadMgr dl;
|
// SpkDownloadMgr dl;
|
||||||
|
|||||||
Reference in New Issue
Block a user