summaryrefslogtreecommitdiffstats
path: root/katomic
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-12-28 12:10:29 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-12-28 12:10:30 +0100
commit3197459242b128752ce6eef11330d6b9aa913591 (patch)
treec01a5372a69cb64ad8ee91570f5bbadc45c4c249 /katomic
parent84aad3784917007bd90a615a7077c70ea0895f71 (diff)
downloadtdegames-3197459242b128752ce6eef11330d6b9aa913591.tar.gz
tdegames-3197459242b128752ce6eef11330d6b9aa913591.zip
Add CMakeL10n rules.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'katomic')
-rw-r--r--katomic/CMakeL10n.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/katomic/CMakeL10n.txt b/katomic/CMakeL10n.txt
new file mode 100644
index 00000000..75c535f3
--- /dev/null
+++ b/katomic/CMakeL10n.txt
@@ -0,0 +1,28 @@
+##### prepare level names #######################
+
+file( GLOB_RECURSE _level_files
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/levels/level_*
+)
+list( SORT _level_files )
+unset( _level_files_l10n )
+foreach( _level_file ${_level_files} )
+ file( READ "${CMAKE_CURRENT_SOURCE_DIR}/${_level_file}" _level_data )
+ string( REGEX REPLACE
+ "(^|\n)Name=([^\n]+)"
+ "\\1i18n(\"\\2\");"
+ _level_l10n "${_level_data}"
+ )
+ file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/${_level_file}.tde_l10n" "${_level_l10n}" )
+ list( APPEND _level_files_l10n "${_level_file}.tde_l10n" )
+endforeach( )
+
+
+##### create translation templates ##############
+
+tde_l10n_create_template(
+ CATALOG "katomic"
+ SOURCES
+ "."
+ ${_level_files_l10n}
+)