You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
richdocuments/src/locale.sh

18 lines
542 B
Bash

#!/bin/bash
#extracts strings for translation
if [ ! -e "README.md" ]; then
echo "Call me in the toplevel dir of OwnCloud Documents."
exit 1
fi
JS_PATH=js/
WEBODF_PATH=js/3rdparty/webodf/
TMP=/tmp/documents-locale.js
grep -ohEr "tr\([\"|'][^\"|']*[\"|']\)" ${WEBODF_PATH} | sed -e "s/\"/'/g" -e "s/^tr(/t('documents',\ /" -e "s/\$/;/" > ${TMP}
grep -ohEr "text-i18n=[\"|'][^\"|']*[\"|']" ${WEBODF_PATH} | sed -e "s/\"/'/g" -e "s/^text-i18n=/t('documents',\ /" -e "s/\$/);/" >> ${TMP}
sort ${TMP} | uniq > ${JS_PATH}locale.js