diff --git a/CMakeLists.txt b/CMakeLists.txt index c6262ae..99cff2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.7) project(deepin-fcitx5configtool-plugin VERSION 5.0.5) +include(GNUInstallDirs) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) set(DEFAULT_XKB_RULES "evdev" CACHE STRING "Xkb rules name") @@ -22,4 +23,4 @@ execute_process(COMMAND bash translate_generation.sh ## qm files file(GLOB QM_FILES "translations/*.qm") -install(FILES ${QM_FILES} DESTINATION share/deepin-fcitx5configtool-plugin/translations) \ No newline at end of file +install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dde-control-center/translations) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f73b2e7..f62fb0f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -190,7 +190,7 @@ endif () # 设置执行 make install 时哪个目标应该被 install 到哪个位置 if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug") - install(TARGETS ${BIN_NAME} LIBRARY DESTINATION /lib/dde-control-center/modules) + install(TARGETS ${BIN_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/dde-control-center/modules) endif() add_subdirectory(layout) diff --git a/src/fcitx5configplugin.cpp b/src/fcitx5configplugin.cpp index 5cbf615..b3d36d1 100644 --- a/src/fcitx5configplugin.cpp +++ b/src/fcitx5configplugin.cpp @@ -18,14 +18,11 @@ Fcitx5ConfigPlugin::Fcitx5ConfigPlugin() { - QTranslator *translator = new QTranslator(this); - translator->load(QString("/usr/share/deepin-fcitx5configtool-plugin/translations/deepin-fcitx5configtool-plugin_%1.qm").arg(QLocale().name())); - QCoreApplication::installTranslator(translator); //安装翻译器 } QString Fcitx5ConfigPlugin::name() const { - return tr("Input Methods"); + return tr("deepin-fcitx5configtool-plugin"); } QString Fcitx5ConfigPlugin::follow() const diff --git a/translations/deepin-fcitx5configtool-plugin_en_US.ts b/translations/deepin-fcitx5configtool-plugin_en_US.ts index e0310bf..d46b33e 100644 --- a/translations/deepin-fcitx5configtool-plugin_en_US.ts +++ b/translations/deepin-fcitx5configtool-plugin_en_US.ts @@ -4,12 +4,16 @@ Fcitx5ConfigPlugin - Input Methods - Input Methods + Input Methods - + + deepin-fcitx5configtool-plugin + + + + Input Method Input Method @@ -17,32 +21,32 @@ IMSettingWindow - + Scroll between input methods Scroll between input methods - + Switch between the current/first input method Switch between the current/first input method - + Manage Input Methods Manage Input Methods - + Shortcuts Shortcuts - + Restore Defaults Restore Defaults - + Advanced Settings Advanced Settings @@ -84,22 +88,22 @@ fcitx::addim::IMPage - + Select your language and add input methods Select your language and add input methods - + Find more in App Store Find more in App Store - + Cancel Cancel - + Add