mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 22:59:57 +00:00
Small fixes
* update translations, add target to update translations * add custom keys support to config helper
This commit is contained in:
@ -1,27 +1,31 @@
|
||||
#!/bin/bash
|
||||
# root of translatable sources
|
||||
BASEDIR="../"
|
||||
|
||||
# properties
|
||||
PROJECT="awesome-widgets"
|
||||
BUGADDR="https://github.com/arcan1s/awesome-widgets/issues"
|
||||
WORKDIR=$(pwd)
|
||||
|
||||
# root of translatable sources
|
||||
SCRIPTDIR="$(dirname -- $(readlink -f -- $0))"
|
||||
BASEDIR="${SCRIPTDIR}/../"
|
||||
WORKDIR="$(pwd)"
|
||||
|
||||
# translations tags
|
||||
# dunno what does this magic do actually
|
||||
TAGS="-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"
|
||||
|
||||
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"
|
||||
find "${BASEDIR}" \
|
||||
-name '*.cpp' -o -name '*.h' -o -name '*.qml' -o -name '*.ui' -o -name '*.rc' | \
|
||||
sort > "${WORKDIR}/infiles.list"
|
||||
|
||||
xgettext -C --no-location --msgid-bugs-address="${BUGADDR}" ${TAGS} \
|
||||
--files-from="infiles.list" -D "${BASEDIR}" -D "${WORKDIR}" -o "${PROJECT}.pot" || exit 1
|
||||
--files-from="${WORKDIR}/infiles.list" -D "${BASEDIR}" -D "${WORKDIR}" \
|
||||
-o "${PROJECT}.pot" || exit 1
|
||||
|
||||
TRANSLATIONS=$(find . -name '*.po')
|
||||
TRANSLATIONS=$(find "${BASEDIR}" -name '*.po')
|
||||
for TR in ${TRANSLATIONS}; do
|
||||
msgmerge -U -q --backup=off "${TR}" "${PROJECT}.pot"
|
||||
msgmerge -U -q --backup=off "${TR}" "${WORKDIR}/${PROJECT}.pot"
|
||||
msgattrib --no-obsolete -o "${TR}" "${TR}"
|
||||
done
|
||||
|
||||
rm -f "rcfiles.list" "infiles.list" "rc.cpp"
|
||||
rm -f "${WORKDIR}/infiles.list"
|
||||
|
Reference in New Issue
Block a user