Skip to content
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

Feat: Add translation status script and workflow #431

Merged
merged 4 commits into from
May 4, 2022
Merged

Feat: Add translation status script and workflow #431

merged 4 commits into from
May 4, 2022

Conversation

hippotastic
Copy link
Contributor

@hippotastic hippotastic commented May 3, 2022

Adds a script that creates or updates a special "Translation Status Overview" summary issue on GitHub that provides an overview of the current Astro documentation translation status.

Also adds a GitHub workflow that runs this script on every push to the main branch.

An example of the summary issue maintained by this script can be seen here:
#438

@netlify
Copy link

netlify bot commented May 3, 2022

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f72999f
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/6272dbf87cd9d600084781a4
😎 Deploy Preview https://deploy-preview-431--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@hippotastic
Copy link
Contributor Author

Would love you to have a look at this @delucis & @sarah11918 😄

@hippotastic
Copy link
Contributor Author

Note: If you want to test this locally outside of GitHub, you will need to set the env variable GITHUB_REPOSITORY to withastro/docs. This variable is normally set by GitHub workflows. Then you can run pnpm run github:translation-status to see what it would do. It will perform a dry run in this case and not create an issue because there is no GITHUB_TOKEN (which also gets set by the workflow), but you can see the generated state data and human-friendly issue summary.

@sarah11918
Copy link
Member

Looks wonderful, @hippotastic ! I'd be super happy with this as a display for our translators!

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely stunning work @hippotastic! 🏆

Really struggled to say anything of value here. I have made some suggestions, but I think basically all of this could just be noted down as possibilities for polish in the future. Happy to see this merged as is 👍

scripts/lib/github-issues.mjs Outdated Show resolved Hide resolved
scripts/github-translation-status.mjs Show resolved Hide resolved
return pageData;
}

tryGetFrontMatterBlock (filePath) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this would simplify your life much, but could you use gray-matter here? That’s how Astro parses frontmatter, so it’s already a dependency.

scripts/github-translation-status.mjs Show resolved Hide resolved
scripts/github-translation-status.mjs Outdated Show resolved Hide resolved
scripts/github-translation-status.mjs Show resolved Hide resolved
@hippotastic
Copy link
Contributor Author

Amazing review with lots of valuable feedback and ideas @delucis, thank you so much! I'd love to address your feedback after merging this PR though to get this into production asap so we can start monitoring the behavior on the "real thing" right away. I'd really be happy to keep improving this!

hippotastic and others added 2 commits May 4, 2022 22:02
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
@delucis delucis merged commit 61dd6da into withastro:main May 4, 2022
@delucis delucis mentioned this pull request May 4, 2022
24 tasks
@hippotastic hippotastic deleted the feat/translation-status branch May 5, 2022 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants