1
0
mirror of synced 2026-01-04 09:06:46 -05:00

Merge branch 'main' into repo-sync

This commit is contained in:
Octomerger Bot
2021-11-03 13:34:10 -04:00
committed by GitHub
7 changed files with 23 additions and 23 deletions

View File

@@ -394,17 +394,17 @@ This is a convenience script for replacing the contents of translated files with
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>
Usage: script/i18n/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
reset a single translated file using a relative path: $ script/i18n/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 a single translated file using a full path: $ script/i18n/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 relative path): $ script/i18n/reset-translated-file.js content/actions/index.md $ script/i18n/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
reset all language variants of a single English file (using a full path): $ script/i18n/reset-translated-file.js /Users/z/git/github/docs-internal/content/desktop/index.md $ script/i18n/reset-translated-file.js /Users/z/git/github/docs-internal/data/ui.yml
---

View File

@@ -13,12 +13,12 @@ import path from 'path'
import { execSync } from 'child_process'
import { get, set } from 'lodash-es'
import fs from 'fs'
import readFileAsync from '../lib/readfile-async.js'
import fm from '../lib/frontmatter.js'
import readFileAsync from '../../lib/readfile-async.js'
import fm from '../../lib/frontmatter.js'
import matter from 'gray-matter'
import chalk from 'chalk'
import yaml from 'js-yaml'
import ghesReleaseNotesSchema from '../tests/helpers/schemas/ghes-release-notes-schema.js'
import ghesReleaseNotesSchema from '../../tests/helpers/schemas/ghes-release-notes-schema.js'
import revalidator from 'revalidator'
const __dirname = path.dirname(fileURLToPath(import.meta.url))

View File

@@ -3,7 +3,7 @@
// [start-readme]
//
// Use this script as part of the Crowdin merge process to output a list of parsing and rendering
// errors in translated files and run script/reset-translated-file.js on them.
// errors in translated files and run script/i18n/reset-translated-file.js on them.
//
// [end-readme]
@@ -23,7 +23,7 @@ try {
// 2. Check for rendering errors and output to file. Note this one must be run SECOND.
console.log('Checking for rendering errors...')
try {
execSync(`script/test-render-translation.js > ${renderErrorsLog}`)
execSync(`script/i18n/test-render-translation.js > ${renderErrorsLog}`)
} catch (error) {
console.log('There were new rendering errors!')
}
@@ -31,7 +31,7 @@ try {
// Reset the broken files.
console.log('Resetting broken files...')
execSync(
`cat ${parsingErrorsLog} ${renderErrorsLog} | egrep "^translations/.*/(.+.md|.+.yml)$" | uniq | xargs -L1 script/reset-translated-file.js --prefer-main`
`cat ${parsingErrorsLog} ${renderErrorsLog} | egrep "^translations/.*/(.+.md|.+.yml)$" | uniq | xargs -L1 script/i18n/reset-translated-file.js --prefer-main`
)
// Print a message with next steps.

View File

@@ -3,12 +3,12 @@
// [start-readme]
//
// Use this script as part of the Crowdin merge process to get the list of known broken
// files and run script/reset-translated-file.js on them.
// files and run script/i18n/reset-translated-file.js on them.
//
// [end-readme]
import dotenv from 'dotenv'
import Github from './helpers/github.js'
import Github from '../helpers/github.js'
import { promisify } from 'util'
import ChildProcess from 'child_process'
@@ -44,7 +44,7 @@ async function main() {
await Promise.all(
brokenFilesArray.map(async (file) => {
console.log(`resetting ${file}`)
await exec(`script/reset-translated-file.js --prefer-main ${file}`)
await exec(`script/i18n/reset-translated-file.js --prefer-main ${file}`)
})
)

View File

@@ -9,11 +9,11 @@
// while we wait for translators to fix them.
//
// Usage:
// script/reset-translated-file.js <filename>
// script/i18n/reset-translated-file.js <filename>
//
// Examples:
//
// $ script/reset-translated-file.js translations/es-XL/content/actions/index.md
// $ script/i18n/reset-translated-file.js translations/es-XL/content/actions/index.md
//
// [end-readme]

View File

@@ -8,14 +8,14 @@
import { fileURLToPath } from 'url'
import path from 'path'
import renderContent from '../lib/render-content/index.js'
import loadSiteData from '../lib/site-data.js'
import { loadPages } from '../lib/page-data.js'
import languages from '../lib/languages.js'
import renderContent from '../../lib/render-content/index.js'
import loadSiteData from '../../lib/site-data.js'
import { loadPages } from '../../lib/page-data.js'
import languages from '../../lib/languages.js'
import { promisify } from 'util'
import ChildProcess, { execSync } from 'child_process'
import fs from 'fs'
import frontmatter from '../lib/frontmatter.js'
import frontmatter from '../../lib/frontmatter.js'
import chalk from 'chalk'
import { YAMLException } from 'js-yaml'
@@ -91,7 +91,7 @@ async function loadAndPatchSiteData(filesWithKnownIssues = {}) {
// Reset the file
console.warn(`resetting file "${relPath}" due to loadSiteData error: ${error.toString()}`)
await exec(`script/reset-translated-file.js --prefer-main ${relPath}`)
await exec(`script/i18n/reset-translated-file.js --prefer-main ${relPath}`)
// Try to load the site data again
return loadAndPatchSiteData(filesWithKnownIssues)

View File

@@ -9,7 +9,7 @@
// [end-readme]
import dotenv from 'dotenv'
import Github from './helpers/github.js'
import Github from '../helpers/github.js'
import { execSync } from 'child_process'
dotenv.config()