Merge "Simplify translation logic"
This commit is contained in:
commit
a9ca416454
@ -430,8 +430,7 @@ function filter_commits {
|
|||||||
# Don't send files where the only things which have changed are
|
# Don't send files where the only things which have changed are
|
||||||
# the creation date, the version number, the revision date,
|
# the creation date, the version number, the revision date,
|
||||||
# name of last translator, comment lines, or diff file information.
|
# name of last translator, comment lines, or diff file information.
|
||||||
# Also, don't send files if only .pot files would be changed.
|
REAL_CHANGE=0
|
||||||
PO_CHANGE=0
|
|
||||||
# Don't iterate over deleted files
|
# Don't iterate over deleted files
|
||||||
for f in $(git diff --cached --name-only --diff-filter=AM); do
|
for f in $(git diff --cached --name-only --diff-filter=AM); do
|
||||||
# It's ok if the grep fails
|
# It's ok if the grep fails
|
||||||
@ -462,18 +461,16 @@ function filter_commits {
|
|||||||
if [ $changed -eq 0 ]; then
|
if [ $changed -eq 0 ]; then
|
||||||
git reset -q "$f"
|
git reset -q "$f"
|
||||||
git checkout -- "$f"
|
git checkout -- "$f"
|
||||||
# Check for all files ending with ".po".
|
|
||||||
# We will take this import if at least one change adds new content,
|
# We will take this import if at least one change adds new content,
|
||||||
# thus adding a new translation.
|
# thus adding a new translation.
|
||||||
# If only lines are removed, we do not need this.
|
# If only lines are removed, we do not need to generate an import.
|
||||||
elif [[ $added -gt 0 && $f =~ .po$ ]] ; then
|
elif [ $added -gt 0 ] ; then
|
||||||
PO_CHANGE=1
|
REAL_CHANGE=1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# If no po file was changed, only pot source files were changed
|
|
||||||
# and those changes can be ignored as they give no benefit on
|
# If no file has any real change, revert all changes.
|
||||||
# their own.
|
if [ $REAL_CHANGE -eq 0 ] ; then
|
||||||
if [ $PO_CHANGE -eq 0 ] ; then
|
|
||||||
# New files need to be handled differently
|
# New files need to be handled differently
|
||||||
for f in $(git diff --cached --name-only --diff-filter=A) ; do
|
for f in $(git diff --cached --name-only --diff-filter=A) ; do
|
||||||
git reset -q -- "$f"
|
git reset -q -- "$f"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user