Blame view

sources/apps/documents/src/locale.sh 542 Bytes
d1bafeea1   Kload   [fix] Upgrade to ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  #!/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