summaryrefslogtreecommitdiffstats
path: root/amor
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2018-12-22 20:23:30 +0100
committerSlávek Banko <slavek.banko@axis.cz>2018-12-23 03:32:42 +0100
commit36c921b496abeea9880194bbd166933994269604 (patch)
tree96fdf2cfce62c1fcd2148f65b094cdf97fcc6609 /amor
parent4087d6514886dae74778e974ce75f1f3f3321e19 (diff)
downloadtdetoys-36c921b496abeea9880194bbd166933994269604.tar.gz
tdetoys-36c921b496abeea9880194bbd166933994269604.zip
Add CMakeL10n rules.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit fdabfa4682797a28265bcdf85ea536aecf398b06)
Diffstat (limited to 'amor')
-rw-r--r--amor/CMakeL10n.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/amor/CMakeL10n.txt b/amor/CMakeL10n.txt
new file mode 100644
index 0000000..9a458e3
--- /dev/null
+++ b/amor/CMakeL10n.txt
@@ -0,0 +1,44 @@
+##### prepare data/tips-en ######################
+
+file( READ ${CMAKE_CURRENT_SOURCE_DIR}/data/tips-en _tips_file )
+string( REGEX REPLACE "[^\n]" "" _tips_len "${_tips_file}" )
+string( LENGTH "+${_tips_len}" _tips_len )
+unset( _tips_inside )
+unset( _tips_l10n )
+set( _tips_pos 0 )
+while( _tips_pos LESS ${_tips_len} )
+ string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _tip_line "${_tips_file}" )
+ string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _tips_file "${_tips_file}" )
+ math( EXPR _tips_pos "${_tips_pos}+1" )
+
+ if( "${_tip_line}" STREQUAL "%" )
+ if( _tips_inside )
+ set( _tip_line ");" )
+ unset( _tips_inside )
+ else( )
+ set( _tip_line "" )
+ endif( )
+ else( )
+ string( REGEX REPLACE "\\\\" "\\\\\\\\" _tip_line "${_tip_line}" )
+ string( REGEX REPLACE "\\\"" "\\\\\"" _tip_line "${_tip_line}" )
+ string( REGEX REPLACE "\t" "\\\\t" _tip_line "${_tip_line}" )
+ if( _tips_inside )
+ set( _tip_line "\"\\n${_tip_line}\"" )
+ else( )
+ if( NOT "${_tip_line}" STREQUAL "" )
+ set( _tip_line "i18n(\"${_tip_line}\"" )
+ set( _tips_inside 1 )
+ endif( )
+ endif( )
+ endif( )
+ set( _tips_l10n "${_tips_l10n}${_tip_line}\n" )
+endwhile( )
+file( WRITE ${CMAKE_CURRENT_SOURCE_DIR}/data/tips-en.tde_l10n "${_tips_l10n}" )
+
+
+##### create translation templates ##############
+
+tde_l10n_create_template(
+ CATALOG "amor"
+ SOURCES "data/tips-en.tde_l10n" "."
+)