svnpo.sh 1.08 KB
Newer Older
1
#!/bin/bash
2
[ -d po ] || mkdir po || exit
3
cd po
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
echo 'FIND_PACKAGE(Gettext)
FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
IF(GETTEXT_MSGFMT_EXECUTABLE)
  FILE(GLOB PO_FILES *.po)
  SET(GMO_FILES)
  FOREACH(_po ${PO_FILES})
    GET_FILENAME_COMPONENT(_lang ${_po} NAME_WE)
    SET(_gmo ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
    ADD_CUSTOM_COMMAND(OUTPUT ${_gmo}
        COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmo} ${_po}
        DEPENDS ${_po})
    INSTALL(FILES ${_gmo}
        DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/
        RENAME kdenlive.mo)
    LIST(APPEND GMO_FILES ${_gmo})
    #GETTEXT_PROCESS_PO_FILES(${_lang} ALL INSTALL_DESTINATION \${LOCALEDIR} PO_FILES {_lang}.po)
  ENDFOREACH(_po ${PO_FILES})
  ADD_CUSTOM_TARGET(translations ALL DEPENDS ${GMO_FILES})
ENDIF(GETTEXT_MSGFMT_EXECUTABLE)' > CMakeLists.txt
23
locales=$(wget -O - http://websvn.kde.org/*checkout*/trunk/l10n-kde4/subdirs | grep -v x-test)
24 25
for locale in $locales; do
	wget -O $locale.po "http://websvn.kde.org/*checkout*/trunk/l10n-kf5/$locale/messages/kdemultimedia/kdenlive.po" || rm $locale.po
26 27
done