mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-16 07:09:58 +00:00
edit translations build
translation update
This commit is contained in:
24
sources/translations/extract_messages.sh
Executable file
24
sources/translations/extract_messages.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# root of translatable sources
|
||||
BASEDIR="../"
|
||||
PROJECT="awesome-widgets"
|
||||
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues"
|
||||
WORKDIR=$(pwd)
|
||||
|
||||
find "${BASEDIR}" -name '*.rc' -o -name '*.ui' -o -name '*.kcfg' | sort > "${WORKDIR}/rcfiles.list"
|
||||
xargs --arg-file="${WORKDIR}/rcfiles.list" > "${WORKDIR}/rc.cpp"
|
||||
echo 'i18nc("NAME OF TRANSLATORS","Your names");' >> "${WORKDIR}/rc.cpp"
|
||||
echo 'i18nc("EMAIL OF TRANSLATORS","Your emails");' >> "${WORKDIR}/rc.cpp"
|
||||
|
||||
find "${BASEDIR}" -name '*.cpp' -o -name '*.h' -o -name '*.qml' | sort > "${WORKDIR}/infiles.list"
|
||||
echo "rc.cpp" >> "${WORKDIR}/infiles.list"
|
||||
|
||||
xgettext -C --no-location --msgid-bugs-address="${BUGADDR}" \
|
||||
--files-from="infiles.list" -D "${BASEDIR}" -D "${WORKDIR}" -o "${PROJECT}.pot" || exit 1
|
||||
|
||||
TRANSLATIONS=$(find . -name '*.po')
|
||||
for TR in ${TRANSLATIONS}; do
|
||||
msgmerge -U -q --backup=off "${TR}" "${PROJECT}.pot"
|
||||
done
|
||||
|
||||
rm -f "rcfiles.list" "infiles.list" "rc.cpp"
|
Reference in New Issue
Block a user