Skip to content

Commit 69996bd

Browse files
authored
Merge branch 'main' into issue-705-tab-indent
2 parents 3bc071d + ec7469b commit 69996bd

File tree

16 files changed

+10499
-10388
lines changed

16 files changed

+10499
-10388
lines changed

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

Lines changed: 14 additions & 12 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.date.toLocaleDateString()} by ${englishCommit.author}
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.message}](${englishCommit.url})
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
@@ -543,12 +544,22 @@ async function checkTranslationStatus(changedFiles, githubTracker = null, create
543544
const fileTranslationMap = translationStatus.fileTranslationMap;
544545

545546
for (const englishFile of changedFiles) {
547+
548+
let englishCommit = null;
549+
if (githubTracker) {
550+
englishCommit = await githubTracker.getLastCommit(englishFile);
551+
if (!englishCommit) {
552+
console.log(`⚠️ Skipping ${englishFile} - could not retrieve commit data`);
553+
continue;
554+
}
555+
}
556+
546557
const fileTranslations = {
547558
englishFile,
548559
outdatedLanguages: [],
549560
missingLanguages: [],
550561
upToDateLanguages: [],
551-
englishCommit: null
562+
englishCommit
552563
};
553564

554565
for (const language of SUPPORTED_LANGUAGES) {
@@ -569,17 +580,8 @@ async function checkTranslationStatus(changedFiles, githubTracker = null, create
569580

570581

571582
if (githubTracker) {
572-
// Get English commit only once per file
573-
if (!fileTranslations.englishCommit) {
574-
fileTranslations.englishCommit = await githubTracker.getLastCommit(englishFile);
575-
}
576-
const englishCommit = fileTranslations.englishCommit;
577583
const translationCommit = await githubTracker.getLastCommit(translationPath);
578584

579-
if (!englishCommit) {
580-
continue;
581-
}
582-
583585
if (!translationCommit) {
584586
const missingItem = {
585587
englishFile,

astro.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ if (shouldSkipCompress) {
2020
export default defineConfig({
2121
site: 'https://p5js.org',
2222
compressHTML: false,
23+
legacy: {
24+
collections: true
25+
},
2326
integrations: [
2427
mermaid({autoTheme: true}),
2528
preact({

0 commit comments

Comments
 (0)