github.com/cloudfoundry-attic/cli-with-i18n@v6.32.1-0.20171002233121-7401370d3b85+incompatible/bin/i18n-checkup (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 fixup --source-language-file ${tmpdir}/en.all.json 32 33 go run bin/reformat_translated_json.go i18n/resources