fsfe-website/tools/find-outdated-translations

24 righe
735 B
Bash
Executable File

#!/usr/bin/env bash
# Find outdated translations for the given file.
# File must have extension ".??.xhtml". All files with the same
# basename and the same extension pattern that are newer than the
# given one, according to git commit date, are returned.
filename=$1
bn=${filename%.??.xhtml}
siblings=`ls ${bn}.??.xhtml`
translations=${siblings/${filename}}
if [ ! -z "$translations" ]; then
outdated="${translations}"
ct=`git log -1 --format="%ct" "$filename"`
updatedfiles=`git log --since=$ct --format="%ct" --name-only "${bn}.??.xhtml" | grep xhtml | sort -u`
if [ ! -z "$updatedfiles" ]; then
for u in ${updatedfiles}; do
outdated=${outdated/*$u}
done
fi
echo $outdated
fi