Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repo sync #23034

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>