aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-03-15 03:06:21 +0000
committerMartin Kaiser <wireshark@kaiser.cx>2016-06-28 20:53:17 +0000
commit5c03bda31af87bf08a404509cd0714df65471416 (patch)
tree088e58e6327156b99eff74fd621867d8804525bf /ui
parentfff248bb843e21099c7160a0346db2c88987abd5 (diff)
Qt: Generate .qm files during build
Change-Id: Ia2ee723227e1b331eeec0f0463654f35a4c9f37b Reviewed-on: https://code.wireshark.org/review/14508 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/CMakeLists.txt22
-rw-r--r--ui/qt/Makefile.am20
-rw-r--r--ui/qt/Makefile.common1
-rw-r--r--ui/qt/i18n.qrc30
-rw-r--r--ui/qt/i18n.qrc.in4
-rw-r--r--ui/qt/wireshark_de.qmbin346602 -> 0 bytes
-rw-r--r--ui/qt/wireshark_en.qmbin2152 -> 0 bytes
-rw-r--r--ui/qt/wireshark_fr.qmbin319647 -> 0 bytes
-rw-r--r--ui/qt/wireshark_it.qmbin352833 -> 0 bytes
-rw-r--r--ui/qt/wireshark_ja_JP.qmbin266711 -> 0 bytes
-rw-r--r--ui/qt/wireshark_pl.qmbin338655 -> 0 bytes
-rw-r--r--ui/qt/wireshark_zh_CN.qmbin253502 -> 0 bytes
12 files changed, 40 insertions, 37 deletions
diff --git a/ui/qt/CMakeLists.txt b/ui/qt/CMakeLists.txt
index 7cdc7a3dc6..77bd10cdb1 100644
--- a/ui/qt/CMakeLists.txt
+++ b/ui/qt/CMakeLists.txt
@@ -450,7 +450,7 @@ set(WIRESHARK_QT_QRC
../../image/layout.qrc
../../image/toolbar.qrc
../../image/wsicon.qrc
- i18n.qrc
+ ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc
)
set(WIRESHARK_QT_TS
@@ -469,7 +469,7 @@ include_directories(
)
if (QT_VERSION EQUAL 5)
- QT5_ADD_TRANSLATION(WIRESHARK_QT_TS_QM ${WIRESHARK_QT_TS})
+ QT5_ADD_TRANSLATION(WIRESHARK_QT_QM ${WIRESHARK_QT_TS})
QT5_ADD_RESOURCES(WIRESHARK_QT_QRC_SRC ${WIRESHARK_QT_QRC})
QT5_WRAP_UI(WIRESHARK_QT_UI_SRC ${WIRESHARK_QT_UI})
# For now, do the moc stuff manually
@@ -480,7 +480,7 @@ if (QT_VERSION EQUAL 5)
# or
# set_target_properties(${some-source-files} PROPERTIES AUTOMOC TRUE)
else()
- QT4_ADD_TRANSLATION(WIRESHARK_QT_TS_QM ${WIRESHARK_QT_TS})
+ QT4_ADD_TRANSLATION(WIRESHARK_QT_QM ${WIRESHARK_QT_TS})
QT4_ADD_RESOURCES(WIRESHARK_QT_QRC_SRC ${WIRESHARK_QT_QRC})
QT4_WRAP_UI(WIRESHARK_QT_UI_SRC ${WIRESHARK_QT_UI})
# For now, do the moc stuff manually
@@ -492,6 +492,20 @@ else()
# set_target_properties(${some-source-files} PROPERTIES AUTOMOC TRUE)
endif()
+foreach(_file ${WIRESHARK_QT_QM})
+ get_filename_component(_qresource ${_file} NAME)
+ set(i18n_qresource "${i18n_qresource}\n <file>${_qresource}</file>")
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc PROPERTIES OBJECT_DEPENDS ${_file})
+endforeach()
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/i18n.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/i18n.qrc)
+
+add_custom_target(
+ translations ALL
+ DEPENDS
+ ${WIRESHARK_QT_QM}
+)
+set_target_properties(translations PROPERTIES FOLDER "UI")
+
if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${WIRESHARK_QT_FILES}
@@ -513,9 +527,9 @@ add_library(qtui STATIC
${WIRESHARK_QT_UI_SRC}
${WIRESHARK_QT_MOC_SRC}
${WIRESHARK_QT_QRC_SRC}
- ${WIRESHARK_QT_TS_QM}
wireshark-tap-register.c
)
+add_dependencies(qtui translations)
set_target_properties(qtui PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}")
set_target_properties(qtui PROPERTIES FOLDER "UI")
diff --git a/ui/qt/Makefile.am b/ui/qt/Makefile.am
index 435d494e16..c495f91c23 100644
--- a/ui/qt/Makefile.am
+++ b/ui/qt/Makefile.am
@@ -40,7 +40,9 @@ CLEANFILES = \
*~
DISTCLEANFILES = \
- $(NODIST_GENERATED_FILES)
+ $(NODIST_GENERATED_FILES) \
+ $(QM_FILES) \
+ i18n.qrc
MAINTAINERCLEANFILES = \
$(GENERATED_FILES) \
@@ -112,6 +114,10 @@ AM_V_UIC = $(am__v_UIC_@AM_V@)
am__v_UIC_ = $(am__v_UIC_@AM_DEFAULT_V@)
am__v_UIC_0 = @echo " UIC " $@;
+AM_V_LRELEASE = $(am__v_LRELEASE_@AM_V@)
+am__v_LRELEASE_ = $(am__v_LRELEASE_@AM_DEFAULT_V@)
+am__v_LRELEASE_0 = @echo " LRELEASE " $@;
+
#
# For building .moc.cpp files from .h files by running moc,
# building .rcc.cpp files from .qrc files by running rcc,
@@ -148,6 +154,17 @@ qrc_wsicon.cpp: ../../image/wsicon.qrc
ui_%.h: %.ui
$(AM_V_UIC)$(UIC) $< -o $@
+wireshark_%.qm: wireshark_%.ts
+ $(AM_V_LRELEASE)$(LRELEASE) -silent $< -qm $@
+
+i18n_qresource := $(foreach qm, $(QM_FILES),<file>$(qm)</file>)
+
+i18n.qrc: i18n.qrc.in $(QM_FILES)
+ $(AM_V_SED)$(SED) \
+ -e 's,@i18n_qresource\@,$(i18n_qresource),' \
+ -e 's,> *<file>,>\n <file>,g' \
+ < $< > $@
+
#
# Explicit dependencies to force the ui_ headers to be built.
# See "Recording Dependencies manually" in the "Built Sources"
@@ -331,7 +348,6 @@ EXTRA_DIST = \
$(UI_FILES) \
$(QRC_FILES) \
$(TS_FILES) \
- $(QM_FILES) \
CMakeLists.txt \
doxygen.cfg.in \
Makefile.common \
diff --git a/ui/qt/Makefile.common b/ui/qt/Makefile.common
index a2d22fb76d..286c74d3cf 100644
--- a/ui/qt/Makefile.common
+++ b/ui/qt/Makefile.common
@@ -414,7 +414,6 @@ TS_FILES = \
#
# .qm files.
#
-# Should they be auto-generated ?
QM_FILES = $(TS_FILES:.ts=.qm)
WIRESHARK_QT_SRC = \
diff --git a/ui/qt/i18n.qrc b/ui/qt/i18n.qrc
deleted file mode 100644
index 32c7b74377..0000000000
--- a/ui/qt/i18n.qrc
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- Wireshark - Network traffic analyzer
- By Gerald Combs <gerald@wireshark.org>
- Copyright 1998 Gerald Combs
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--->
-<RCC>
- <qresource prefix="/i18n">
- <file>wireshark_de.qm</file>
- <file>wireshark_en.qm</file>
- <file>wireshark_fr.qm</file>
- <file>wireshark_it.qm</file>
- <file>wireshark_ja_JP.qm</file>
- <file>wireshark_pl.qm</file>
- <file>wireshark_zh_CN.qm</file>
- </qresource>
-</RCC>
diff --git a/ui/qt/i18n.qrc.in b/ui/qt/i18n.qrc.in
new file mode 100644
index 0000000000..7260de040e
--- /dev/null
+++ b/ui/qt/i18n.qrc.in
@@ -0,0 +1,4 @@
+<RCC>
+ <qresource prefix="/i18n">@i18n_qresource@
+ </qresource>
+</RCC>
diff --git a/ui/qt/wireshark_de.qm b/ui/qt/wireshark_de.qm
deleted file mode 100644
index 5fc15b2377..0000000000
--- a/ui/qt/wireshark_de.qm
+++ /dev/null
Binary files differ
diff --git a/ui/qt/wireshark_en.qm b/ui/qt/wireshark_en.qm
deleted file mode 100644
index acbb40498b..0000000000
--- a/ui/qt/wireshark_en.qm
+++ /dev/null
Binary files differ
diff --git a/ui/qt/wireshark_fr.qm b/ui/qt/wireshark_fr.qm
deleted file mode 100644
index dde77c8ca7..0000000000
--- a/ui/qt/wireshark_fr.qm
+++ /dev/null
Binary files differ
diff --git a/ui/qt/wireshark_it.qm b/ui/qt/wireshark_it.qm
deleted file mode 100644
index 6586f99f74..0000000000
--- a/ui/qt/wireshark_it.qm
+++ /dev/null
Binary files differ
diff --git a/ui/qt/wireshark_ja_JP.qm b/ui/qt/wireshark_ja_JP.qm
deleted file mode 100644
index 8a768d928f..0000000000
--- a/ui/qt/wireshark_ja_JP.qm
+++ /dev/null
Binary files differ
diff --git a/ui/qt/wireshark_pl.qm b/ui/qt/wireshark_pl.qm
deleted file mode 100644
index f96a16bd11..0000000000
--- a/ui/qt/wireshark_pl.qm
+++ /dev/null
Binary files differ
diff --git a/ui/qt/wireshark_zh_CN.qm b/ui/qt/wireshark_zh_CN.qm
deleted file mode 100644
index 806767f2ec..0000000000
--- a/ui/qt/wireshark_zh_CN.qm
+++ /dev/null
Binary files differ