Skip to content

Commit

Permalink
feat: add translation of dde-shell plugin (#141)
Browse files Browse the repository at this point in the history
* feat: add translation of dde-shell plugin

Add translation of dde-shell plugin

Log: add translation of dde-shell plugin
Influence: translation

* feat: add translation files

Add translation files

Log: add translation files
Influence: translation
  • Loading branch information
yixinshark authored Apr 10, 2024
1 parent 28b956a commit c07a8c1
Show file tree
Hide file tree
Showing 147 changed files with 5,439 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ set(DDE_SHELL_PLUGIN_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/dde-shell CACHE STRING
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/dde-shell" CACHE STRING "Headers install path")
set(CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/DDEShell" CACHE STRING "CMake config file install directory")
set(QML_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/qt${QT_VERSION_MAJOR}/qml" CACHE STRING "Qml plugin install directory")
set(DDE_SHELL_TRANSLATION_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/dde-shell" CACHE STRING "Translation install directory")
# avoid warning when `D_APPLET_CLASS` used in .cpp
set(CMAKE_AUTOMOC_MACRO_NAMES "D_APPLET_CLASS")

find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH};${ECM_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake")
include(DDEShellPackageMacros)

find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick WaylandClient DBus)
find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Concurrent Quick WaylandClient DBus LinguistTools)
find_package(Dtk${DTK_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui)
find_package(WaylandProtocols REQUIRED)
find_package(PkgConfig REQUIRED)
Expand Down
51 changes: 51 additions & 0 deletions cmake/DDEShellPackageMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,54 @@ function(ds_install_package)
install(TARGETS ${_config_TARGET} DESTINATION ${DDE_SHELL_PLUGIN_INSTALL_DIR}/)
endif()
endfunction()

function(ds_handle_package_translation)
set(oneValueArgs PACKAGE)
set(multiValueArgs QML_FILES SOURCE_FILES )
cmake_parse_arguments(_config "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

if(NOT _config_QML_FILES)
file(GLOB_RECURSE _config_QML_FILES ${CMAKE_CURRENT_SOURCE_DIR}/package/*.qml)
file(GLOB additional_QML_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.qml)
list(APPEND _config_QML_FILES ${additional_QML_FILES})
endif()

if(NOT _config_SOURCE_FILES)
file(GLOB _config_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
endif()

set(TRANSLATION_FILES
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_az.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_bo.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_ca.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_es.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_fi.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_fr.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_hu.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_it.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_ja.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_ko.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_nb_NO.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_pl.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_pt_BR.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_ru.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_uk.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_zh_CN.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_zh_HK.ts
${CMAKE_CURRENT_SOURCE_DIR}/translations/${_config_PACKAGE}_zh_TW.ts
)

add_custom_target(${_config_PACKAGE}_translation ALL
SOURCES ${TRANSLATION_FILES}
)

qt_add_translations(${_config_PACKAGE}_translation
TS_FILES ${TRANSLATION_FILES}
SOURCES ${_config_QML_FILES} ${_config_SOURCE_FILES}
QM_FILES_OUTPUT_VARIABLE TRANSLATED_FILES
)

# /usr/share/dde-shell/org.deepin.xxx/translations/org.deepin.xxx.qm
install(FILES ${TRANSLATED_FILES} DESTINATION ${DDE_SHELL_TRANSLATION_INSTALL_DIR}/${_config_PACKAGE}/translations)
endfunction()
3 changes: 2 additions & 1 deletion debian/dde-shell.install
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ usr/lib/*/libdde-dockplugin-interface.so.*
usr/share/dsg/configs/org.deepin.ds.dock/
usr/lib/dde-dock/tmp/plugins
usr/lib/dde-dock/tmp/plugins/quick-trays
usr/share/dde-dock/tmp/translations
usr/share/dde-dock/tmp/translations
usr/share/dde-shell/*/translations
1 change: 1 addition & 0 deletions misc/DDEShellConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Qml Quick REQUIRED)
include(${CMAKE_CURRENT_LIST_DIR}/DDEShellTargets.cmake)
set(DDE_SHELL_PACKAGE_INSTALL_DIR @CMAKE_INSTALL_PREFIX@/@DDE_SHELL_PACKAGE_INSTALL_DIR@)
set(DDE_SHELL_PLUGIN_INSTALL_DIR @CMAKE_INSTALL_PREFIX@/@DDE_SHELL_PLUGIN_INSTALL_DIR@)
set(DDE_SHELL_TRANSLATION_INSTALL_DIR @CMAKE_INSTALL_PREFIX@/@DDE_SHELL_TRANSLATION_INSTALL_DIR@)
check_required_components(Dtk@DTK_VERSION_MAJOR@Core)

include("${CMAKE_CURRENT_LIST_DIR}/DDEShellPackageMacros.cmake")
1 change: 1 addition & 0 deletions panels/dock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if (BUILD_WITH_X11)
endif(BUILD_WITH_X11)

ds_install_package(PACKAGE org.deepin.ds.dock TARGET dockpanel)
ds_handle_package_translation(PACKAGE org.deepin.ds.dock)

# sub plugins
add_subdirectory(clipboarditem)
Expand Down
1 change: 1 addition & 0 deletions panels/dock/clipboarditem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ target_link_libraries(dock-clipboarditem PRIVATE
)

ds_install_package(PACKAGE org.deepin.ds.dock.clipboarditem TARGET dock-clipboarditem)
ds_handle_package_translation(PACKAGE org.deepin.ds.dock.clipboarditem)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_CN">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation>剪切板</translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_HK">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation>剪切闆</translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="zh_TW">
<context>
<name>dock::ClipboardItem</name>
<message>
<location filename="../clipboarditem.cpp" line="42"/>
<source>Clipboard</source>
<translation>剪切闆</translation>
</message>
</context>
</TS>
1 change: 1 addition & 0 deletions panels/dock/searchitem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ target_link_libraries(dock-searchitem PRIVATE
)

ds_install_package(PACKAGE org.deepin.ds.dock.searchitem TARGET dock-searchitem)
ds_handle_package_translation(PACKAGE org.deepin.ds.dock.searchitem)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::SearchItem</name>
<message>
<location filename="../searchitem.cpp" line="48"/>
<source>GrandSearch</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::SearchItem</name>
<message>
<location filename="../searchitem.cpp" line="48"/>
<source>GrandSearch</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>dock::SearchItem</name>
<message>
<location filename="../searchitem.cpp" line="48"/>
<source>GrandSearch</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Loading

0 comments on commit c07a8c1

Please sign in to comment.