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 #606

Merged
merged 5 commits into from
Oct 16, 2020
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
10 changes: 5 additions & 5 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Please ping @github/docs-localization in the PR whenever you update this file!

name: Crowdin Sync

on:
Expand All @@ -25,18 +23,20 @@ jobs:

# Using a custom config temporarily to avoid clobbering the existing crowdin.yml
# that is used by the github-help-docs OAuth integration.
config: 'crowdin-actions-config.yml'
config: 'crowdin.yml'

# This is the name of the git branch that Crowdin will create when opening a pull request.
# This branch does NOT need to be manually created. It will be created automatically by the action.
localization_branch_name: automated-crowdin-translations
localization_branch_name: translations

# This is the name of the top-level directory that Crowdin will use for files.
# Note that this is not a "branch" in the git sense, but more like a top-level directory in your Crowdin project.
# This branch does NOT need to be manually created. It will be created automatically by the action.
crowdin_branch_name: crowdin-main
crowdin_branch_name: main

env:
# Using an @octoglot token instead of the default Actions-provided GITHUB_TOKEN here
# so that subsequent workflows will be able to run on the pull request created by this workflow.
GITHUB_TOKEN: ${{ secrets.OCTOGLOT_PAT_WITH_REPO_AND_WORKFLOW_SCOPE }}

# This is a numeric id, not to be confused with Crowdin API v1 "project identifier" string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ For urgent issues, we can help you in English 24 hours per day, 7 days per week,

{% data variables.contact.enterprise_support %} observes these U.S. holidays, although our global support team is available to answer urgent tickets.

| U.S. holiday | Date observed in {{ "now" | date: "%Y" }} |
| U.S. holiday | Date observed |
| --- | --- |
| New Year's Day | January 1 |
| Martin Luther King, Jr. Day | Third Monday in January |
Expand Down
25 changes: 0 additions & 25 deletions crowdin-actions-config.yml

This file was deleted.

7 changes: 7 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ files:
"data/graphql",
"data/products.yml"
]

# These end up as env vars used by the GitHub Actions workflow
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN

# https://support.crowdin.com/configuration-file-v3/#saving-directory-structure-on-server
preserve_hierarchy: true
44 changes: 32 additions & 12 deletions script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ Runs tests. Equivalent of `npm test`.

## Additional scripts

### [`anonymize-branch.js`](anonymize-branch.js)

Flatten all the commits in the current branch into a single anonymized @Octomerger commit

Usage: script/anonymize-branch.js <new-commit-message> [base-branch] Example: script/anonymize-branch.js "nothing to see here" If the optional [base-branch] argument is omitted, it will default to `main`

---


### [`archive-enterprise-version.js`](archive-enterprise-version.js)

Run this script during the Enterprise deprecation process to download static copies of all pages for the oldest supported Enterprise version. See the Enterprise deprecation issue template for instructions.
Expand Down Expand Up @@ -270,6 +279,19 @@ Usage $ script/new-versioning/main
---


### [`new-versioning/update-not-fpt-conditionals.js`](new-versioning/update-not-fpt-conditionals.js)

Run this script to update these Liquid conditionals:

{% if currentVersion != 'free-pro-team@latest' %}

to:

{% if enterpriseServerVersions contains currentVersion %}

---


### [`new-versioning/update-products-yml.js`](new-versioning/update-products-yml.js)


Expand Down Expand Up @@ -307,15 +329,7 @@ This script is run as a git precommit hook (installed by husky after npm install

### [`preview-openapi-changes`](preview-openapi-changes)

This script stitches and unstitches the `github/github` OpenAPI description via `rest-api-operations` to produce a local preview in docs-internal.

`github`, `rest-api-operations`, and `docs-internal` must share a parent directory locally.

You must bootstrap `github` for this script to work. To check if you need to bootstrap, check if the `bin` directory in `github` exists locally. If it does not exist, run `./script/bootstrap` from the `github` directory.

To stitch the repos together and do an npm build, pass the `stitch` argument.

To unstitch the repos and revert them to their pre-stitched state, pass the `unstitch` argument.

---

Expand Down Expand Up @@ -379,13 +393,19 @@ Run this script to remove reusables and image files that exist in the repo but a

This is a convenience script for replacing the contents of translated files with the English content from their corresponding source file.

It's intended to be a workaround to temporarily bypass Crowdin parser bugs while we wait for Crowdin to fix them.
It's intended to be a workaround to temporarily bypass Crowdin parser bugs while we wait for translators to fix them.

Usage: script/reset-translated-file.js <filename>

Examples:

reset a single translated file using a relative path: $ script/reset-translated-file.js translations/es-XL/content/actions/index.md

Usage: script/reset-translated-File.js <relative-filename> [<two-letter-language-code>]
reset a single translated file using a full path: $ script/reset-translated-file.js /Users/z/git/github/docs-internal/translations/es-XL/content/actions/index.md

script/reset-translated-File.js content/desktop/foo.md -> resets all translations of foo.md
reset all language variants of a single English file (using a relative path): $ script/reset-translated-file.js content/actions/index.md $ script/reset-translated-file.js data/ui.yml

script/reset-translated-File.js content/desktop/foo.md de -> resets german translation of foo.md
reset all language variants of a single English file (using a full path): $ script/reset-translated-file.js /Users/z/git/github/docs-internal/content/desktop/index.md $ script/reset-translated-file.js /Users/z/git/github/docs-internal/data/ui.yml

---

Expand Down
37 changes: 29 additions & 8 deletions script/reset-translated-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,26 @@
// files with the English content from their corresponding source file.
//
// It's intended to be a workaround to temporarily bypass Crowdin parser bugs
// while we wait for Crowdin to fix them.
// while we wait for translators to fix them.
//
// Usage:
// script/reset-translated-File.js <relative-filename> [<two-letter-language-code>]
// script/reset-translated-file.js <filename>
//
// script/reset-translated-File.js content/desktop/foo.md
// -> resets all translations of foo.md
// Examples:
//
// script/reset-translated-File.js content/desktop/foo.md de
// -> resets german translation of foo.md
// reset a single translated file using a relative path:
// $ script/reset-translated-file.js translations/es-XL/content/actions/index.md
//
// reset a single translated file using a full path:
// $ script/reset-translated-file.js /Users/z/git/github/docs-internal/translations/es-XL/content/actions/index.md
//
// reset all language variants of a single English file (using a relative path):
// $ script/reset-translated-file.js content/actions/index.md
// $ script/reset-translated-file.js data/ui.yml
//
// reset all language variants of a single English file (using a full path):
// $ script/reset-translated-file.js /Users/z/git/github/docs-internal/content/desktop/index.md
// $ script/reset-translated-file.js /Users/z/git/github/docs-internal/data/ui.yml
//
// [end-readme]

Expand All @@ -25,8 +34,20 @@ const fs = require('fs')
const path = require('path')
const languages = require('../lib/languages')

const [relativePath, languageCode] = process.argv.slice(2)
assert(relativePath, 'first arg must be a target filename')
const [pathArg] = process.argv.slice(2)
assert(pathArg, 'first arg must be a target filename')
let languageCode

// Is the arg a fully-qualified path?
let relativePath = fs.existsSync(pathArg)
? path.relative(process.cwd(), pathArg)
: pathArg

// extract relative path and language code if pathArg is in the format `translations/<lang>/path/to/file`
if (relativePath.startsWith('translations/')) {
languageCode = Object.values(languages).find(language => relativePath.startsWith(language.dir) && language.code !== 'en').code
relativePath = relativePath.split(path.sep).slice(2).join(path.sep)
}

const englishFile = path.join(process.cwd(), relativePath)
assert(fs.existsSync(englishFile), `file does not exist: ${englishFile}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ For urgent issues, we can help you in English 24 hours per day, 7 days per week,

{% data variables.contact.enterprise_support %} beobachtet diese Feiertage in den USA. dessen ungeachtet steht unser Support-Team zur Verfügung, um dringende Tickets zu beantworten.

| U.S. Weihnachtsfeiertag | Beobachtetes Datum | Datum in {{ "now:%Y" }} |
| ----------------------- | ------------------------------ | ----------------------- |
| Neujahr | 1. Januar | |
| Martin Luther King Day | Dritter Montag im Januar | |
| Presidents' Day | Dritter Montag im Februar | |
| Memorial Day | Letzter Montag im Mai | |
| Independence Day | 4. Juli | |
| Labor Day | Erster Montag im September | |
| Veterans Day | 12. November | |
| Thanksgiving | Vierter Donnerstag im November | |
| Tag nach Thanksgiving | Vierter Freitag im November | |
| Heiligabend | 24. Dezember | |
| 1. Weihnachtsfeiertag | 25. Dezember | |
| 2. Weihnachtsfeiertag | 26. Dezember | |
| Silvester | 31. Dezember | |
| U.S. Weihnachtsfeiertag | Beobachtetes Datum |
| ----------------------- | ------------------------------ |
| Neujahr | 1. Januar |
| Martin Luther King Day | Dritter Montag im Januar |
| Presidents' Day | Dritter Montag im Februar |
| Memorial Day | Letzter Montag im Mai |
| Independence Day | 4. Juli |
| Labor Day | Erster Montag im September |
| Veterans Day | 12. November |
| Thanksgiving | Vierter Donnerstag im November |
| Tag nach Thanksgiving | Vierter Freitag im November |
| Heiligabend | 24. Dezember |
| 1. Weihnachtsfeiertag | 25. Dezember |
| 2. Weihnachtsfeiertag | 26. Dezember |
| Silvester | 31. Dezember |

#### Feiertage in Japan

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ For urgent issues, we can help you in English 24 hours per day, 7 days per week,

{% data variables.contact.enterprise_support %} observa estos días festivos en Estados Unidos. {% data variables.contact.enterprise_support %} respeta estos días feriados en los EE.UU, aunque nuestro equipo de soporte global se encuentra disponible para atender tickets urgentes.

| U.S. holiday | Festejado en {{ "now" | date: "%Y" }} |
| --------------------------------- | --------------------------- | ------------- |
| Año Nuevo | 1 de enero | |
| Día de Martin Luther King, Jr. | Tercer lunes de enero | |
| Día de los Presidentes | Tercer lunes de febrero | |
| Día de los Caídos | Último lunes de mayo | |
| Día de la Independencia | 4 de julio | |
| Día del Trabajo | Primer lunes de septiembre | |
| Día de los Veteranos | 12 de noviembre | |
| Día de Acción de Gracias | Cuarto jueves de noviembre | |
| Día posterior a Acción de Gracias | Cuarto viernes de noviembre | |
| Nochebuena | 24 de diciembre | |
| Día de Navidad | 25 de diciembre | |
| Día posterior a Navidad | 26 de diciembre | |
| Víspera de Año Nuevo | 31 de diciembre | |
| U.S. holiday | Festejado |
| --------------------------------- | --------------------------- |
| Año Nuevo | 1 de enero |
| Día de Martin Luther King, Jr. | Tercer lunes de enero |
| Día de los Presidentes | Tercer lunes de febrero |
| Día de los Caídos | Último lunes de mayo |
| Día de la Independencia | 4 de julio |
| Día del Trabajo | Primer lunes de septiembre |
| Día de los Veteranos | 12 de noviembre |
| Día de Acción de Gracias | Cuarto jueves de noviembre |
| Día posterior a Acción de Gracias | Cuarto viernes de noviembre |
| Nochebuena | 24 de diciembre |
| Día de Navidad | 25 de diciembre |
| Día posterior a Navidad | 26 de diciembre |
| Víspera de Año Nuevo | 31 de diciembre |

#### Feriados en Japón

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ versions:

{% data variables.contact.enterprise_support %} は、以下の米国の祝日を休日としています。 ただし、緊急サポートチケットにはグローバルサポートチームが対応しています。

| アメリカ合衆国の祝日 祝日 | Date observed in {{ "now" | 日付: "%Y" }} |
| --------------------------- | --------------------------- | ----------- |
| New Year's Day | January 1 | |
| Martin Luther King, Jr. Day | Third Monday in January | |
| Presidents' Day | Third Monday in February | |
| Memorial Day | Last Monday in May | |
| Independence Day | July 4 | |
| Labor Day | First Monday in September | |
| Veterans Day | November 12 | |
| Thanksgiving Day | Fourth Thursday in November | |
| Day after Thanksgiving | Fourth Friday in November | |
| Christmas Eve | December 24 | |
| Christmas Day | December 25 | |
| Day after Christmas | December 26 | |
| New Year's Eve | December 31 | |
| アメリカ合衆国の祝日 祝日 | Date observed |
| --------------------------- | --------------------------- |
| New Year's Day | January 1 |
| Martin Luther King, Jr. Day | Third Monday in January |
| Presidents' Day | Third Monday in February |
| Memorial Day | Last Monday in May |
| Independence Day | July 4 |
| Labor Day | First Monday in September |
| Veterans Day | November 12 |
| Thanksgiving Day | Fourth Thursday in November |
| Day after Thanksgiving | Fourth Friday in November |
| Christmas Eve | December 24 |
| Christmas Day | December 25 |
| Day after Christmas | December 26 |
| New Year's Eve | December 31 |

#### 日本の祝日

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,21 @@ For urgent issues, we can help you in English 24 hours per day, 7 days per week,

{% data variables.contact.enterprise_support %} observes these U.S. holidays, although our global support team is available to answer urgent tickets.

| U.S. holiday | Date observed in {{ "now" | date: "%Y" }} |
| --------------------------- | --------------------------- | ------------- |
| New Year's Day | January 1 | |
| Martin Luther King, Jr. Day | Third Monday in January | |
| Presidents' Day | Third Monday in February | |
| Memorial Day | Last Monday in May | |
| Independence Day | July 4 | |
| Labor Day | First Monday in September | |
| Veterans Day | November 12 | |
| Thanksgiving Day | Fourth Thursday in November | |
| Day after Thanksgiving | Fourth Friday in November | |
| Christmas Eve | December 24 | |
| Christmas Day | December 25 | |
| Day after Christmas | December 26 | |
| New Year's Eve | December 31 | |
| U.S. holiday | Date observed |
| --------------------------- | --------------------------- |
| New Year's Day | January 1 |
| Martin Luther King, Jr. Day | Third Monday in January |
| Presidents' Day | Third Monday in February |
| Memorial Day | Last Monday in May |
| Independence Day | July 4 |
| Labor Day | First Monday in September |
| Veterans Day | November 12 |
| Thanksgiving Day | Fourth Thursday in November |
| Day after Thanksgiving | Fourth Friday in November |
| Christmas Eve | December 24 |
| Christmas Day | December 25 |
| Day after Christmas | December 26 |
| New Year's Eve | December 31 |

#### Holidays in Japan

Expand Down
Loading