From 1cbbc456783c4ee030e67dbdefe164ba6b19a824 Mon Sep 17 00:00:00 2001 From: xarkes Date: Sat, 10 Oct 2020 20:00:34 +0200 Subject: [PATCH] Automating translations updates (#2218) * Automatically push new strings to cutter-translations --- .travis.yml | 9 ++++--- scripts/deploy_translations.sh | 21 ++++++++++++++++ scripts/deploy_translations_rsa.enc | Bin 0 -> 2608 bytes src/Cutter.pro | 35 ++++++++++++++------------- src/cmake/Translations.cmake | 36 ++++++++++++++-------------- src/translations | 2 +- 6 files changed, 65 insertions(+), 38 deletions(-) create mode 100755 scripts/deploy_translations.sh create mode 100644 scripts/deploy_translations_rsa.enc diff --git a/.travis.yml b/.travis.yml index 3f954a26..2a86a639 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,7 +90,7 @@ matrix: brewfile: scripts/Brewfile update: true # updating brew to get slightly newer meson, 0.54 doesn't work on macOS. - - name: Documentation + Deploy + - name: Documentation + Translations + Deploy os: linux cache: ~ addons: @@ -113,17 +113,19 @@ matrix: before_deploy: - cd "$TRAVIS_BUILD_DIR" - openssl aes-256-cbc -K $encrypted_bd0ed4c1fd75_key -iv $encrypted_bd0ed4c1fd75_iv -in scripts/deploy_docs_rsa.enc -out scripts/deploy_docs_rsa -d + - openssl aes-256-cbc -K $encrypted_df6d16737705c_key -iv $encrypted_df6d16737705c_iv -in scripts/deploy_translations_rsa.enc -out scripts/deploy_translations_rsa -d - chmod 600 scripts/deploy_docs_rsa + - chmod 600 scripts/deploy_translations_rsa - export GIT_SSH_COMMAND="/usr/bin/ssh -i $TRAVIS_BUILD_DIR/scripts/deploy_docs_rsa" - git config --global user.name "Travis CI" - git config --global user.email "travis@travis-ci.com" deploy: skip_cleanup: true provider: script - script: bash scripts/deploy_docs.sh + script: bash -c "./scripts/deploy_docs.sh; ./scripts/deploy_translations.sh" on: repo: radareorg/cutter - branch: master + branch: translate sudo: required @@ -229,6 +231,7 @@ script: fi after_success: + # Do the release - export CUTTER_VERSION=$(python ../scripts/get_version.py) - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then lrelease ../src/Cutter.pro && diff --git a/scripts/deploy_translations.sh b/scripts/deploy_translations.sh new file mode 100755 index 00000000..2ddb7c7c --- /dev/null +++ b/scripts/deploy_translations.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +####################### +#### Push new translation files + +# Update submodule +cd ${TRAVIS_BUILD_DIR}/src +git submodule update translations +cd translations +git pull origin master + +# Generate Crowdin single translation file from cutter_fr.ts +lupdate ../Cutter.pro +cp ./fr/cutter_fr_FR.ts ./Translations.ts + +# Push it so Crowdin can find new strings, and later push updated translations +git add Translations.ts +git commit -m "Updated translations" +export GIT_SSH_COMMAND="/usr/bin/ssh -i $TRAVIS_BUILD_DIR/scripts/deploy_translations_rsa" +echo "Pushing new translation strings..." +git push "git@github.com:radareorg/cutter-translations.git" HEAD:refs/heads/master diff --git a/scripts/deploy_translations_rsa.enc b/scripts/deploy_translations_rsa.enc new file mode 100644 index 0000000000000000000000000000000000000000..979d41d7cd6e519b09428b21c78014ec4bb3df76 GIT binary patch literal 2608 zcmV-03eWYGuFpwB!D^VF_e{qM`xXKMXG^*k>fd%0U`*cpx@dkLEyP0nY&UrR6mLY| z2AM>xtMr;b|Y^sd8H|7)CnpY_-H zGq-4+YX8_;MbypImW$G%lbynLyV$lfxb4G2*%L$ok{n9C?NB0wl4h(le0*^DOU6zQF_2YvP zV|LY_(&{H>A{3XZNc)RylUr8l4VNF)P#AL>w7%0QwWWi+g53M8iN}?BcX6@+2lR-) zz8=^sd$n?bM2eW}@*}Ibx(gJ&SxiAV_>htYjcTb&w>05v4AIZ1{`v`Ci#xp$w zDRp~d0N;lz6iwRHDAgplY)ucG0VpjGS+6Wq$luJhaPf9+8S0e1pX0!lw2dO(lD(U| zTM}2~y*@d-CPyQ>DM~aslAj;ntQQliH-p_stUQWz0C*4HkU4j!|2B%O8 zjMAOy6+3m^M+@Vb&|R?JM{_TISxNo8y5N2LmLPwoqZC-(_d1s0)ioN5X!;a(nLIJM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#1o(|GRo> z)*xE1e$PE{qOPa&Mt7cEvF&_QRGoxOtxG$0x;tog_Z;J+zAXcla zT41uDyQK$ja2G`YxM><}lKqWjmmS+26qVl$l-3V#uX$noR7n2aOn3^}hc;P%pAG^T zU{hhc!j*&0y8Bz+U4T`w&wBg5@zzaB`cnG85N&cqe22Qd%g`^?`TviKkTP;4!FK;* SZ^yrm%!8YGw=z0pKBtA3PaG`( literal 0 HcmV?d00001 diff --git a/src/Cutter.pro b/src/Cutter.pro index a36eed4d..6eb43b3e 100644 --- a/src/Cutter.pro +++ b/src/Cutter.pro @@ -11,22 +11,25 @@ VERSION = $${CUTTER_VERSION_MAJOR}.$${CUTTER_VERSION_MINOR}.$${CUTTER_VERSION_PA # Required QT version lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5") -TRANSLATIONS += translations/cutter_ar.ts \ - translations/cutter_ca.ts \ - translations/cutter_cn.ts \ - translations/cutter_de.ts \ - translations/cutter_es.ts \ - translations/cutter_fa.ts \ - translations/cutter_fr.ts \ - translations/cutter_he.ts \ - translations/cutter_hi.ts \ - translations/cutter_it.ts \ - translations/cutter_ja.ts \ - translations/cutter_nl.ts \ - translations/cutter_pt.ts \ - translations/cutter_ro.ts \ - translations/cutter_ru.ts \ - translations/cutter_tr.ts +TRANSLATIONS += translations/ar/cutter_ar.ts \ + translations/ca/cutter_ca.ts \ + translations/de/cutter_de.ts \ + translations/es-ES/cutter_es.ts \ + translations/fa/cutter_fa.ts \ + translations/fr/cutter_fr.ts \ + translations/he/cutter_he.ts \ + translations/hi/cutter_hi.ts \ + translations/it/cutter_it.ts \ + translations/ja/cutter_ja.ts \ + translations/nl/cutter_nl.ts \ + translations/pt-PT/cutter_pt.ts \ + translations/ro/cutter_ro.ts \ + translations/ru/cutter_ru.ts \ + translations/tr/cutter_tr.ts \ + translations/zh-CN/cutter_zh.ts + +# translations/ko/cutter_ko.ts problems with fonts +# translations/pt-BR/cutter_pt.ts #2321 handling multiple versions of a language # Icon for OS X ICON = img/cutter.icns diff --git a/src/cmake/Translations.cmake b/src/cmake/Translations.cmake index 7749dd8a..9cdd6951 100644 --- a/src/cmake/Translations.cmake +++ b/src/cmake/Translations.cmake @@ -1,23 +1,23 @@ set(TS_FILES - translations/cutter_ar.ts - translations/cutter_ca.ts - translations/cutter_cn.ts - translations/cutter_de.ts - translations/cutter_es.ts - translations/cutter_fa.ts - translations/cutter_fr.ts - translations/cutter_he.ts - translations/cutter_hi.ts - translations/cutter_it.ts - translations/cutter_ja.ts - translations/cutter_nl.ts - translations/cutter_pt.ts - translations/cutter_ro.ts - translations/cutter_ru.ts - translations/cutter_tr.ts + translations/ar/cutter_ar.ts + translations/ca/cutter_ca.ts + translations/de/cutter_de.ts + translations/es-ES/cutter_es.ts + translations/fa/cutter_fa.ts + translations/fr/cutter_fr.ts + translations/he/cutter_he.ts + translations/hi/cutter_hi.ts + translations/it/cutter_it.ts + translations/ja/cutter_ja.ts + translations/nl/cutter_nl.ts + translations/pt-PT/cutter_pt.ts + translations/ro/cutter_ro.ts + translations/ru/cutter_ru.ts + translations/tr/cutter_tr.ts + translations/zh-CN/cutter_zh.ts ) -# translations/cutter_ko.ts problems with fonts -# translations/cutter_pt-BR #2321 handling multiple versions of a language +# translations/ko/cutter_ko.ts problems with fonts +# translations/pt-BR/cutter_pt.ts #2321 handling multiple versions of a language set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/translations) find_package(Qt5LinguistTools REQUIRED) diff --git a/src/translations b/src/translations index 7b0dd067..8e1d24b4 160000 --- a/src/translations +++ b/src/translations @@ -1 +1 @@ -Subproject commit 7b0dd0675ba51e45106a2a188b8c01608953ffdc +Subproject commit 8e1d24b4040474c681d8db39cb75c0ed66bb5bda