-
Notifications
You must be signed in to change notification settings - Fork 63
Download translations in bulk to prevent GlotPress throttling #2188
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/2188 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Size Change: -25.6 kB (-3%) Total Size: 882 kB
ℹ️ View Unchanged
|
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 didn't test Docker, but this works perfectly. I left a non-blocking suggestion for the unlikely use case where invalid w.org credentials are supplied.
@zackkrida I'm very bad with JS Promises, even getting this PR to this usable state was very difficult for me. If you can push those changes for improved logging or fallback, that'll be very helpful. I'm considering refactoring these scripts (and maybe use TypeScript) when I have some free time because it's very difficult to work with Promise chains, at least for me if not anyone else. |
@dhruvkb sure, I can make some suggestions later today. |
@zackkrida my grasp on Promises was holding me back, I replaced all of that with |
…2192) Co-authored-by: Zack Krida <zackkrida@pm.me>
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.
LGTM
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.
LGTM! Thank you for fixing these problems, @dhruvkb!
Fixes
Fixes #2184 by @dhruvkb
Description
This PR adds bulk downloading for translations by logging into GlotPress, downloading the ZIP and extracting the JSON content. It reuses the existing framework for massaging them from
jed1x
to Vue i18n's format and then writing them to the destination dir.If GlotPress credentials are not present in the environment, the old throttled approach will be used as the fallback, a Make WordPress membership is not needed for development.
Other improvements
la.json
) too. Unfortuanately we can't use it because it's not in the valid locales list.locales-list.json
that was not being used anywhere and had no references pointing to it.Testing Instructions
Checklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin