github.com/jasonkeene/cli@v6.14.1-0.20160816203908-ca5715166dfb+incompatible/bin/i18n-checkup (about)

     1  #!/bin/bash
     2  
     3  set +e
     4  
     5  export PATH=$PATH:$GOPATH/bin
     6  ROOT_DIR=$(cd $(dirname $(dirname $0)) && pwd)
     7  
     8  function killed {
     9    exit 1
    10  }
    11  trap killed SIGINT
    12  
    13  echo -e "\n Updating translation files"
    14  
    15  if [ ! $(which goi18n) ];then
    16    echo -e "\n Installing go-i18n..."
    17    go get github.com/nicksnyder/go-i18n/goi18n
    18  fi
    19  
    20  echo -e "\n Updating i18n4go..."
    21  go get -u github.com/krishicks/i18n4go/i18n4go
    22  if [ $? -ne 0 ]; then
    23    printf "Failed to run `go get -u github.com/krishicks/i18n4go/i18n4go`"
    24    exit 1
    25  fi
    26  
    27  i18n4go -c fixup
    28  if [ $? -ne 0 ]; then
    29    printf "Failed to run `i18n4go -c fixup`"
    30    exit 1
    31  fi
    32  
    33  goi18n -outdir cf/i18n/resources cf/i18n/resources/*.all.json
    34  if [ $? -ne 0 ]; then
    35    printf "Failed to run `goi18n -outdir cf/i18n/resources cf/i18n/resources/*.all.json`"
    36    exit 1
    37  fi
    38  
    39  if [[ $(git status --porcelain cf/i18n/resources) ]]; then
    40    bin/generate-language-resources
    41    if [ $? -ne 0 ]; then
    42      printf "Failed to run `bin/generate-language-resources`"
    43      exit 1
    44    fi
    45  fi