2017-02-15 22:14:37 -05:00
find_program ( GETTEXT_MSGFMT_EXECUTABLE msgfmt )
if ( NOT GETTEXT_MSGFMT_EXECUTABLE )
message ( WARNING "-- msgfmt: not found. Translations will *not* be installed" )
else ( )
#containment translations
set ( catalogname plasma_applet_org.kde.latte.containment )
add_custom_target ( translations-containment ALL )
file ( GLOB PO_FILES po/containment/*.po )
foreach ( _poFile ${ PO_FILES } )
get_filename_component ( _poFileName ${ _poFile } NAME )
string ( REGEX REPLACE "^${catalogname}_?" "" _langCode ${ _poFileName } )
string ( REGEX REPLACE "\\.po$" "" _langCode ${ _langCode } )
if ( _langCode )
get_filename_component ( _lang ${ _poFile } NAME_WE )
set ( _gmoFile ${ CMAKE_CURRENT_BINARY_DIR } /containment/ ${ _lang } .gmo )
add_custom_command ( TARGET translations-containment
C O M M A N D $ { G E T T E X T _ M S G F M T _ E X E C U T A B L E } - - c h e c k - o $ { _ g m o F i l e } $ { _ p o F i l e }
D E P E N D S $ { _ p o F i l e } )
install ( FILES ${ _gmoFile }
D E S T I N A T I O N $ { L O C A L E _ I N S T A L L _ D I R } / $ { K F 5 _ L O C A L E _ P R E F I X } $ { _ l a n g C o d e } / L C _ M E S S A G E S /
R E N A M E $ { c a t a l o g n a m e } . m o )
endif ( )
endforeach ( )
#plasmoid translations
set ( catalogname-plasmoid plasma_applet_org.kde.latte.plasmoid )
add_custom_target ( translations-plasmoid ALL )
file ( GLOB PO_FILES_PLASMOID po/plasmoid/*.po )
foreach ( _poFile ${ PO_FILES_PLASMOID } )
get_filename_component ( _poFileName ${ _poFile } NAME )
string ( REGEX REPLACE "^${catalogname-plasmoid}_?" "" _langCode ${ _poFileName } )
string ( REGEX REPLACE "\\.po$" "" _langCode ${ _langCode } )
if ( _langCode )
get_filename_component ( _lang ${ _poFile } NAME_WE )
set ( _gmoFile ${ CMAKE_CURRENT_BINARY_DIR } /plasmoid/ ${ _lang } .gmo )
add_custom_command ( TARGET translations-plasmoid
C O M M A N D $ { G E T T E X T _ M S G F M T _ E X E C U T A B L E } - - c h e c k - o $ { _ g m o F i l e } $ { _ p o F i l e }
D E P E N D S $ { _ p o F i l e } )
install ( FILES ${ _gmoFile }
D E S T I N A T I O N $ { L O C A L E _ I N S T A L L _ D I R } / $ { K F 5 _ L O C A L E _ P R E F I X } $ { _ l a n g C o d e } / L C _ M E S S A G E S /
R E N A M E $ { c a t a l o g n a m e - p l a s m o i d } . m o )
endif ( )
endforeach ( )
#app translations
set ( catalogname-app latte-dock )
add_custom_target ( translations-app ALL )
file ( GLOB PO_FILES_CORONA po/app/*.po )
foreach ( _poFile ${ PO_FILES_CORONA } )
get_filename_component ( _poFileName ${ _poFile } NAME )
string ( REGEX REPLACE "^${catalogname-app}_?" "" _langCode ${ _poFileName } )
string ( REGEX REPLACE "\\.po$" "" _langCode ${ _langCode } )
if ( _langCode )
get_filename_component ( _lang ${ _poFile } NAME_WE )
set ( _gmoFile ${ CMAKE_CURRENT_BINARY_DIR } /app/ ${ _lang } .gmo )
add_custom_command ( TARGET translations-app
C O M M A N D $ { G E T T E X T _ M S G F M T _ E X E C U T A B L E } - - c h e c k - o $ { _ g m o F i l e } $ { _ p o F i l e }
D E P E N D S $ { _ p o F i l e } )
install ( FILES ${ _gmoFile }
D E S T I N A T I O N $ { L O C A L E _ I N S T A L L _ D I R } / $ { K F 5 _ L O C A L E _ P R E F I X } $ { _ l a n g C o d e } / L C _ M E S S A G E S /
R E N A M E $ { c a t a l o g n a m e - a p p } . m o )
endif ( )
endforeach ( )
2017-07-28 09:47:33 +03:00
#separator translations
set ( catalogname-separator plasma_applet_org.kde.latte.separator )
add_custom_target ( translations-separator ALL )
file ( GLOB PO_FILES_SEPARATOR po/applets/separator/*.po )
foreach ( _poFile ${ PO_FILES_SPACER } )
get_filename_component ( _poFileName ${ _poFile } NAME )
string ( REGEX REPLACE "^${catalogname-separator}_?" "" _langCode ${ _poFileName } )
string ( REGEX REPLACE "\\.po$" "" _langCode ${ _langCode } )
if ( _langCode )
get_filename_component ( _lang ${ _poFile } NAME_WE )
set ( _gmoFile ${ CMAKE_CURRENT_BINARY_DIR } /applets/separator/ ${ _lang } .gmo )
add_custom_command ( TARGET translations-separator
C O M M A N D $ { G E T T E X T _ M S G F M T _ E X E C U T A B L E } - - c h e c k - o $ { _ g m o F i l e } $ { _ p o F i l e }
D E P E N D S $ { _ p o F i l e } )
install ( FILES ${ _gmoFile }
D E S T I N A T I O N $ { L O C A L E _ I N S T A L L _ D I R } / $ { K F 5 _ L O C A L E _ P R E F I X } $ { _ l a n g C o d e } / L C _ M E S S A G E S /
R E N A M E $ { c a t a l o g n a m e - s e p a r a t o r } . m o )
endif ( )
endforeach ( )
#spacer translations
set ( catalogname-spacer plasma_applet_org.kde.latte.spacer )
add_custom_target ( translations-spacer ALL )
file ( GLOB PO_FILES_SPACER po/applets/spacer/*.po )
foreach ( _poFile ${ PO_FILES_SPACER } )
get_filename_component ( _poFileName ${ _poFile } NAME )
string ( REGEX REPLACE "^${catalogname-spacer}_?" "" _langCode ${ _poFileName } )
string ( REGEX REPLACE "\\.po$" "" _langCode ${ _langCode } )
if ( _langCode )
get_filename_component ( _lang ${ _poFile } NAME_WE )
set ( _gmoFile ${ CMAKE_CURRENT_BINARY_DIR } /applets/spacer/ ${ _lang } .gmo )
add_custom_command ( TARGET translations-spacer
C O M M A N D $ { G E T T E X T _ M S G F M T _ E X E C U T A B L E } - - c h e c k - o $ { _ g m o F i l e } $ { _ p o F i l e }
D E P E N D S $ { _ p o F i l e } )
install ( FILES ${ _gmoFile }
D E S T I N A T I O N $ { L O C A L E _ I N S T A L L _ D I R } / $ { K F 5 _ L O C A L E _ P R E F I X } $ { _ l a n g C o d e } / L C _ M E S S A G E S /
R E N A M E $ { c a t a l o g n a m e - s p a c e r } . m o )
endif ( )
endforeach ( )
2017-02-15 22:14:37 -05:00
endif ( )