2020-05-21 06:28:16 +08:00
|
|
|
# Copyright © 2020 by The qTox Project Contributors
|
|
|
|
#
|
|
|
|
# This file is part of qTox, a Qt-based graphical interface for Tox.
|
|
|
|
# qTox is libre 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 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# qTox 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 qTox. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
|
|
|
|
# Edit this list if translations are added
|
|
|
|
qt5_add_translation(translations_FILES
|
|
|
|
ar.ts
|
|
|
|
be.ts
|
2021-03-04 21:30:49 +08:00
|
|
|
ber.ts
|
2020-05-21 06:28:16 +08:00
|
|
|
bg.ts
|
|
|
|
cs.ts
|
|
|
|
da.ts
|
|
|
|
de.ts
|
|
|
|
el.ts
|
|
|
|
eo.ts
|
|
|
|
es.ts
|
|
|
|
et.ts
|
|
|
|
fa.ts
|
|
|
|
fi.ts
|
|
|
|
fr.ts
|
2021-03-04 21:30:49 +08:00
|
|
|
gl.ts
|
2020-05-21 06:28:16 +08:00
|
|
|
he.ts
|
|
|
|
hr.ts
|
|
|
|
hu.ts
|
|
|
|
it.ts
|
|
|
|
ja.ts
|
|
|
|
jbo.ts
|
2021-03-04 21:30:49 +08:00
|
|
|
kn.ts
|
2020-05-21 06:28:16 +08:00
|
|
|
ko.ts
|
|
|
|
lt.ts
|
|
|
|
mk.ts
|
|
|
|
nl.ts
|
|
|
|
no_nb.ts
|
|
|
|
pl.ts
|
|
|
|
pr.ts
|
|
|
|
pt.ts
|
|
|
|
pt_BR.ts
|
|
|
|
ro.ts
|
|
|
|
ru.ts
|
2021-03-04 21:30:49 +08:00
|
|
|
si.ts
|
2020-05-21 06:28:16 +08:00
|
|
|
sk.ts
|
|
|
|
sl.ts
|
2021-03-04 21:30:49 +08:00
|
|
|
sq.ts
|
2020-05-21 06:28:16 +08:00
|
|
|
sr.ts
|
|
|
|
sr_Latn.ts
|
|
|
|
sv.ts
|
|
|
|
sw.ts
|
|
|
|
ta.ts
|
|
|
|
tr.ts
|
|
|
|
ug.ts
|
|
|
|
uk.ts
|
|
|
|
zh_CN.ts
|
|
|
|
zh_TW.ts
|
|
|
|
)
|
|
|
|
|
2020-05-22 05:25:10 +08:00
|
|
|
# Generate a resource file which contains all translation files
|
|
|
|
function(generate_translation_resource)
|
|
|
|
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in"
|
|
|
|
"<!DOCTYPE RCC>
|
|
|
|
<RCC version=\"1.0\">
|
|
|
|
<qresource prefix=\"/translations\">
|
|
|
|
")
|
|
|
|
foreach(qm ${translations_FILES})
|
|
|
|
get_filename_component(qm_name ${qm} NAME)
|
|
|
|
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in"
|
|
|
|
" <file alias=\"${qm_name}\">${qm}</file>\n")
|
|
|
|
endforeach(qm)
|
|
|
|
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in"
|
|
|
|
" </qresource>
|
|
|
|
</RCC>
|
|
|
|
")
|
|
|
|
endfunction()
|
2020-05-21 06:28:16 +08:00
|
|
|
|
2020-05-22 05:25:10 +08:00
|
|
|
generate_translation_resource()
|
|
|
|
configure_file(${CMAKE_CURRENT_BINARY_DIR}/translations.qrc.in ./translations.qrc COPYONLY)
|
2020-05-21 06:28:16 +08:00
|
|
|
|
2020-07-06 01:55:09 +08:00
|
|
|
add_library(translations_library STATIC ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc)
|
2020-05-22 05:25:10 +08:00
|
|
|
|
|
|
|
# An explicit dependency is needed or AUTORCC will run before the translation files are created
|
|
|
|
set_target_properties(translations_library PROPERTIES AUTOGEN_TARGET_DEPENDS "${translations_FILES}")
|