Fix missing translation errors from ImageInput#7954
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
actually maybe wait for @tristanlabelle to comment |
tristanlabelle
left a comment
There was a problem hiding this comment.
Fix is fine but I'm a little concerned we have a wider transitivity problem where some piece of code needs to know the set of all string namespaces that will be read.
app/web/resources/locales/en.json
Outdated
| "select_an_image": "Select an image", | ||
| "click_replace_image": "Click to replace image", | ||
| "couldnt_read_file": "Couldn't read file", |
There was a problem hiding this comment.
Since we're forcing relocalization anyways, we can take advantage to improve the keys (scope within context + specify the type)
"image_input": {
"a11y": "Select an image",
"tooltip": "Click to replace image",
"read_file_error": "Couldn't read file"
},
e78c826
Yeah we have an issue with the GLOBAL namespace being massive and too much in there for this reasson, but it's not a quick thing to solve so 🤷♀️. We need generally to do an audit of the translation files. Move things out of global that don't need to be there etc. etc. |
📝 Release NotesThis PR does not need to be included in release notes. Reason: This PR fixes translation errors in the ImageInput component by moving translation strings to the GLOBAL namespace. This is an internal code organization fix that resolves console errors developers were seeing, but doesn't change any user-facing functionality or fix any bug that users would have noticed. The component works the same way for end users before and after this change. 🤖 Bot Debug InformationModel: |
Fixing the missing translation string errors for ImageInput. This was happening as ImageInput was importing from the PROFILE namespace but it's also uses on EditEventPage which is in the COMMUNITIES namespace.
I moved the translations into GLOBAL since this component is reused in a few places.