Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d1f0f1

Browse files
authored
Translation report workflow (#33768)
1 parent fe9bf38 commit 3d1f0f1

2 files changed

Lines changed: 62 additions & 21 deletions

File tree

.github/workflows/translation-health-report.yml

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,56 +16,50 @@ jobs:
1616
create-translation-health-report:
1717
name: Create translation health report
1818
if: github.repository == 'github/docs-internal'
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-20.04-xl
2020
# This sets a maximum execution time of 300 minutes (5 hours)
2121
# to prevent the workflow from running longer than necessary.
2222
timeout-minutes: 300
2323
strategy:
2424
fail-fast: false
25-
max-parallel: 1
2625
matrix:
2726
include:
2827
- language: es
29-
language_dir: translations/es-ES
28+
language_dir: translations/es-es
3029
language_repo: github/docs-internal.es-es
3130

3231
- language: ja
33-
language_dir: translations/ja-JP
32+
language_dir: translations/ja-jp
3433
language_repo: github/docs-internal.ja-jp
3534

3635
- language: pt
37-
language_dir: translations/pt-BR
36+
language_dir: translations/pt-br
3837
language_repo: github/docs-internal.pt-br
3938

4039
- language: zh
41-
language_dir: translations/zh-CN
40+
language_dir: translations/zh-cn
4241
language_repo: github/docs-internal.zh-cn
4342

4443
- language: ru
45-
language_dir: translations/ru-RU
44+
language_dir: translations/ru-ru
4645
language_repo: github/docs-internal.ru-ru
4746

4847
- language: ko
49-
language_dir: translations/ko-KR
48+
language_dir: translations/ko-kr
5049
language_repo: github/docs-internal.ko-kr
5150

5251
- language: fr
53-
language_dir: translations/fr-FR
52+
language_dir: translations/fr-fr
5453
language_repo: github/docs-internal.fr-fr
5554

5655
- language: de
57-
language_dir: translations/de-DE
56+
language_dir: translations/de-de
5857
language_repo: github/docs-internal.de-de
5958

6059
steps:
6160
- name: Checkout the docs-internal repo
6261
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
6362

64-
- name: Remove all language translations
65-
run: |
66-
git rm -rf --quiet ${{ matrix.language_dir }}/content
67-
git rm -rf --quiet ${{ matrix.language_dir }}/data
68-
6963
- name: Checkout the language-specific repo
7064
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
7165
with:
@@ -91,25 +85,42 @@ jobs:
9185
node script/i18n/create-translation-health-report.js \
9286
--language ${{ matrix.language }} \
9387
--gitref ${{ env.gitref }} \
94-
>> $HOME/translation-health-report.json
88+
>> $GITHUB_WORKSPACE/translation-health-report.json
89+
90+
- name: View report in workflow
91+
run: cat $GITHUB_WORKSPACE/translation-health-report.json
9592

9693
- name: Log in to Azure
9794
uses: azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
9895
with:
9996
creds: ${{ secrets.PROD_AZURE_CREDENTIALS }}
10097

101-
- name: Upload to Azure blob storage
98+
# https://learn.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az-storage-blob-upload
99+
# https://github.com/marketplace/actions/azure-cli-action
100+
- name: Upload latest to Azure blob storage
102101
uses: azure/CLI@61bb69d64d613b52663984bf12d6bac8fd7b3cc8
103102
with:
104103
inlineScript: |
105104
az storage blob upload \
106105
--name "${{ matrix.language }}-latest.json" \
107-
--file $HOME/translation-health-report.json \
108-
--container-name translation-health-reports
106+
--file $GITHUB_WORKSPACE/translation-health-report.json \
107+
--account-name githubdocs \
108+
--account-key ${{ secrets.AZURE_GITHUBDOCS_STORAGE_KEY }} \
109+
--container-name translation-health-reports \
110+
--overwrite true
111+
112+
- name: Upload date formatted to Azure blob storage
113+
uses: azure/CLI@61bb69d64d613b52663984bf12d6bac8fd7b3cc8
114+
with:
115+
inlineScript: |
116+
# Write a date formatted for historical reference
109117
az storage blob upload \
110118
--name "${{ matrix.language }}-$(date +%Y-%m-%d).json" \
111-
--file $HOME/translation-health-report.json \
112-
--container-name translation-health-reports
119+
--file $GITHUB_WORKSPACE/translation-health-report.json \
120+
--account-name githubdocs \
121+
--account-key ${{ secrets.AZURE_GITHUBDOCS_STORAGE_KEY }} \
122+
--container-name translation-health-reports \
123+
--overwrite true
113124
114125
- name: Log out from Azure
115126
if: always()

contributing/translations/for-translators.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Translation guide for translators
22

33
## Translated files
4+
45
We only translate:
56
- all files `/content`
67
- `/data/release-notes`
@@ -10,10 +11,39 @@ We only translate:
1011
- `/data/product-examples`
1112

1213
## Translation guidelines
14+
1315
We do not accept translation changes from open source contributors.
1416

1517
- [ ] Lint all `*.yml` files before submitting to make sure they are valid YAML format.
1618
- [ ] Lint all frontmatter (between the triple dashes at the top of all `/content` files) to make sure they are valid YAML format.
1719
- [ ] Do not translate anything inside of Liquid tags, such as `{% data %}` or `{% ifversion ... %}`, `{% note %}` or `{{ someVariable }}`.
1820
- [ ] Be sure to translate the frontmatter properties `title`, `shortTitle`, `intro`, `permissions` but leave all other keys in each content `.md` file
1921
- [ ] For every `{% ifversion ... %}` there's a `{% endif %}` following it
22+
23+
## Error diagnosis
24+
25+
We provide error reports that we upload daily.
26+
27+
<details>
28+
<summary>Report locations</summary>
29+
30+
We have both "latest" or date in 'yyyy-mm-dd' format for historical reference.
31+
32+
- https://githubdocs.blob.core.windows.net/translation-health-reports/es-latest.json
33+
- https://githubdocs.blob.core.windows.net/translation-health-reports/es-2023-01-05.json
34+
- https://githubdocs.blob.core.windows.net/translation-health-reports/ja-latest.json
35+
- https://githubdocs.blob.core.windows.net/translation-health-reports/ja-2023-01-05.json
36+
- https://githubdocs.blob.core.windows.net/translation-health-reports/pt-latest.json
37+
- https://githubdocs.blob.core.windows.net/translation-health-reports/pt-2023-01-05.json
38+
- https://githubdocs.blob.core.windows.net/translation-health-reports/zh-latest.json
39+
- https://githubdocs.blob.core.windows.net/translation-health-reports/zh-2023-01-05.json
40+
- https://githubdocs.blob.core.windows.net/translation-health-reports/ru-latest.json
41+
- https://githubdocs.blob.core.windows.net/translation-health-reports/ru-2023-01-05.json
42+
- https://githubdocs.blob.core.windows.net/translation-health-reports/ko-latest.json
43+
- https://githubdocs.blob.core.windows.net/translation-health-reports/ko-2023-01-05.json
44+
- https://githubdocs.blob.core.windows.net/translation-health-reports/fr-latest.json
45+
- https://githubdocs.blob.core.windows.net/translation-health-reports/fr-2023-01-05.json
46+
- https://githubdocs.blob.core.windows.net/translation-health-reports/de-latest.json
47+
- https://githubdocs.blob.core.windows.net/translation-health-reports/de-2023-01-05.json
48+
49+
</details>

0 commit comments

Comments
 (0)