#!/bin/sh # # this script symlinks all cbx po files to thorax' pootle dir # it is useful to be root for this - otherwise chown and the pootle restart will fail # test $# -ne 1 && echo "Usage: $(basename $0) TARGET_DIR" && exit 1 test ! -d "$1" && echo "target directory does not exist: '$1'" && exit 1 TARGETPATH=$1 BASEPATH=$(cd $(dirname "$0")/..; pwd) mkdir -p ${TARGETPATH}/templates for language in `ls ${BASEPATH}/intl/` ; do test ! -d "${BASEPATH}/intl/${language}" && continue echo "Processing $language ..." [ ! -d ${TARGETPATH}/${language} ] && mkdir -p ${TARGETPATH}/${language} ## base translation find ${BASEPATH}/intl/${language} -name \*.po -exec ln -sfn '{}' ${TARGETPATH}/${language}/ \; ## plugin translations for plugin in $(ls ${BASEPATH}/plugins/); do test ! -d "${BASEPATH}/plugins/${plugin}" && continue find ${BASEPATH}/plugins/${plugin}/intl/${language} -name \*.po -exec ln -sfn '{}' ${TARGETPATH}/${language}/ \; done done echo "Processing template files ..." find ${BASEPATH}/intl ${BASEPATH}/plugins -type f -name \*.pot | while read fname do ln -sfn $fname ${TARGETPATH}/templates/ done chown -R pootle. ${TARGETPATH} /etc/init.d/pootle restart