diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2013-11-14 04:50:02 +0400 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2013-11-14 04:50:02 +0400 |
commit | b7e79595ef9d11e9b784a72f5fcd894443400d21 (patch) | |
tree | c310ef9f2f669546a3ad1f72d7916d829bb9c2aa /src | |
parent | c2dbf80d0fe0e83b303ee3bbdd93b7b324281d7d (diff) |
Sort and deduplicate results, ref #14
Diffstat (limited to 'src')
-rwxr-xr-x | src/locale.sh | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/locale.sh b/src/locale.sh index 3e984017..1a5dbd93 100755 --- a/src/locale.sh +++ b/src/locale.sh @@ -1,9 +1,18 @@ #!/bin/bash #extracts strings for translation -JS_PATH=../js/ -WEBODF_PATH=../js/3rdparty/webodf/ -grep -ohEr "tr\([\"|'][^\"|']*[\"|']\)" ${WEBODF_PATH} | sed -e "s/^tr(/t('documents',\ /" -e "s/\$/;/" > ${JS_PATH}locale.js +if [ ! -e "README.md" ]; then + echo "Call me in the toplevel dir of OwnCloud Documents." + exit 1 +fi -grep -ohEr "text-i18n=[\"|'][^\"|']*[\"|']" ${WEBODF_PATH} | sed -e "s/^text-i18n=/t('documents',\ /" -e "s/\$/);/" >> ${JS_PATH}locale.js +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
\ No newline at end of file |