Commit 9587e723 authored by Jarosław Staniek's avatar Jarosław Staniek

avoid mistakes: make is easier to exclude translation for dirs and files

*put a .i18n file with content "foo" for foo.pot into a dir to assign this dir with foo.pot
*put an empty .i18n file to completely exclude the dir
*"append #warning noi18n" line to exclude single file
*only used in kexi/ for now
parent c3091deb
......@@ -53,3 +53,17 @@ function calligra_xgettext() {
rm -f "${POT_PART_NORMAL}" "${POT_PART_QUNDOFORMAT}" "${POT_PART_QUNDOFORMAT2}" "${POT_MERGED}"
}
# Sets EXCLUDE variable to excludes compatible with the find(1) command, e.g. '-path a -o -path b'.
# To unconditionally exclude dir (with subdirs) just put an empty file .i18n in it.
# To exclude dir for all translations but one, e.g. foo.pot, put a single "foo" line into the .i18n file.
function find_exclude() {
EXCLUDE=""
for f in `find . -name .i18n | sed 's/\/\.i18n$//g' | sort`; do
if ! grep -q "^${1}$" "$f/.i18n" ; then
if [ -n "$EXCLUDE" ] ; then EXCLUDE="$EXCLUDE -o " ; fi
EXCLUDE="$EXCLUDE -path $f"
fi
done
if [ -z "$EXCLUDE" ] ; then EXCLUDE="-path __dummy__" ; fi # needed because -prune in find needs args
}
......@@ -6,3 +6,4 @@ LIST=`find . \( \( $EXCLUDE \) -prune -o -name \*.ui -o -name \*.rc \) -type f |
$EXTRACTRC $LIST >> rc.cpp
LIST=`find . \( \( $EXCLUDE \) -prune -o -name \*.cpp -o -name \*.cc -o -name \*.h \) -type f | grep -v '/tests/' | grep -v -e '/\.'`
calligra_xgettext $LIST > $podir/calligra.pot
rm -f rc.cpp
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