Skip to content

Commit fd15a73

Browse files
authored
Update translation tracker to handle missing commit data
1 parent 393165e commit fd15a73

File tree

1 file changed

+3
-2
lines changed
  • .github/actions/translation-tracker

1 file changed

+3
-2
lines changed

.github/actions/translation-tracker/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,15 @@ class GitHubCommitTracker {
371371
const englishFile = fileTranslations.englishFile;
372372
const outdatedLanguages = fileTranslations.outdatedLanguages;
373373
const missingLanguages = fileTranslations.missingLanguages;
374+
const englishCommit = fileTranslations.englishCommit;
374375

375376
let body = `## 🌍 Translation Update Needed
376377
377378
**File**: \`${englishFile}\`
378379
**Branch**: \`${this.currentBranch}\`
379380
380381
### 📅 Timeline
381-
- **Latest English update**: ${fileTranslations.englishCommit.date.toLocaleDateString()} by ${fileTranslations.englishCommit.author}
382+
- **Latest English update**: ${englishCommit ? `${englishCommit.date.toLocaleDateString()} by ${englishCommit.author}` : 'Unknown (commit data unavailable)'}
382383
383384
`;
384385

@@ -420,7 +421,7 @@ class GitHubCommitTracker {
420421
- [ ] Ensure translation is accurate and culturally appropriate
421422
422423
### 📝 Summary of English File Changes
423-
**Last commit**: [${fileTranslations.englishCommit.message}](${fileTranslations.englishCommit.url})
424+
**Last commit**: ${englishCommit ? `[${englishCommit.message}](${englishCommit.url})` : 'Unavailable'}
424425
425426
${outdatedLanguages.length > 0 || missingLanguages.length > 0 ? `**Change Type**: English file was updated. ${outdatedLanguages.length > 0 ? `${outdatedLanguages.map(l => this.getLanguageDisplayName(l.language)).join(', ')} translation${outdatedLanguages.length > 1 ? 's' : ''} may be outdated.` : ''} ${missingLanguages.length > 0 ? `${missingLanguages.map(l => this.getLanguageDisplayName(l.language)).join(', ')} translation${missingLanguages.length > 1 ? 's are' : ' is'} missing.` : ''}` : ''}
426427

0 commit comments

Comments
 (0)