github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/bin/i18n-extract-strings (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e
     4  
     5  if [[ "$OSTYPE" == "darwin14" ]]; then
     6    tmpdir=/tmp/i18n-checkup-$(uuidgen)
     7    mkdir -p ${tmpdir}
     8  else
     9    tmpdir=$(mktemp -d)
    10  fi
    11  
    12  function cleanup {
    13    rm -rf ${tmpdir}
    14  }
    15  trap cleanup EXIT
    16  
    17  echo -e "\n Updating i18n4go..."
    18  go get -u github.com/XenoPhex/i18n4go/i18n4go
    19  if [ $? -ne 0 ]; then
    20    printf "Failed to run `go get -u github.com/XenoPhex/i18n4go/i18n4go`"
    21    exit 1
    22  fi
    23  
    24  
    25  IGNORE_FILES_REGEX=".*test.go|.*resources.go|fake.*\.go|template.go"
    26  
    27  i18n4go -c extract-strings -e strings/excluded.json -s strings/specialStrings.json -o ${tmpdir} -d command -r --ignore-regexp $IGNORE_FILES_REGEX
    28  i18n4go -c extract-strings -e strings/excluded.json -s strings/specialStrings.json -o ${tmpdir} -d cf -r --ignore-regexp $IGNORE_FILES_REGEX
    29  i18n4go -c merge-strings -d ${tmpdir}
    30  
    31  i18n4go -c create-translations -f ${tmpdir}/en.all.json -languages "de-de,en-us,es-es,fr-fr,it-it,ja-jp,ko-kr,pt-br,zh-hans,zh-hant"
    32  
    33  go run bin/reformat_translated_json.go ./