Repository navigation
Conversation
|
Bump. CI hasn't run here yet, it's waiting on first time contributor workflow approval. The fix is one line, the same getTranslation pattern the neighboring calls in the file already use. |
|
Thanks for picking this up. The RSC change is correct, but current There is already a focused fixture in I confirmed that both files on current |
|
Verified on current Would you prefer to include that occurrence here? I can prepare the source change plus a focused accessibility assertion, or keep it as a separate PR. |
|
Yes, makes sense to keep them together. Pushed 4f695c7: DocumentDrawerToggler now runs the singular label through getTranslation with i18n, same as the card, so the Add new and Edit accessible names read localized too. Not built locally on this machine, CI has it. |
|
Thanks, the drawer change matches the fix in #17959, where I also added a localized-label fixture and an accessibility regression test verified on localhost. Those test changes can be included here so we can consolidate the PRs. One occurrence remains: The latest CI run is currently marked |
…idget The client widget passed the same raw label object to createNewLabel as the RSC widget did. Adds the i18n e2e assertion on the dashboard create button, and the localized label fixture plus the drawer toggler aria-label test from payloadcms#17959 so the two PRs can be consolidated here.
|
Sorry for the wait on this one. Pushed the remaining piece: Pulled your test changes in as well: the Happy to consolidate here, or to drop my drawer commit in favor of #17959 if you'd rather keep the test where you wrote it. Whichever is less work for you. |
|
Thanks. Since #17959 is already open, mergeable, and has the focused drawer regression test, I would prefer keeping the fixes split by component: #17664 for both CollectionCards implementations and the dashboard i18n regression, and #17959 for DocumentDrawerToggler with the localized relationship fixture and accessibility test. Please drop the drawer-related change and test from this PR. That avoids duplication while keeping both PRs focused. Thanks for offering both options. |
Kept split by component per review: the drawer toggler fix, the localized relationship fixture and the accessibility test live in payloadcms#17959.
|
Done, dropped the drawer change and test. |
… (3.x) (#19116) ### What? Port of #17664 to `3.x`. The create button on the dashboard collection cards now passes the translated collection label to `general:createNewLabel`. ### Why? With localized collection labels (for example `{ en: 'Pages', de: 'Seiten' }`), the raw label object was interpolated, so the button's `aria-label` and `title` read `[object Object] neu erstellen`. Reported in #17069 and confirmed on 3.85.1, 3.85.2 and 3.88.0. `main` already includes this fix via #18358. ### How? - Use the already translated `title` in the create button's `aria-label`, matching the `showAllLabel` call above it. - Add the `test/i18n` e2e assertion from #17664 for both `aria-label` and `title`. It fails without the fix (`Received: "Crear [object Object]"`) and passes with it. - The pre-commit hook also sorted the existing imports in `test/i18n/e2e.spec.ts`. Thanks to @1yakub for the original fix and test, and to @cbratschi for the report and review. Fixes #17069 Co-authored-by: German Jablonski <[email protected]> Co-authored-by: Yakub Hossain <[email protected]>
The create button on collection cards passes the raw entity label into general:createNewLabel. When a collection has localized labels that label is an object, so the aria-label comes out as "[object Object] neu erstellen", and Button copies aria-label into title so both attributes get it.
Fixed by passing the title that's already translated a few lines up, which is what the showAllLabel call does too. Same change in both widgets: the RSC one and the TanStack Start client one, which carried the same raw label.
Tests: an assertion in test/i18n for the dashboard create button in Spanish (e2e.config.ts mirrors every Next suite into a tanstack-start suite, so it exercises both widgets).
Closes #17069