Index: trunk/l10n-support/ca/scripts/doc-tr_krita-images.sh =================================================================== --- trunk/l10n-support/ca/scripts/doc-tr_krita-images.sh (nonexistent) +++ trunk/l10n-support/ca/scripts/doc-tr_krita-images.sh (revision 1541145) @@ -0,0 +1,80 @@ +#!/bin/bash +# +# The goal is parse screenshots date changes in Krita tranlations. + +export LANG='C' + +exit_output() { + echo -e "$(basename $0) [--help] + + Parameters: + * Your language code. + --help * Show this help message. + + Functions: + - Analyze screenshots time and report old or godd status. + - Detects screenshots that no longer have their source pair. + + Example for Catalan language: + $ $(basename $0) ca" + exit $1 +} + +case $OPT in + --help) + exit_output + ;; +esac + +cd images +LANGCODE="$1" + +if [ ! -d $LANGCODE ]; then + echo -e "Error: The \"$1\" language does not exist into \"images\" folder\n" + exit_output +fi + +TR_DIRS=$(find * -type d -name $LANGCODE) + +take_git_time() { git log -1 --date=format:%Y%m%d%H%M%S -- $1 | grep "^Date:" | awk '{print $2}'; } +echo -e " ## Krita screenshots ##\n $(printf "%0.s#" {1..23})\n" +echo -e " Screenshot name\t\t\t\t Source date TR date" + +for tr_dir in $TR_DIRS + do + TR_IMAGES=$(find $tr_dir -type f -regex '.*\.\(jpg\|jpeg\|png\|svg\)') + for tr_image in $TR_IMAGES + do + SR_IMAGE=$(echo $tr_image | sed -e 's/ca\///') + if [ -f $SR_IMAGE ]; then + SR_TIME=$(take_git_time $SR_IMAGE) + TR_TIME=$(take_git_time $tr_image) + if [ $TR_TIME ]; then + if [ $TR_TIME -gt $SR_TIME ]; then + TR_TIME=$(echo "$TR_TIME" | cut -b 1-8) + TR_TIME="\e[0;32m$TR_TIME\e[0m" + else + TR_TIME=$(echo "$TR_TIME" | cut -b 1-8) + TR_TIME="\e[0;31m$TR_TIME\e[0m" + fi + SR_TIME=$(echo "$SR_TIME" | cut -b 1-8) + fi + echo -e " |$(printf "%0.s-" {1..50})|---------------|---------------|" + printf "%-63s %-15s %-26s %0s \n" " - $(echo -e "\e[0;36m$SR_IMAGE\e[0m")" "| $SR_TIME" "| $(echo -e $TR_TIME)" "|" + else + NOTEXSIST="$NOTEXSIST \e[1;31m$tr_image\e[0m" + fi + done + done + +echo -e " |----------------------------------------------------------------------------------|\n" + +if [ -n "$NOTEXSIST" ]; then + echo -e " These screenshot/s no longer exist! Remove it (or rename)" + echo -e " |----------------------------------------------------------------------------------|" + printf "%-85s" " - $(echo -e "$NOTEXSIST" | sed -e 's/ /, /g' -e 's/^, //g')." + echo -e "\n |----------------------------------------------------------------------------------|\n" + NOTEXSIST= +fi + +exit 0 Property changes on: trunk/l10n-support/ca/scripts/doc-tr_krita-images.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property