Merge pull request #55613 from troopa81/pyqt6_translation

[PyQt6] make translations work with both Qt 6 and 5
This commit is contained in:
Julien Cabieces 2023-12-14 14:38:15 +01:00 committed by GitHub
commit 8677bc2f18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -27,12 +27,15 @@ set(TS_FILES qgis_ar.ts qgis_az.ts qgis_bg.ts qgis_bs.ts qgis_ca.ts qgis_cs.ts q
ADD_TRANSLATION_FILES (QM_FILES ${TS_FILES}) ADD_TRANSLATION_FILES (QM_FILES ${TS_FILES})
# TODO QGIS 4.0: remove configure and call directly script
configure_file(${CMAKE_SOURCE_DIR}/scripts/ts2appinfo.py.in ${CMAKE_BINARY_DIR}/ts2appinfo.py)
if (UNIX AND NOT APPLE AND PYQT_FOUND) if (UNIX AND NOT APPLE AND PYQT_FOUND)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/org.qgis.qgis.desktop ${CMAKE_BINARY_DIR}/org.qgis.qgis.appdata.xml OUTPUT ${CMAKE_BINARY_DIR}/org.qgis.qgis.desktop ${CMAKE_BINARY_DIR}/org.qgis.qgis.appdata.xml
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMAND ${Python_EXECUTABLE} COMMAND ${Python_EXECUTABLE}
ARGS ${CMAKE_SOURCE_DIR}/scripts/ts2appinfo.py "${CMAKE_BINARY_DIR}" ARGS ${CMAKE_BINARY_DIR}/ts2appinfo.py "${CMAKE_BINARY_DIR}"
COMMENT "Updating appinfo files..." COMMENT "Updating appinfo files..."
DEPENDS ${QM_FILES} ${CMAKE_SOURCE_DIR}/linux/org.qgis.qgis.desktop.in ${CMAKE_SOURCE_DIR}/linux/org.qgis.qgis.appdata.xml.in DEPENDS ${QM_FILES} ${CMAKE_SOURCE_DIR}/linux/org.qgis.qgis.desktop.in ${CMAKE_SOURCE_DIR}/linux/org.qgis.qgis.appdata.xml.in
) )

View File

@ -22,7 +22,7 @@ import sys
import os import os
from glob import glob from glob import glob
from xml.etree import ElementTree as et from xml.etree import ElementTree as et
from PyQt5.QtCore import QCoreApplication, QTranslator from PyQt@QT_VERSION_MAJOR@.QtCore import QCoreApplication, QTranslator
strings = {} strings = {}