From fda0f460a95e6b4cf641681e8bcdce976fca4258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 17 Dec 2018 04:17:48 +0100 Subject: Add CMakeL10n rules. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 9f81d5707244152ad95e141a43bbbb52b9edbc85) --- tdemid/CMakeL10n.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tdemid/CMakeL10n.txt (limited to 'tdemid/CMakeL10n.txt') 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" +) -- cgit v1.2.1