Replace TRANSLATION_FILES.txt cmake include file with LINGUAS file (#287)

Generate lists of translation (.ts) files by reading LINGUAS in CMake.
This commit is contained in:
Jaye Evins
2026-01-16 14:17:36 -05:00
committed by GitHub
parent 0f758456b4
commit 78448a44c9
3 changed files with 58 additions and 90 deletions
+14 -1
View File
@@ -1,10 +1,23 @@
#===========================================
# Create list of ts files from LINGUAS file
#===========================================
function (expand_linguas out_var linguas_file basename)
file (STRINGS ${linguas_file} codes REGEX "^[^#].*$")
list (TRANSFORM codes REPLACE "\(.+\)" "${basename}_\\1.ts" OUTPUT_VARIABLE filenames)
set (${out_var} ${filenames} PARENT_SCOPE)
endfunction ()
#=======================================
# Translation files
#=======================================
# without this a "make clean" would delete the .ts files
set_directory_properties (PROPERTIES CLEAN_NO_CUSTOM 1)
include (TRANSLATION_FILES.txt)
expand_linguas (GLABELS_TS_FILES "LINGUAS" "glabels")
expand_linguas (TEMPLATES_TS_FILES "LINGUAS" "templates")
#
# Update strings in C-locale translation files (lupdate+lrelease)