diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-12-17 04:17:48 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-12-17 23:28:57 +0100 |
commit | fda0f460a95e6b4cf641681e8bcdce976fca4258 (patch) | |
tree | a46c3e6a271a30f6e9a6024fd0c6bab9da92b26b /tdemid | |
parent | ea224b458d0035e622a982b400327d1eca12f6ba (diff) | |
download | tdemultimedia-fda0f460a95e6b4cf641681e8bcdce976fca4258.tar.gz tdemultimedia-fda0f460a95e6b4cf641681e8bcdce976fca4258.zip |
Add CMakeL10n rules.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 9f81d5707244152ad95e141a43bbbb52b9edbc85)
Diffstat (limited to 'tdemid')
-rw-r--r-- | tdemid/CMakeL10n.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tdemid/CMakeL10n.txt b/tdemid/CMakeL10n.txt new file mode 100644 index 00000000..c511041f --- /dev/null +++ b/tdemid/CMakeL10n.txt @@ -0,0 +1,31 @@ +##### prepare instrname.cpp ##################### + +file( READ "${CMAKE_CURRENT_SOURCE_DIR}/instrname.cpp" _instrname_data ) +string( REGEX REPLACE "[^\n]" "" _instrname_len "${_instrname_data}" ) +string( LENGTH "+${_instrname_len}" _instrname_len ) +set( _instrname_pos 0 ) +set( _instrname_l10n "" ) +while( _instrname_pos LESS ${_instrname_len} ) + # pick line + string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\1" _line "${_instrname_data}" ) + string( REGEX REPLACE "^([^\n]*)\n(.*)" "\\2" _instrname_data "${_instrname_data}" ) + math( EXPR _instrname_pos "${_instrname_pos}+1" ) + + # write instrument name + if( "${_line}" MATCHES "\".+\"" ) + string( REGEX MATCH "\".+\"" _line "${_line}" ) + set( _line "i18n(${_line});" ) + else( ) + set( _line "" ) + endif( ) + set( _instrname_l10n "${_instrname_l10n}${_line}\n" ) +endwhile( ) +file( WRITE "${CMAKE_CURRENT_SOURCE_DIR}/instrname.cpp.tde_l10n" "${_instrname_l10n}" ) + + +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "tdemid" + SOURCES "." "instrname.cpp.tde_l10n" +) |