mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-07-18 11:32:20 +08:00
添加翻译(终于)
This commit is contained in:
parent
393b3f73d5
commit
b0a2d64b71
@ -24,7 +24,8 @@ set(REQUIRED_LIBS
|
||||
Gui
|
||||
Widgets
|
||||
Network
|
||||
Concurrent)
|
||||
Concurrent
|
||||
LinguistTools)
|
||||
set(REQUIRED_LIBS_QUALIFIED
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
@ -123,7 +124,9 @@ QT5_WRAP_UI(WRAPPED_UI_FILES
|
||||
gui/page/ui/settings.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)
|
||||
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 <QPushButton>
|
||||
#include <QTranslator>
|
||||
#include <spklogging.h>
|
||||
#include "spkui_general.h"
|
||||
#include "spkstore.h"
|
||||
@ -16,6 +17,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
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);
|
||||
|
||||
// SpkDownloadMgr dl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user