Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Prince/ added translation-fix command for conflict fixing (#6904)
Browse files Browse the repository at this point in the history
* chore: added translation-fix command for conflict fixing

* auto-pull-translation

* fix: pr suggestions
  • Loading branch information
prince-deriv authored Jan 31, 2024
1 parent 1960f6b commit 351e7a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"translate:upload": "crowdin upload sources -b crowdin",
"translation:pull": "node scripts/handle-translations.js pull",
"translation:fetch": "node scripts/handle-translations.js pull-master",
"translation:fix": "node scripts/handle-translations.js merge-master-translation; npm run pre-commit-translate",
"translation:branch": "node scripts/handle-translations.js branch",
"translation:check": "cd scripts && node extract-translations.js show-untranslated && cd ..",
"branch:create": "node scripts/branch-manager.js",
Expand Down
21 changes: 13 additions & 8 deletions scripts/handle-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,15 @@ const handleProcess = (action) => {

// Detect Auto Translation Process

if (action !== 'pull-master')
console.log(
`\x1b[33mInitialized auto translation pull for \x1b[32m[${branch_name}]\x1b[33m \n \x1b[0m`,
)
else {
console.log(
`\x1b[32m[Main] \x1b[33mFetching translation from the master source \x1b[33m \n \x1b[0m`,
)

const consoleMsgs = {
'pull': `\x1b[32m[Main] \x1b[33mFetching translation from the master source \x1b[33m \n \x1b[0m`,
'pull-master': `\x1b[33mInitialized auto translation pull for \x1b[32m[${branch_name}]\x1b[33m \n \x1b[0m`,
'merge-master-translation': `\x1b[33mMerging master and resolving conflicts.... \n \x1b[0m`
}

console.log(consoleMsgs[action])

runProcess({
process: action,
callback: (error, stdout) => {
Expand Down Expand Up @@ -118,6 +117,12 @@ const runProcess = (data) => {
callback,
)
break
case 'merge-master-translation':
exec(
`git merge -X theirs --commit master -m "chore: $(git status --short)"`,
callback,
)
break
default:
break
}
Expand Down

0 comments on commit 351e7a7

Please sign in to comment.