-
-
Notifications
You must be signed in to change notification settings - Fork 129
Add autotranslation of releases to build step #654
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
Conversation
✅ Deploy Preview for numpy-org ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
Thanks Albert! This looks like the right approach to me from a quick look. Agreed with continuing after the translations launch. It may require a rebase or a few tweaks after that. |
| @@ -0,0 +1,3 @@ | |||
| {{ $lang := .Page.Lang }} | |||
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.
You may want to use one of the existing shortcodes provided by the theme:
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.
Yeah, we could also just use the include-md short-code and in the news.md for each language, hard code the path to the releases.md for that particular language. Figuring out the language in the shortcode and generating the path dynamically might be too clever for its own good. Do you think the first option I mentioned with just include-md is better?
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.
Perhaps a simpler option is to generate a JSON data file, and to then use a language-specific template to generate the release lines:
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.
OK, cool. Thanks @stefanv, I didn't know about this stuff! It looks like I've re-implemented something Hugo is already pretty good at. Data-templates does seem like the way to go.
|
Closing this, because I plan to use @stefanv's data templates approach, and I think it will be easier to start from scratch. |
Brief description of what is fixed or changed
Following up on @rgommers' comment #652 (comment), this PR adds autotranslation of the list of releases to the build process. I'm marking this as draft because I think we should wait until after we go live with the first batch of translations before considering whether to merge this.
Autotranslation is accomplished with a simple Python script. I've briefly documented how to add new languages in a module level docstring for the script. The autotranslated releases can be included with a new shortcode
"layouts/shortcodes/releases.html".