Skip to content
This repository
tree: b51ae4df4e
Fetching contributors…

Cannot retrieve contributors at this time

executable file 31 lines (22 sloc) 0.586 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#!/bin/bash

function help
{
  echo "Usage: updateTsFiles.sh <path-to-source>"
}


OPTS="-noobsolete"

ROOT_DIR=$1
if [ -z "${ROOT_DIR}" ]; then
    ROOT_DIR="../"
fi


for f in `find "$ROOT_DIR" -name translate.sh`; do
    DIR=`dirname $f`
    TARGET=`awk -F"=" '/TARGET=/ {print($2)}' $f | sed -e's/\"//g'`
    PROJECT=`awk -F"=" '/PROJECT=/ {print($2)}' $f | sed -e's/\"//g'`
    TS_FILE=${PROJECT}.ts.src

    (cd ${DIR} && \
    cat $TS_FILE > ${TS_FILE}.ts && \
    lupdate $OPTS ${TARGET} -ts ${TS_FILE}.ts && \
    cat $TS_FILE.ts > ${TS_FILE}

    rm $TS_FILE.ts
    )

done
Something went wrong with that request. Please try again.