update-translations.yml (3769B)
1 .update-translation-base: 2 stage: update-translations 3 rules: 4 - if: ($TRANSLATION_FILES != "" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push") 5 changes: 6 - "**/*.ftl" 7 - "**/*.properties" 8 - "**/*.dtd" 9 - "**/*strings.xml" 10 - "**/update-translations.yml" 11 - "**/l10n/combine/combine.py" 12 - "**/l10n/combine-translation-versions.py" 13 - if: ($TRANSLATION_FILES != "" && $FORCE_UPDATE_TRANSLATIONS == "true") 14 variables: 15 COMBINED_FILES_JSON: "combined-translation-files.json" 16 TRANSLATION_FILES: '[ 17 { 18 "name": "brand.ftl", 19 "where": ["browser/branding/tb-release", "toolkit/torbutton"], 20 "branding": { 21 "versions": [ 22 { 23 "name": "Alpha", 24 "suffix": "_alpha", 25 "where": ["browser/branding/tb-alpha"] 26 }, 27 { 28 "name": "Nightly", 29 "suffix": "_nightly", 30 "where": ["browser/branding/tb-nightly"] 31 } 32 ], 33 "ids": [ 34 "-brand-short-name", 35 "-brand-full-name" 36 ] 37 }, 38 "branch": "tor-browser", 39 "directory": "branding" 40 }, 41 { 42 "name": "brand.properties", 43 "where": ["browser/branding/tb-release", "toolkit/torbutton"], 44 "branding": { 45 "versions": [ 46 { 47 "name": "Alpha", 48 "suffix": "_alpha", 49 "where": ["browser/branding/tb-alpha"] 50 }, 51 { 52 "name": "Nightly", 53 "suffix": "_nightly", 54 "where": ["browser/branding/tb-nightly"] 55 } 56 ], 57 "ids": [ 58 "brandShortName", 59 "brandFullName" 60 ] 61 }, 62 "branch": "tor-browser" 63 }, 64 { "name": "tor-browser.ftl", "branch": "tor-browser" }, 65 { "name": "aboutTBUpdate.dtd", "branch": "tor-browser" }, 66 { "name": "torbutton.dtd", "branch": "tor-browser" }, 67 { "name": "onionLocation.properties", "branch": "tor-browser" }, 68 { "name": "settings.properties", "branch": "tor-browser" }, 69 { "name": "torbutton.properties", "branch": "tor-browser" }, 70 { "name": "torConnect.properties", "branch": "tor-browser" }, 71 { "name": "torlauncher.properties", "branch": "tor-browser" }, 72 { "name": "base-browser.ftl", "branch": "base-browser" }, 73 { 74 "name": "torbrowser_strings.xml", 75 "branch": "fenix-torbrowserstringsxml", 76 "exclude-legacy": true 77 } 78 ]' 79 TRANSLATION_INCLUDE_LEGACY: "true" 80 81 82 combine-en-US-translations: 83 extends: 84 - .with-local-repo-bash 85 - .update-translation-base 86 needs: [] 87 image: $IMAGE_PATH 88 # Artifact is for translation project job 89 artifacts: 90 paths: 91 - "$COMBINED_FILES_JSON" 92 expire_in: "60 min" 93 reports: 94 dotenv: job_id.env 95 # Don't load artifacts for this job. 96 dependencies: [] 97 tags: 98 # Run these jobs in the browser dedicated runners. 99 - firefox 100 script: 101 # Save this CI_JOB_ID to the dotenv file to be used in the variables for the 102 # push-en-US-translations job. 103 - echo 'COMBINE_TRANSLATIONS_JOB_ID='"$CI_JOB_ID" >job_id.env 104 - ./mach python ./tools/base_browser/l10n/combine-translation-versions.py "$CI_COMMIT_BRANCH" "$TRANSLATION_FILES" "$COMBINED_FILES_JSON" 105 106 push-en-US-translations: 107 extends: .update-translation-base 108 needs: 109 - job: combine-en-US-translations 110 variables: 111 COMBINED_FILES_JSON_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${COMBINE_TRANSLATIONS_JOB_ID}/artifacts/${COMBINED_FILES_JSON}" 112 trigger: 113 strategy: depend 114 project: tor-browser-translation-bot/translation 115 branch: tor-browser-ci