1
|
1
|
.update-translation-base:
|
2
|
2
|
stage: update-translations
|
3
|
3
|
rules:
|
4
|
|
- - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push")
|
|
4
|
+ - if: ($TRANSLATION_FILES != "" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push")
|
5
|
5
|
changes:
|
6
|
6
|
- "**/*.ftl"
|
7
|
7
|
- "**/*.properties"
|
... |
... |
@@ -10,17 +10,9 @@ |
10
|
10
|
- "**/update-translations.yml"
|
11
|
11
|
- "**/l10n/combine/combine.py"
|
12
|
12
|
- "**/l10n/combine-translation-versions.py"
|
13
|
|
- - if: $FORCE_UPDATE_TRANSLATIONS == "true"
|
|
13
|
+ - if: ($TRANSLATION_FILES != "" && $FORCE_UPDATE_TRANSLATIONS == "true")
|
14
|
14
|
variables:
|
15
|
|
- TOR_BROWSER_COMBINED_FILES_JSON: "combined-translation-files.json"
|
16
|
|
-
|
17
|
|
-
|
18
|
|
-combine-en-US-translations:
|
19
|
|
- extends: .update-translation-base
|
20
|
|
- needs: []
|
21
|
|
- image: python
|
22
|
|
- variables:
|
23
|
|
- PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
|
15
|
+ COMBINED_FILES_JSON: "combined-translation-files.json"
|
24
|
16
|
TRANSLATION_FILES: '[
|
25
|
17
|
{
|
26
|
18
|
"name": "brand.ftl",
|
... |
... |
@@ -49,13 +41,21 @@ combine-en-US-translations: |
49
|
41
|
}
|
50
|
42
|
]'
|
51
|
43
|
TRANSLATION_INCLUDE_LEGACY: "true"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+combine-en-US-translations:
|
|
47
|
+ extends: .update-translation-base
|
|
48
|
+ needs: []
|
|
49
|
+ image: python
|
|
50
|
+ variables:
|
|
51
|
+ PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
52
|
52
|
cache:
|
53
|
53
|
paths:
|
54
|
54
|
- .cache/pip
|
55
|
55
|
# Artifact is for translation project job
|
56
|
56
|
artifacts:
|
57
|
57
|
paths:
|
58
|
|
- - "$TOR_BROWSER_COMBINED_FILES_JSON"
|
|
58
|
+ - "$COMBINED_FILES_JSON"
|
59
|
59
|
expire_in: "60 min"
|
60
|
60
|
reports:
|
61
|
61
|
dotenv: job_id.env
|
... |
... |
@@ -66,14 +66,14 @@ combine-en-US-translations: |
66
|
66
|
# push-en-US-translations job.
|
67
|
67
|
- echo 'COMBINE_TRANSLATIONS_JOB_ID='"$CI_JOB_ID" >job_id.env
|
68
|
68
|
- pip install compare_locales
|
69
|
|
- - python ./tools/torbrowser/l10n/combine-translation-versions.py "$CI_COMMIT_BRANCH" "$TRANSLATION_FILES" "$TOR_BROWSER_COMBINED_FILES_JSON"
|
|
69
|
+ - python ./tools/base-browser/l10n/combine-translation-versions.py "$CI_COMMIT_BRANCH" "$TRANSLATION_FILES" "$COMBINED_FILES_JSON"
|
70
|
70
|
|
71
|
71
|
push-en-US-translations:
|
72
|
72
|
extends: .update-translation-base
|
73
|
73
|
needs:
|
74
|
74
|
- job: combine-en-US-translations
|
75
|
75
|
variables:
|
76
|
|
- TOR_BROWSER_COMBINED_FILES_JSON_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${COMBINE_TRANSLATIONS_JOB_ID}/artifacts/${TOR_BROWSER_COMBINED_FILES_JSON}"
|
|
76
|
+ COMBINED_FILES_JSON_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/${COMBINE_TRANSLATIONS_JOB_ID}/artifacts/${COMBINED_FILES_JSON}"
|
77
|
77
|
trigger:
|
78
|
78
|
strategy: depend
|
79
|
79
|
project: tor-browser-translation-bot/translation
|