|
|
@ -149,6 +149,7 @@ endfunction( )
|
|
|
|
##### The methods from b) to d) can be combined.
|
|
|
|
##### The methods from b) to d) can be combined.
|
|
|
|
##### EXCLUDES determines which files are to be excluded from processing
|
|
|
|
##### EXCLUDES determines which files are to be excluded from processing
|
|
|
|
##### KEYWORDS determines additional keywords for xgettext.
|
|
|
|
##### KEYWORDS determines additional keywords for xgettext.
|
|
|
|
|
|
|
|
##### Use "-" if is needed to disable default keywords.
|
|
|
|
##### ATTRIBUTES determines files and specification for extractattr:
|
|
|
|
##### ATTRIBUTES determines files and specification for extractattr:
|
|
|
|
##### source_spec:element,attribute[,context]
|
|
|
|
##### source_spec:element,attribute[,context]
|
|
|
|
##### DESTINATION determines directory to save translation template.
|
|
|
|
##### DESTINATION determines directory to save translation template.
|
|
|
@ -174,11 +175,13 @@ macro( tde_l10n_create_template )
|
|
|
|
unset( _desktops )
|
|
|
|
unset( _desktops )
|
|
|
|
unset( _pots )
|
|
|
|
unset( _pots )
|
|
|
|
unset( _dest )
|
|
|
|
unset( _dest )
|
|
|
|
unset( _keywords )
|
|
|
|
unset( _keywords_add )
|
|
|
|
unset( _attributes )
|
|
|
|
unset( _attributes )
|
|
|
|
unset( _pot )
|
|
|
|
unset( _pot )
|
|
|
|
unset( _directive )
|
|
|
|
unset( _directive )
|
|
|
|
set( _var _catalog )
|
|
|
|
set( _var _catalog )
|
|
|
|
|
|
|
|
set( _keywords_c_default "i18n" "i18n:1,2" "tr2i18n" "tr2i18n:1,2" "I18N_NOOP" "I18N_NOOP2" )
|
|
|
|
|
|
|
|
set( _keywords_desktop_default "Description" "ExtraNames" "X-TDE-Submenu" )
|
|
|
|
|
|
|
|
|
|
|
|
foreach( _arg ${ARGN} )
|
|
|
|
foreach( _arg ${ARGN} )
|
|
|
|
|
|
|
|
|
|
|
@ -212,8 +215,8 @@ macro( tde_l10n_create_template )
|
|
|
|
|
|
|
|
|
|
|
|
# found directive "KEYWORDS"
|
|
|
|
# found directive "KEYWORDS"
|
|
|
|
if( "+${_arg}" STREQUAL "+KEYWORDS" )
|
|
|
|
if( "+${_arg}" STREQUAL "+KEYWORDS" )
|
|
|
|
unset( _keywords )
|
|
|
|
unset( _keywords_add )
|
|
|
|
set( _var _keywords )
|
|
|
|
set( _var _keywords_add )
|
|
|
|
set( _directive 1 )
|
|
|
|
set( _directive 1 )
|
|
|
|
endif( )
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
|
@ -328,10 +331,22 @@ macro( tde_l10n_create_template )
|
|
|
|
tde_message_fatal( "no source files found" )
|
|
|
|
tde_message_fatal( "no source files found" )
|
|
|
|
endif( )
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
|
|
|
|
# prepare additional keywords
|
|
|
|
# prepare keywords
|
|
|
|
unset( _add_keywords )
|
|
|
|
unset( _keywords_c )
|
|
|
|
foreach( _keyword ${_keywords} )
|
|
|
|
unset( _keywords_desktop )
|
|
|
|
list( APPEND _add_keywords "-k${_keyword}" )
|
|
|
|
foreach( _keyword ${_keywords_c_default} ${_keywords_add} )
|
|
|
|
|
|
|
|
if( "${_keyword}" STREQUAL "-" )
|
|
|
|
|
|
|
|
unset( _keywords_c )
|
|
|
|
|
|
|
|
unset( _keyword )
|
|
|
|
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
list( APPEND _keywords_c "-k${_keyword}" )
|
|
|
|
|
|
|
|
endforeach( )
|
|
|
|
|
|
|
|
foreach( _keyword ${_keywords_desktop_default} ${_keywords_add} )
|
|
|
|
|
|
|
|
if( "${_keyword}" STREQUAL "-" )
|
|
|
|
|
|
|
|
unset( _keywords_desktop )
|
|
|
|
|
|
|
|
unset( _keyword )
|
|
|
|
|
|
|
|
endif( )
|
|
|
|
|
|
|
|
list( APPEND _keywords_desktop "-k${_keyword}" )
|
|
|
|
endforeach( )
|
|
|
|
endforeach( )
|
|
|
|
|
|
|
|
|
|
|
|
# prepare resource files *.kcfg, *.rc and *.ui
|
|
|
|
# prepare resource files *.kcfg, *.rc and *.ui
|
|
|
@ -402,9 +417,7 @@ macro( tde_l10n_create_template )
|
|
|
|
if( _files )
|
|
|
|
if( _files )
|
|
|
|
execute_process(
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${KDE_XGETTEXT_EXECUTABLE} --foreign-user -C
|
|
|
|
COMMAND ${KDE_XGETTEXT_EXECUTABLE} --foreign-user -C
|
|
|
|
-ki18n -ki18n:1,2 -ktr2i18n -ktr2i18n:1,2
|
|
|
|
${_keywords_c} -o - ${_files}
|
|
|
|
-kI18N_NOOP -kI18N_NOOP2 ${_add_keywords}
|
|
|
|
|
|
|
|
-o - ${_files}
|
|
|
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE _pot
|
|
|
|
OUTPUT_VARIABLE _pot
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -426,8 +439,7 @@ macro( tde_l10n_create_template )
|
|
|
|
endif( )
|
|
|
|
endif( )
|
|
|
|
execute_process(
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${XGETTEXT_EXECUTABLE} ${_withPotHeader} -L Desktop
|
|
|
|
COMMAND ${XGETTEXT_EXECUTABLE} ${_withPotHeader} -L Desktop
|
|
|
|
-kDescription -kExtraNames -kX-TDE-Submenu ${_add_keywords}
|
|
|
|
${_keywords_desktop} -o - ${_desktops}
|
|
|
|
-o - ${_desktops}
|
|
|
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE _potDesktop
|
|
|
|
OUTPUT_VARIABLE _potDesktop
|
|
|
|
)
|
|
|
|
)
|
|
|
|