Skip to content

Commit

Permalink
refine translations
Browse files Browse the repository at this point in the history
  • Loading branch information
tamlok committed Apr 30, 2024
1 parent 3b75528 commit a049689
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 15,818 deletions.
17 changes: 16 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,23 @@ set_source_files_properties(${VX_APP_ICON_MACOS} PROPERTIES
# Translations
set(VX_TS_FILES data/core/translations/vnote_zh_CN.ts
data/core/translations/vnote_ja.ts)
set_source_files_properties(${VX_TS_FILES} PROPERTIES OUTPUT_LOCATION "data/core/translations")
if((QT_DEFAULT_MAJOR_VERSION GREATER 5))
qt_add_lupdate(vnote TS_FILES ${VX_TS_FILES})
endif()
# Generate .qm files from .ts files (lrelease)
qt_add_translation(VX_QM_FILES ${VX_TS_FILES})
add_custom_target(lrelease DEPENDS ${VX_QM_FILES})

# TODO: VTextEdit translations
list(APPEND VX_QM_FILES
data/core/translations/qdialogbuttonbox_zh_CN.qm
data/core/translations/qtbase_ja.qm
data/core/translations/qtbase_zh_CN.qm
data/core/translations/qtv_ja.qm
data/core/translations/qtv_zh_CN.qm
data/core/translations/qwebengine_zh_CN.qm
)
install(FILES ${VX_QM_FILES} DESTINATION "${CMAKE_INSTALL_BINDIR}/translations" OPTIONAL)

# Resources
set(VX_RESOURCE_FILES data/core/core.qrc)
Expand Down
10 changes: 7 additions & 3 deletions src/Packaging.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

find_package(Qt${QT_DEFAULT_MAJOR_VERSION} REQUIRED COMPONENTS Core)

get_target_property(QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
get_target_property(QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT_BIN_DIR "${QMAKE_EXECUTABLE}" DIRECTORY)
execute_process(COMMAND ${QMAKE_EXECUTABLE} -query QT_VERSION OUTPUT_VARIABLE QT_VERSION)

find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${QT_BIN_DIR}")
# To use the specific version of Qt
set(WINDEPLOYQT_EXECUTABLE "${QT_BIN_DIR}/windeployqt")

find_program(LINUXDEPLOY_EXECUTABLE linuxdeploy linuxdeploy-x86_64.AppImage HINTS "${QT_BIN_DIR}")
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${QT_BIN_DIR}")
find_program(MACDEPLOYQTFIX_EXECUTABLE macdeployqtfix.py HINTS "${QT_BIN_DIR}")
Expand Down Expand Up @@ -43,7 +45,9 @@ function(windeployqt target)
DEPENDS vnote
)

install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/winqt/" DESTINATION ${CMAKE_INSTALL_BINDIR})
add_dependencies(deploy lrelease)

install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/winqt/" DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
endfunction()
Expand Down
10 changes: 0 additions & 10 deletions src/data/core/core.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,5 @@
<file>logo/vnote.png</file>
<file>logo/256x256/vnote.png</file>
<file>logo/vnote_mono.png</file>
<file>translations/qdialogbuttonbox_zh_CN.qm</file>
<file>translations/qwebengine_zh_CN.qm</file>
<file>translations/qt_zh_CN.qm</file>
<file>translations/vnote_zh_CN.qm</file>
<file>translations/qtbase_zh_CN.qm</file>
<file>translations/vtextedit_zh_CN.qm</file>
<file>translations/qt_ja.qm</file>
<file>translations/vnote_ja.qm</file>
<file>translations/qtbase_ja.qm</file>
<file>translations/vtextedit_ja.qm</file>
</qresource>
</RCC>
79 changes: 0 additions & 79 deletions src/data/core/translations/qdialogbuttonbox_zh_CN.ts

This file was deleted.

Loading

0 comments on commit a049689

Please sign in to comment.