mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
edit translations build
This commit is contained in:
parent
6667b45919
commit
0288e6e1eb
13
sources/translations/CMakeLists.txt
Normal file
13
sources/translations/CMakeLists.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
find_package(Gettext REQUIRED)
|
||||||
|
|
||||||
|
if (BUILD_KDE4)
|
||||||
|
find_package (KDE4 REQUIRED)
|
||||||
|
else ()
|
||||||
|
find_package (ECM 0.0.12 REQUIRED NO_MODULE)
|
||||||
|
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
|
||||||
|
find_package (KF5 REQUIRED COMPONENTS I18n)
|
||||||
|
include (KDEInstallDirs)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
add_subdirectory (awesome-widget)
|
||||||
|
add_subdirectory (desktop-panel)
|
@ -1,25 +1,18 @@
|
|||||||
find_package(KDE4 REQUIRED)
|
set (MO_NAME plasma_applet_awesome-widget.mo)
|
||||||
find_package(Gettext REQUIRED)
|
|
||||||
|
|
||||||
if (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
|
||||||
message(FATAL_ERROR "Please install the msgfmt binary")
|
|
||||||
endif (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
|
||||||
|
|
||||||
file (GLOB _po_files *.po)
|
file (GLOB _po_files *.po)
|
||||||
|
|
||||||
set (_gmoFiles)
|
set (_gmoFiles)
|
||||||
|
|
||||||
foreach (_current_PO_FILE ${_po_files})
|
foreach (_current_PO_FILE ${_po_files})
|
||||||
get_filename_component (_lang ${_current_PO_FILE} NAME_WE)
|
get_filename_component (_lang ${_current_PO_FILE} NAME_WE)
|
||||||
set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
|
set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
|
||||||
add_custom_command (OUTPUT ${_gmoFile}
|
add_custom_command (OUTPUT ${_gmoFile}
|
||||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
DEPENDS ${_current_PO_FILE}
|
DEPENDS ${_current_PO_FILE}
|
||||||
)
|
)
|
||||||
|
|
||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/
|
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/ RENAME ${MO_NAME})
|
||||||
RENAME plasma_applet_awesome-widget.mo)
|
list (APPEND _gmoFiles ${_gmoFile})
|
||||||
list (APPEND _gmoFiles ${_gmoFile})
|
|
||||||
endforeach (_current_PO_FILE)
|
endforeach (_current_PO_FILE)
|
||||||
add_custom_target (pofiles ALL DEPENDS ${_gmoFiles})
|
add_custom_target (pofiles ALL DEPENDS ${_gmoFiles})
|
||||||
|
@ -1,41 +1,48 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
BASEDIR="../" # root of translatable sources
|
# root of translatable sources
|
||||||
|
BASEDIR="../../"
|
||||||
|
PATHS="awesome-widget"
|
||||||
PROJECT="plasma_applet_awesome-widget" # project name
|
PROJECT="plasma_applet_awesome-widget" # project name
|
||||||
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues" # MSGID-Bugs
|
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues" # MSGID-Bugs
|
||||||
WDIR=$(pwd) # working dir
|
# working dir
|
||||||
|
WDIR=`pwd`
|
||||||
|
|
||||||
|
|
||||||
echo "Preparing rc files"
|
echo "Preparing rc files"
|
||||||
cd "${BASEDIR}"
|
cd ${BASEDIR}
|
||||||
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' -o -name '*.py' | sort > "${WDIR}/rcfiles.list"
|
# we use simple sorting to make sure the lines do not jump around too much from system to system
|
||||||
xargs --arg-file=${WDIR}/rcfiles.list extractrc > "${WDIR}/rc.cpp"
|
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | grep ${PATHS} | sort > ${WDIR}/rcfiles.list
|
||||||
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> "${WDIR}/rc.cpp"
|
xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
|
||||||
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> "${WDIR}/rc.cpp"
|
# additional string for KAboutData
|
||||||
|
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
|
||||||
|
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
|
||||||
|
cd ${WDIR}
|
||||||
echo "Done preparing rc files"
|
echo "Done preparing rc files"
|
||||||
|
|
||||||
echo "Extracting messages"
|
echo "Extracting messages"
|
||||||
cd "${WDIR}"
|
cd ${BASEDIR}
|
||||||
cd "${BASEDIR}"
|
# see above on sorting
|
||||||
find . -name '*.cpp' -o -name '*.h' -o -name '*.c' -o -name '*.py' | sort > "${WDIR}/infiles.list"
|
find . -name '*.cpp' -o -name '*.h' -o -name '*.qml' | grep ${PATHS} | sort > ${WDIR}/infiles.list
|
||||||
echo "rc.cpp" >> "${WDIR}/infiles.list"
|
echo "rc.cpp" >> ${WDIR}/infiles.list
|
||||||
|
cd ${WDIR}
|
||||||
cd "${WDIR}"
|
|
||||||
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
|
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
|
||||||
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
|
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
|
||||||
--msgid-bugs-address="${BUGADDR}" --language=Python \
|
--msgid-bugs-address="${BUGADDR}" \
|
||||||
--files-from=infiles.list -D "${BASEDIR}" -D "${WDIR}" -o "${PROJECT}.pot" || { echo "error while calling xgettext. aborting."; exit 1; }
|
--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "Error while calling xgettext, aborting."; exit 1; }
|
||||||
echo "Done extracting messages"
|
echo "Done extracting messages"
|
||||||
|
|
||||||
echo "Merging translations"
|
echo "Merging translations"
|
||||||
catalogs=$(find . -name '*.po')
|
catalogs=`find . -name '*.po'`
|
||||||
for cat in $catalogs; do
|
for cat in $catalogs; do
|
||||||
echo $cat
|
echo $cat
|
||||||
msgmerge -o "$cat.new" "$cat" "${PROJECT}.pot"
|
msgmerge -o $cat.new $cat ${PROJECT}.pot
|
||||||
mv "$cat.new" "$cat"
|
mv $cat.new $cat
|
||||||
done
|
done
|
||||||
echo "Done merging translations"
|
echo "Done merging translations"
|
||||||
|
|
||||||
|
|
||||||
echo "Cleaning up"
|
echo "Cleaning up"
|
||||||
cd "${WDIR}"
|
cd ${WDIR}
|
||||||
rm -f rcfiles.list infiles.list rc.cpp
|
rm -f rcfiles.list infiles.list rc.cpp
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
|
@ -1,24 +1,18 @@
|
|||||||
find_package(KDE4 REQUIRED)
|
set (MO_NAME plasma_applet_desktop-panel.mo)
|
||||||
find_package(Gettext REQUIRED)
|
|
||||||
|
|
||||||
if (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
|
||||||
message(FATAL_ERROR "Please install the msgfmt binary")
|
|
||||||
endif (NOT GETTEXT_MSGFMT_EXECUTABLE)
|
|
||||||
|
|
||||||
file (GLOB _po_files *.po)
|
file (GLOB _po_files *.po)
|
||||||
|
|
||||||
set (_gmoFiles)
|
set (_gmoFiles)
|
||||||
|
|
||||||
foreach (_current_PO_FILE ${_po_files})
|
foreach (_current_PO_FILE ${_po_files})
|
||||||
get_filename_component (_lang ${_current_PO_FILE} NAME_WE)
|
get_filename_component (_lang ${_current_PO_FILE} NAME_WE)
|
||||||
set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
|
set (_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
|
||||||
add_custom_command (OUTPUT ${_gmoFile}
|
add_custom_command (OUTPUT ${_gmoFile}
|
||||||
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
DEPENDS ${_current_PO_FILE}
|
DEPENDS ${_current_PO_FILE}
|
||||||
)
|
)
|
||||||
|
|
||||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/ RENAME plasma_applet_desktop-panel.mo)
|
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_MESSAGES/ RENAME ${MO_NAME})
|
||||||
list (APPEND _gmoFiles ${_gmoFile})
|
list (APPEND _gmoFiles ${_gmoFile})
|
||||||
endforeach (_current_PO_FILE)
|
endforeach (_current_PO_FILE)
|
||||||
add_custom_target (pofiles ALL DEPENDS ${_gmoFiles})
|
add_custom_target (pofiles ALL DEPENDS ${_gmoFiles})
|
||||||
|
@ -1,40 +1,48 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
BASEDIR="../" # root of translatable sources
|
# root of translatable sources
|
||||||
|
BASEDIR="../../"
|
||||||
|
PATHS="desktop-panel"
|
||||||
PROJECT="plasma_applet_desktop-panel" # project name
|
PROJECT="plasma_applet_desktop-panel" # project name
|
||||||
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues" # MSGID-Bugs
|
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues" # MSGID-Bugs
|
||||||
WDIR=`pwd` # working dir
|
# working dir
|
||||||
|
WDIR=`pwd`
|
||||||
|
|
||||||
|
|
||||||
echo "Preparing rc files"
|
echo "Preparing rc files"
|
||||||
cd "${BASEDIR}"
|
cd ${BASEDIR}
|
||||||
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' -o -name '*.py' | sort > "${WDIR}/rcfiles.list"
|
# we use simple sorting to make sure the lines do not jump around too much from system to system
|
||||||
xargs --arg-file=${WDIR}/rcfiles.list extractrc > "${WDIR}/rc.cpp"
|
find . -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | grep ${PATHS} | sort > ${WDIR}/rcfiles.list
|
||||||
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> "${WDIR}/rc.cpp"
|
xargs --arg-file=${WDIR}/rcfiles.list extractrc > ${WDIR}/rc.cpp
|
||||||
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> "${WDIR}/rc.cpp"
|
# additional string for KAboutData
|
||||||
|
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> ${WDIR}/rc.cpp
|
||||||
|
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> ${WDIR}/rc.cpp
|
||||||
|
cd ${WDIR}
|
||||||
echo "Done preparing rc files"
|
echo "Done preparing rc files"
|
||||||
|
|
||||||
echo "Extracting messages"
|
echo "Extracting messages"
|
||||||
cd "${WDIR}"
|
cd ${BASEDIR}
|
||||||
cd "${BASEDIR}"
|
# see above on sorting
|
||||||
find . -name '*.cpp' -o -name '*.h' -o -name '*.c' -o -name '*.py' | sort > "${WDIR}/infiles.list"
|
find . -name '*.cpp' -o -name '*.h' -o -name '*.qml' | grep ${PATHS} | sort > ${WDIR}/infiles.list
|
||||||
echo "rc.cpp" >> "${WDIR}/infiles.list"
|
echo "rc.cpp" >> ${WDIR}/infiles.list
|
||||||
|
cd ${WDIR}
|
||||||
cd "${WDIR}"
|
|
||||||
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
|
xgettext --from-code=UTF-8 -C -kde -ci18n -ki18n:1 -ki18nc:1c,2 -ki18np:1,2 -ki18ncp:1c,2,3 -ktr2i18n:1 \
|
||||||
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
|
-kI18N_NOOP:1 -kI18N_NOOP2:1c,2 -kaliasLocale -kki18n:1 -kki18nc:1c,2 -kki18np:1,2 -kki18ncp:1c,2,3 \
|
||||||
--msgid-bugs-address="${BUGADDR}" --language=Python \
|
--msgid-bugs-address="${BUGADDR}" \
|
||||||
--files-from=infiles.list -D "${BASEDIR}" -D "${WDIR}" -o "${PROJECT}.pot" || { echo "error while calling xgettext. aborting."; exit 1; }
|
--files-from=infiles.list -D ${BASEDIR} -D ${WDIR} -o ${PROJECT}.pot || { echo "Error while calling xgettext, aborting."; exit 1; }
|
||||||
echo "Done extracting messages"
|
echo "Done extracting messages"
|
||||||
|
|
||||||
echo "Merging translations"
|
echo "Merging translations"
|
||||||
catalogs=$(find . -name '*.po')
|
catalogs=`find . -name '*.po'`
|
||||||
for cat in $catalogs; do
|
for cat in $catalogs; do
|
||||||
echo $cat
|
echo $cat
|
||||||
msgmerge -o "$cat.new" "$cat" "${PROJECT}.pot"
|
msgmerge -o $cat.new $cat ${PROJECT}.pot
|
||||||
mv "$cat.new" "$cat"
|
mv $cat.new $cat
|
||||||
done
|
done
|
||||||
echo "Done merging translations"
|
echo "Done merging translations"
|
||||||
|
|
||||||
|
|
||||||
echo "Cleaning up"
|
echo "Cleaning up"
|
||||||
cd "${WDIR}"
|
cd ${WDIR}
|
||||||
rm -f rcfiles.list infiles.list rc.cpp
|
rm -f rcfiles.list infiles.list rc.cpp
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user