Commit a0c65825 authored by Graeme Gott's avatar Graeme Gott

Use build system to generate translations template.

parent 0096dcbc
......@@ -43,3 +43,29 @@ install(
DESTINATION ${CMAKE_INSTALL_DATADIR}/xfce4/panel/plugins
)
add_custom_target(desktopfile ALL DEPENDS whiskermenu.desktop)
# Generate translations template
find_program(XGETTEXT_EXECUTABLE xgettext)
if(XGETTEXT_EXECUTABLE)
add_custom_target(update_pot
COMMAND ${XGETTEXT_EXECUTABLE}
--output=xfce4-whiskermenu-plugin.pot
--from-code=UTF-8
--c++ --keyword=_
--sort-output
--package-name='Whisker Menu'
--copyright-holder='Graeme Gott'
../panel-plugin/*.cpp ../panel-plugin/*.h
COMMAND ${XGETTEXT_EXECUTABLE}
--output=xfce4-whiskermenu-plugin.pot
--join-existing
--from-code=UTF-8
-k --keyword=Name --keyword=Comment
--sort-output
--package-name='Whisker Menu'
--copyright-holder='Graeme Gott'
../panel-plugin/whiskermenu.desktop.in
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating xfce4-whiskermenu-plugin.pot"
)
endif()
#!/bin/sh
BASEDIR=../panel-plugin
echo -n 'Extracting messages...'
# Sort alphabetically to match cmake
xgettext --from-code=UTF-8 --c++ --keyword=_ --sort-output \
--package-name='Whisker Menu' --copyright-holder='Graeme Gott' \
--output=xfce4-whiskermenu-plugin.pot ${BASEDIR}/*.cpp ${BASEDIR}/*.h
xgettext --from-code=UTF-8 -k --keyword=Name --keyword=Comment --join-existing --sort-output \
--package-name='Whisker Menu' --copyright-holder='Graeme Gott' \
--output=xfce4-whiskermenu-plugin.pot ${BASEDIR}/*.desktop.in
echo ' DONE'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment