Skip to content

Commit

Permalink
Merge pull request #23034 from github/repo-sync
Browse files Browse the repository at this point in the history
repo sync
  • Loading branch information
Octomerger authored Jan 6, 2023
2 parents 83bf1eb + 3d1f0f1 commit 8fc196e
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 21 deletions.
53 changes: 32 additions & 21 deletions .github/workflows/translation-health-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,50 @@ jobs:
create-translation-health-report:
name: Create translation health report
if: github.repository == 'github/docs-internal'
runs-on: ubuntu-latest
runs-on: ubuntu-20.04-xl
# This sets a maximum execution time of 300 minutes (5 hours)
# to prevent the workflow from running longer than necessary.
timeout-minutes: 300
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- language: es
language_dir: translations/es-ES
language_dir: translations/es-es
language_repo: github/docs-internal.es-es

- language: ja
language_dir: translations/ja-JP
language_dir: translations/ja-jp
language_repo: github/docs-internal.ja-jp

- language: pt
language_dir: translations/pt-BR
language_dir: translations/pt-br
language_repo: github/docs-internal.pt-br

- language: zh
language_dir: translations/zh-CN
language_dir: translations/zh-cn
language_repo: github/docs-internal.zh-cn

- language: ru
language_dir: translations/ru-RU
language_dir: translations/ru-ru
language_repo: github/docs-internal.ru-ru

- language: ko
language_dir: translations/ko-KR
language_dir: translations/ko-kr
language_repo: github/docs-internal.ko-kr

- language: fr
language_dir: translations/fr-FR
language_dir: translations/fr-fr
language_repo: github/docs-internal.fr-fr

- language: de
language_dir: translations/de-DE
language_dir: translations/de-de
language_repo: github/docs-internal.de-de

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

- name: Remove all language translations
run: |
git rm -rf --quiet ${{ matrix.language_dir }}/content
git rm -rf --quiet ${{ matrix.language_dir }}/data
- name: Checkout the language-specific repo
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
Expand All @@ -91,25 +85,42 @@ jobs:
node script/i18n/create-translation-health-report.js \
--language ${{ matrix.language }} \
--gitref ${{ env.gitref }} \
>> $HOME/translation-health-report.json
>> $GITHUB_WORKSPACE/translation-health-report.json
- name: View report in workflow
run: cat $GITHUB_WORKSPACE/translation-health-report.json

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

- name: Upload to Azure blob storage
# https://learn.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az-storage-blob-upload
# https://github.com/marketplace/actions/azure-cli-action
- name: Upload latest to Azure blob storage
uses: azure/CLI@61bb69d64d613b52663984bf12d6bac8fd7b3cc8
with:
inlineScript: |
az storage blob upload \
--name "${{ matrix.language }}-latest.json" \
--file $HOME/translation-health-report.json \
--container-name translation-health-reports
--file $GITHUB_WORKSPACE/translation-health-report.json \
--account-name githubdocs \
--account-key ${{ secrets.AZURE_GITHUBDOCS_STORAGE_KEY }} \
--container-name translation-health-reports \
--overwrite true
- name: Upload date formatted to Azure blob storage
uses: azure/CLI@61bb69d64d613b52663984bf12d6bac8fd7b3cc8
with:
inlineScript: |
# Write a date formatted for historical reference
az storage blob upload \
--name "${{ matrix.language }}-$(date +%Y-%m-%d).json" \
--file $HOME/translation-health-report.json \
--container-name translation-health-reports
--file $GITHUB_WORKSPACE/translation-health-report.json \
--account-name githubdocs \
--account-key ${{ secrets.AZURE_GITHUBDOCS_STORAGE_KEY }} \
--container-name translation-health-reports \
--overwrite true
- name: Log out from Azure
if: always()
Expand Down
30 changes: 30 additions & 0 deletions contributing/translations/for-translators.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Translation guide for translators

## Translated files

We only translate:
- all files `/content`
- `/data/release-notes`
Expand All @@ -10,10 +11,39 @@ We only translate:
- `/data/product-examples`

## Translation guidelines

We do not accept translation changes from open source contributors.

- [ ] Lint all `*.yml` files before submitting to make sure they are valid YAML format.
- [ ] Lint all frontmatter (between the triple dashes at the top of all `/content` files) to make sure they are valid YAML format.
- [ ] Do not translate anything inside of Liquid tags, such as `{% data %}` or `{% ifversion ... %}`, `{% note %}` or `{{ someVariable }}`.
- [ ] Be sure to translate the frontmatter properties `title`, `shortTitle`, `intro`, `permissions` but leave all other keys in each content `.md` file
- [ ] For every `{% ifversion ... %}` there's a `{% endif %}` following it

## Error diagnosis

We provide error reports that we upload daily.

<details>
<summary>Report locations</summary>

We have both "latest" or date in 'yyyy-mm-dd' format for historical reference.

- https://githubdocs.blob.core.windows.net/translation-health-reports/es-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/es-2023-01-05.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/ja-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/ja-2023-01-05.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/pt-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/pt-2023-01-05.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/zh-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/zh-2023-01-05.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/ru-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/ru-2023-01-05.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/ko-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/ko-2023-01-05.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/fr-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/fr-2023-01-05.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/de-latest.json
- https://githubdocs.blob.core.windows.net/translation-health-reports/de-2023-01-05.json

</details>

0 comments on commit 8fc196e

Please sign in to comment.