-
Notifications
You must be signed in to change notification settings - Fork 63
Simplify get-translations.js
and add error handling and fallbacks
#2192
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/2192 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. |
get-translations.js
and add error handling and fallbacks
Size Change: 0 B Total Size: 908 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'll review more deeply for code quality, but when I switch locales I'm seeing english, and noticed items in the translation files look like this:
"filters.audio-categories.sound_effect\u0004Sound effects": {
"0": "Efectos de sonido"
},
Where the en.json equivalent is:
"audio-categories": {
"title": "Audio category",
"audiobook": "Audiobook",
"music": "Music",
"news": "News",
"podcast": "Podcast",
"pronunciation": "Pronunciation",
"sound_effect": "Sound effects",
"sound": "Sound effects"
},
I'll debug that immediately. Update: I was missing a step. Fixed in 195bfb3. |
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/4197079922 Read more about how to use this artifact here: https://github.com/WordPress/openverse-frontend/blob/main/test/playwright/README.md#debugging |
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. I've tested all cases and it's working well. The logging is all quite clear and useful.
Description
This PR improves upon #2188 in the following ways
get-translations.js
file into smaller files that work independently--require-complete
that can be passed to halt builds when the translations are incompletely downloaded.All in all, this PR adds significant resilience to the multi-pronged approach developed in #2188.
Testing Instructions
src/locales/scripts/axios.js
--require-complete
flagChecklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin