Skip to content

Commit 335eb3d

Browse files
committed
Refactor comment body construction for translation updates
1 parent 374937d commit 335eb3d

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

.github/workflows/mark-translations-outdated.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
script: |
7878
const fs = require('fs');
7979
const changedFiles = fs.readFileSync('changed_english_docs.txt', 'utf8').trim().split('\n');
80-
const fileList = changedFiles.map(f => `- \`${ f }\``).join('\n');
80+
const fileList = changedFiles.map(f => '- `' + f + '`').join('\n');
8181
8282
let markedFilesList = '';
8383
if (fs.existsSync('marked_translation_files.txt')) {
@@ -86,20 +86,18 @@ jobs:
8686
const markedCount = markedFiles.length;
8787
const displayFiles = markedFiles.slice(0, 20);
8888
markedFilesList = '\n\n### Marked Translation Files\n\n';
89-
markedFilesList += displayFiles.map(f => `- \`${ f }\``).join('\n');
89+
markedFilesList += displayFiles.map(f => '- `' + f + '`').join('\n');
9090
if (markedCount > 20) {
91-
markedFilesList += `\n\n*...and ${ markedCount - 20 } more files*`;
91+
markedFilesList += '\n\n*...and ' + (markedCount - 20) + ' more files*';
9292
}
9393
}
9494
}
9595
96-
const body = `## 🌐 Translation Update Notice
97-
98-
The following English documentation files were modified in this PR:
99-
100-
${ fileList }
101-
102-
The corresponding translation files have been automatically marked as potentially outdated in this PR branch. Translators should review these changes and update translations accordingly.${ markedFilesList }`;
96+
const body = '## 🌐 Translation Update Notice\n\n' +
97+
'The following English documentation files were modified in this PR:\n\n' +
98+
fileList + '\n\n' +
99+
'The corresponding translation files have been automatically marked as potentially outdated in this PR branch. Translators should review these changes and update translations accordingly.' +
100+
markedFilesList;
103101
104102
github.rest.issues.createComment({
105103
issue_number: context.issue.number,

0 commit comments

Comments
 (0)