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 00000000..979d41d7 Binary files /dev/null and b/scripts/deploy_translations_rsa.enc differ 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