-
Notifications
You must be signed in to change notification settings - Fork 169
[GSOC 2025]: Github action for translation tracker #895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Updated translation-sync workflow for examples instead of reference - Added Week 3 test change to Shape Primitives description - Should trigger automated issue creation for outdated translations
- Added workflow_dispatch with scan_all and create_issues options - Can now manually trigger action from GitHub UI - Supports both normal and full-scan modes
- Modified description.mdx to test translation tracker - Should now detect 1 English example file change
- test-local.js: Only shows changed files from predefined test files - index.js: Production mode with minimal console output - Removed verbose logging and repository exploration - Clear distinction: test mode vs production mode with GitHub token
- SCAN_ALL=true environment variable to check all 61 example files - Simplified GitHub Actions workflow - Default: checks only changed files - Manual trigger: option to scan all files
Hi @Divyansh013 , this is looking great! Based on checking the current issue created by this (Divyansh013#11) I have a couple of minor suggestions:
|
? 'git diff --name-only HEAD~1 HEAD' | ||
: 'git diff --name-only HEAD~1 HEAD'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two options are actually the same. Maybe typo here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed. What was originally intended here:
'git diff --name-only origin/main...HEAD' // Compare with base branch for PRs
: 'git diff --name-only HEAD~1 HEAD'; // and with last commir for pushes
thoughts about this?
|
||
return null; | ||
} catch (error) { | ||
// Fallback to main branch if current branch fails |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering what will happen if the main branch also fails?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in that case we can log out the error ? or is there something I am missing out?
try { | ||
return fs.statSync(filePath).mtime; | ||
} catch (error) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add log here might be helpful for debugging.
* Format the issue body with helpful information | ||
*/ | ||
formatIssueBody(englishFile, language, commitInfo) { | ||
const translationPath = englishFile.replace('/en/', `/${language}/`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the directory structure changes or there are multiple occurrences of ·/en/· in the path (correct me if there are any situations that I didn't catch), this could lead to errors or unintended behavior.
@ksen0 requesting your review here |
'zh-Hans': { | ||
title: '此翻译可能已过期', | ||
message: '与英文版本相比,此页面不是最新的。', | ||
viewEnglish: '查看英文页面', | ||
contribute: '参与翻译', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Chinese translation here is pretty good. I will take a look of the remaining GitHub Actions related stuff when I have time.
@@ -0,0 +1,266 @@ | |||
# p5.js Translation Tracker | |||
|
|||
A comprehensive GitHub Action and command-line tool to track translation status across multiple languages in the p5.js website examples. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Edited - see below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, if this is for GSoC documentation, please feel free to keep the log, but maybe at the top of the file have a very short README of the tool? Just keeping separate the description of the action (for future maintenance) and the GSoC documentation would be great. For example, I think a good place to start this readme is to describe the overall flow, the format of the translation-status
files, how they are produced/used.. The log you can of course keep as you have, it's just important to also have the summary for the tool over all 🙏
### ✅ Week 1 Features (File-based tracking) | ||
- Git-based change detection for English example files | ||
- File modification time comparison | ||
- Support for all languages: Spanish (es), Hindi (hi), Korean (ko), Chinese Simplified (zh-Hans) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: a shorter README is easier to maintain, so please remove the duplicated info. (The supported languages are listed below already in a very readable format)
|
||
### ✅ Week 3 Features (Multi-language & refinement) | ||
- **Single issue per file**: Creates one issue covering all affected languages instead of separate issues per language | ||
- **Enhanced labeling**: Uses "needs translation" base label + specific language labels (e.g., "lang-es", "lang-ko") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Edited - see above - mainly a very practical intro would be great in this README)
|
||
```javascript | ||
{ | ||
enableWeek2: boolean, // Force Week 2 mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems probably not applicable anymore
contribute: 'Contribuir a la traducción', | ||
}, | ||
'ko': { | ||
title: '이 번역은 오래되었을 수 있습니다', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @hana-cho! When you have time, another set of Korean translations for your review. Thanks so much!
contribute: 'अनुवाद में योगदान दें', | ||
}, | ||
'es': { | ||
title: 'Esta traducción podría estar desactualizada', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @marioguzzzman! If/when you have time, could you check these Spanish translations please? Thanks so much!
let englishUrl = Astro.url.pathname; | ||
if (currentLocale !== 'en') { | ||
// Replace /{locale}/ with / to get English URL | ||
englishUrl = englishUrl.replace(`/${currentLocale}/`, '/'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question here: have you tried using zh-Hans
? It is a different use case from es
, hi
and ko
. I’m wondering if the replace operation will succeed.
PS: Please check all places with currentLocale
and replace()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes have checked zh-Hans and it is working in expected way. I will check in all places
Uh oh!
There was an error while loading. Please reload this page.