summaryrefslogtreecommitdiffstats
path: root/quanta
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-01-13 16:32:25 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-01-13 16:32:25 +0100
commit1174bdb4683065dc555622f394a36ee1fa2b446c (patch)
tree4db03724fe133e3a0d5270a8abeabfa250b25e4d /quanta
parent915b7864297b30a2d45ac4f59666d0840dcf93c3 (diff)
downloadtdewebdev-1174bdb4683065dc555622f394a36ee1fa2b446c.tar.gz
tdewebdev-1174bdb4683065dc555622f394a36ee1fa2b446c.zip
Add CMakeL10n rules.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'quanta')
-rw-r--r--quanta/CMakeL10n.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/quanta/CMakeL10n.txt b/quanta/CMakeL10n.txt
new file mode 100644
index 00000000..295a764d
--- /dev/null
+++ b/quanta/CMakeL10n.txt
@@ -0,0 +1,45 @@
+##### prepare strings from data files ###########
+
+message( STATUS "Prepare to extract strings from quanta data files..." )
+
+## extra resources
+unset( _resources_l10n )
+file( GLOB_RECURSE _resources_files
+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/data/toolbars/*.actions
+ ${CMAKE_CURRENT_SOURCE_DIR}/data/toolbars/*.toolbar
+ ${CMAKE_CURRENT_SOURCE_DIR}/*.kmdr
+)
+list( SORT _resources_files )
+foreach( _resource_file ${_resources_files} )
+ tde_l10n_prepare_xml( "${_resource_file}" )
+ list( APPEND _resources_l10n "${_resource_file}.tde_l10n" )
+endforeach( )
+
+## chars
+file( READ "${CMAKE_CURRENT_SOURCE_DIR}/data/chars" _chars_file )
+string( REPLACE "\"" "\\\"" _chars_l10n "${_chars_file}" )
+string( REGEX REPLACE
+ "(^|\n)([^\n]+)"
+ "\\1i18n(\"\\2\");"
+ _chars_l10n "${_chars_l10n}"
+)
+file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/data/chars.tde_l10n" "${_chars_l10n}" )
+
+
+##### create translation templates ##############
+
+tde_l10n_create_template(
+ CATALOG "quanta"
+ SOURCES
+ "."
+ "../lib"
+ ${_resources_l10n}
+ "data/chars.tde_l10n"
+ "data/tips"
+ ATTRIBUTES
+ "data/toolbars/*.actions:action,text"
+ "data/toolbars/*.toolbar:action,text"
+ "data/config/actions.rc:action,text"
+ "*.tag:tag,comment"
+)