2020-10-10 18:00:34 +00:00
|
|
|
#!/bin/sh
|
2020-11-11 13:05:21 +00:00
|
|
|
#########
|
|
|
|
#### Push new translation files to cutter-translations
|
|
|
|
#### so Crowdin can fetch them
|
2020-10-10 18:00:34 +00:00
|
|
|
|
2020-11-11 13:05:21 +00:00
|
|
|
log() {
|
|
|
|
echo "[TRANSLATIONS] $1"
|
|
|
|
}
|
|
|
|
|
|
|
|
log "Script started"
|
2020-10-10 18:00:34 +00:00
|
|
|
|
|
|
|
# Update submodule
|
2020-11-11 13:05:21 +00:00
|
|
|
log "Updating translations..."
|
2020-10-10 18:00:34 +00:00
|
|
|
cd ${TRAVIS_BUILD_DIR}/src
|
|
|
|
git submodule update translations
|
|
|
|
cd translations
|
|
|
|
git pull origin master
|
|
|
|
|
|
|
|
# Generate Crowdin single translation file from cutter_fr.ts
|
2020-11-11 13:05:21 +00:00
|
|
|
log "Generating single translation file"
|
2021-01-10 11:07:39 +00:00
|
|
|
find . -iname "*.ts" | xargs lupdate .. -ts
|
2020-10-10 18:00:34 +00:00
|
|
|
cp ./fr/cutter_fr_FR.ts ./Translations.ts
|
|
|
|
|
|
|
|
# Push it so Crowdin can find new strings, and later push updated translations
|
2020-11-11 13:05:21 +00:00
|
|
|
log "Committing..."
|
2020-10-10 18:00:34 +00:00
|
|
|
git add Translations.ts
|
|
|
|
git commit -m "Updated translations"
|
2020-11-11 13:05:21 +00:00
|
|
|
log "Pushing..."
|
2020-10-10 18:00:34 +00:00
|
|
|
export GIT_SSH_COMMAND="/usr/bin/ssh -i $TRAVIS_BUILD_DIR/scripts/deploy_translations_rsa"
|
2020-12-16 10:59:23 +00:00
|
|
|
git push "git@github.com:rizinorg/cutter-translations.git" HEAD:refs/heads/master
|
2020-11-11 13:05:21 +00:00
|
|
|
|
|
|
|
log "Script done!"
|