Update TDEL10n module

+ Pick *.directory, *.kcsrc and *.themerc files as desktop style files.
+ Add the ability to specify source files explicitly as desktop style.
+ Override default keywords for desktop style files to exclude Icon.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit aa852adcd2)
r14.0.x
Slávek Banko 5 years ago
parent e4232ffcdf
commit e0f71ec8c7
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -1,6 +1,6 @@
################################################# #################################################
# #
# (C) 2018-2019 Slávek Banko # (C) 2018-2020 Slávek Banko
# slavek (DOT) banko (AT) axis.cz # slavek (DOT) banko (AT) axis.cz
# #
# Improvements and feedback are welcome # Improvements and feedback are welcome
@ -214,7 +214,9 @@ macro( tde_l10n_create_template )
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_c_default "i18n" "i18n:1,2" "tr2i18n" "tr2i18n:1,2" "I18N_NOOP" "I18N_NOOP2" )
set( _keywords_desktop_default "Description" "ExtraNames" "X-TDE-Submenu" ) set( _keywords_desktop_default
"-" "Name" "GenericName" "Comment" "Keywords"
"Description" "ExtraNames" "X-TDE-Submenu" )
foreach( _arg ${ARGN} ) foreach( _arg ${ARGN} )
@ -232,6 +234,13 @@ macro( tde_l10n_create_template )
set( _directive 1 ) set( _directive 1 )
endif( ) endif( )
# found directive "SOURCES_DESKTOP"
if( "+${_arg}" STREQUAL "+SOURCES_DESKTOP" )
unset( _desktops )
set( _var _desktops )
set( _directive 1 )
endif( )
# found directive "EXCLUDES" # found directive "EXCLUDES"
if( "+${_arg}" STREQUAL "+EXCLUDES" ) if( "+${_arg}" STREQUAL "+EXCLUDES" )
unset( _excludes ) unset( _excludes )
@ -312,7 +321,7 @@ macro( tde_l10n_create_template )
message( STATUS "Create translation template ${_potFilename}" ) message( STATUS "Create translation template ${_potFilename}" )
# verify sources # verify sources
if( NOT _sources AND NOT _attributes ) if( NOT _sources AND NOT _attributes AND NOT _desktops )
# add current directory # add current directory
list( APPEND _sources "." ) list( APPEND _sources "." )
endif( ) endif( )
@ -364,7 +373,7 @@ macro( tde_l10n_create_template )
endforeach( ) endforeach( )
endforeach( ) endforeach( )
endif( ) endif( )
if( NOT _files AND NOT _attributes ) if( NOT _files AND NOT _attributes AND NOT _desktops )
tde_message_fatal( "no source files found" ) tde_message_fatal( "no source files found" )
endif( ) endif( )
@ -505,9 +514,9 @@ macro( tde_l10n_create_template )
endif( ) endif( )
endforeach( ) endforeach( )
# pick desktop files *.desktop and *.protocol # pick desktop files - *.desktop, *.directory, *.kcsrc, *.protocol and *.themerc
foreach( _src ${_files} ) foreach( _src ${_files} )
if( ${_src} MATCHES "\\.(desktop|protocol)(\\.cmake)?$" ) if( ${_src} MATCHES "\\.(desktop|directory|kcsrc|protocol|themerc)(\\.cmake)?$" )
list( APPEND _desktops ${_src} ) list( APPEND _desktops ${_src} )
list( REMOVE_ITEM _files ${_src} ) list( REMOVE_ITEM _files ${_src} )
endif( ) endif( )

Loading…
Cancel
Save