1
0
mirror of synced 2025-12-21 02:46:50 -05:00

Improvements in tools to help merge crowdin PRs (#18409)

- add `script/test-render-translation.js` to render all translated content to catch malformed liquid that would cause render errors
- improve test output for `script/fix-translation-errors.js` and `tests/content/lint-files.js`
- make it so `script/reset-translated-file.js` can handle files that have been renamed
This commit is contained in:
Vanessa Yuen
2021-03-26 20:21:45 +01:00
committed by GitHub
parent 3899af0d0d
commit a8d54c9af7
8 changed files with 348 additions and 219 deletions

View File

@@ -71,13 +71,14 @@ changedFilesRelPaths.forEach(async (relPath) => {
if (!engResult) return
const { data: engData } = engResult
console.log(chalk.red('fixing errors in ') + chalk.bold(relPath))
console.log(chalk.bold(relPath))
const newData = data
fixableErrors.forEach(({ property }) => {
fixableErrors.forEach(({ property, message }) => {
const correctValue = get(engData, property)
console.log(` [${property}]: ${get(data, property)} -> ${correctValue}`)
console.log(chalk.red(` error message: [${property}] ${message}`))
console.log(` fix property [${property}]: ${get(data, property)} -> ${correctValue}`)
set(newData, property, correctValue)
})