Skip to content

Commit

Permalink
Clarify advice on changes to translations (#18685)
Browse files Browse the repository at this point in the history
  • Loading branch information
felicitymay authored Apr 12, 2021
1 parent d46428d commit a59306d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions script/prevent-translation-commits.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const filenames = execSync('git diff --cached --name-only').toString().trim().sp
const localizedFilenames = filenames.filter(filename => filename.startsWith('translations/'))

if (localizedFilenames.length) {
console.error('\n✋ Uh oh! Detected changes in the /translations directory.')
console.error('\n✋ Uh oh! Detected changes to the following files in the `/translations` directory:')
console.table(localizedFilenames.join('\n'))
console.error('The content in this directory is managed by our Crowdin integration and should not be edited directly in the repo.')
console.error('For more information on how the localization process works, see translations/README.md')
console.error('\nPlease revert your changes to the following files:\n')
console.table(localizedFilenames.join('\n'))
console.error('\nTip #1: You can unstage these changes on the command line using `git restore --staged translations`\n')
console.error('\nTip #2: You can bypass this hook by setting `ALLOW_TRANSLATION_COMMITS=true` in your .env file.`\n')
console.error('\nIf you have accidentally edited these files, you can unstage these changes on the command line using `git restore --staged translations`\n')
console.error('\nIf you are performing a merge from `main`, you should bypass this hook by using ` git commit --no-verify`\n')
console.error('\nIf you need to edit translated files often, you can set `ALLOW_TRANSLATION_COMMITS=true` in your .env file.`\n')
process.exit(1)
}

0 comments on commit a59306d

Please sign in to comment.