| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| REGEX=$1 |
| TRANSLATIONS=~/artwork/trunk/Scripts/Bash/Style/Tpl |
| |
| |
| cli_printMessage "`gettext "Select the translation you want to apply:"`" |
| select TRANSLATION in $(ls $TRANSLATIONS);do |
| TRANSLATION=$TRANSLATIONS/$TRANSLATION |
| break |
| done |
| |
| |
| if [ $REGEX == '' ];then |
| cli_printMessage "`gettext "You need to provide a regular expression as first argument."`" |
| exit |
| fi |
| |
| |
| if [ ! -f $TRANSLATION ];then |
| cli_printMessage "`gettext "You need to provide a valid translation file."`" |
| exit |
| fi |
| |
| |
| PATH_KEYWORDS=$(pwd | cut -d/ -f6- | tr '/' '\n') |
| |
| |
| SVG_KEYWORDS=$(\ |
| for KEY in $PATH_KEYWORDS;do |
| echo " <rdf:li>$KEY</rdf:li>\\" |
| done) |
| |
| for FILE in $(find . -regextype posix-egrep -regex $REGEX);do |
| cli_printMessage $FILE "AsUpdatingLine" |
| sed -i -r -f $TRANSLATION $FILE |
| sed -i -r -e /=KEYWORDS=/c\\"$SVG_KEYWORDS" $FILE |
| done \ |
| | awk 'BEGIN {FS=": "} \ |
| { if ( $0 ~ /^-+$/ ) print $0; else \ |
| printf "%s: \t%s\n", $1, $2 }' |