更新前端翻译文件安装位置
This commit is contained in:
parent
bc6a5bcbbf
commit
00b81d0190
|
@ -65,9 +65,10 @@ add_executable(ukui-search
|
||||||
${QRC_FILES}
|
${QRC_FILES}
|
||||||
${UKUI_SEARCH_QM_FILES}
|
${UKUI_SEARCH_QM_FILES}
|
||||||
${UKUI_SEARCH_APP_WIDGET_QM_FILES})
|
${UKUI_SEARCH_APP_WIDGET_QM_FILES})
|
||||||
|
set(UKUI_SEARCH_QM_INSTALL_PATH /usr/share/ukui-search/translations/ukui-search)
|
||||||
target_compile_definitions(ukui-search PRIVATE
|
target_compile_definitions(ukui-search PRIVATE
|
||||||
VERSION="${UKUI_SEARCH_VERSION}"
|
VERSION="${UKUI_SEARCH_VERSION}"
|
||||||
|
UKUI_SEARCH_QM_INSTALL_PATH="${UKUI_SEARCH_QM_INSTALL_PATH}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(ukui-search PRIVATE
|
target_link_libraries(ukui-search PRIVATE
|
||||||
|
@ -117,7 +118,7 @@ install(FILES ${UKUI_SEARCH_APP_WIDGET_QM_FILES} DESTINATION /usr/share/appwidge
|
||||||
#二进制
|
#二进制
|
||||||
install(TARGETS ukui-search RUNTIME DESTINATION /usr/bin)
|
install(TARGETS ukui-search RUNTIME DESTINATION /usr/bin)
|
||||||
#翻译
|
#翻译
|
||||||
install(FILES ${UKUI_SEARCH_QM_FILES} DESTINATION /usr/share/ukui-search/translations/)
|
install(FILES ${UKUI_SEARCH_QM_FILES} DESTINATION ${UKUI_SEARCH_QM_INSTALL_PATH})
|
||||||
#desktop文件
|
#desktop文件
|
||||||
install(FILES ../data/ukui-search-menu.desktop DESTINATION /usr/share/applications)
|
install(FILES ../data/ukui-search-menu.desktop DESTINATION /usr/share/applications)
|
||||||
install(FILES ../data/ukui-search.desktop DESTINATION /etc/xdg/autostart)
|
install(FILES ../data/ukui-search.desktop DESTINATION /etc/xdg/autostart)
|
||||||
|
|
|
@ -45,10 +45,10 @@ UkuiSearchGui::UkuiSearchGui(int &argc, char *argv[], const QString &application
|
||||||
//load translations.
|
//load translations.
|
||||||
QTranslator *translator = new QTranslator(this);
|
QTranslator *translator = new QTranslator(this);
|
||||||
try {
|
try {
|
||||||
if(! translator->load("/usr/share/ukui-search/translations/" + QLocale::system().name())) throw - 1;
|
if(! translator->load(UKUI_SEARCH_QM_INSTALL_PATH"/" + QLocale::system().name())) throw - 1;
|
||||||
this->installTranslator(translator);
|
this->installTranslator(translator);
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
qDebug() << "Load translations file" << QLocale() << "failed!";
|
qDebug() << "Load translations file: " << UKUI_SEARCH_QM_INSTALL_PATH << QLocale() << "failed!";
|
||||||
}
|
}
|
||||||
|
|
||||||
QTranslator *qt_translator = new QTranslator(this);
|
QTranslator *qt_translator = new QTranslator(this);
|
||||||
|
|
Loading…
Reference in New Issue