-
Notifications
You must be signed in to change notification settings - Fork 63
Make translations more reliably present in all environments #2172
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/2172 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: -969 B (0%) Total Size: 906 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.
Great find!
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. How was 99
chosen for the rate limiting. Is that a GlotPress value documented somewhere?
It was trial and error tbh, I noticed that it was only downloading about a 100 languages and 429-ing for the rest. I searched for official rate-limiting documentation but couldn't find any. |
Co-authored-by: Zack Krida <zackkrida@pm.me>
Playwright Failure Test Results It looks like some of the Playwright tests failed. You can download the Playwright trace https://github.com/WordPress/openverse-frontend/actions/runs/4174618643 Read more about how to use this artifact here: https://github.com/WordPress/openverse-frontend/blob/main/test/playwright/README.md#debugging |
Fixes
Fixes #2170 by @AetherUnbound
Description
This PR installs the
axios-rate-limit
module and sets up rate limiting for requests to GlotPress. This ensures that 429 errors are not raised and all translations are reliably downloaded.This also adds logging in the
get-translations.js
script which prints the names of locales that fail to download.Testing Instructions
pnpm i18n:get-translations
with various rate limits insrc/locales/scripts/axios.js
. Very low limits like 10 or 20 will slow down the download considerably, whereas very high limits like 200 or 1000 will report large number of failures due to 429 errors. With the rate-limiting enabled and set to 99 (lower than 100 req/sec), no failures are recorded.Example output when rate limit is set to 1000.
Checklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin