Skip to content

fix: Improve getRecordForLocale record handling - #11459

Merged
nawan-b merged 1 commit into
masterfrom
fix/translatable-record-handling
Nov 17, 2026
Merged

nawan-b merged 1 commit into
masterfrom
fix/translatable-record-handling

Conversation

@ThieryMichel

Copy link
Copy Markdown
Contributor

Problem

getRecordForLocale(), used by <TranslatableFields> and <TranslatableInputs>, gives wrong results when a translatable field contains nested objects or arrays.

Solution

  • Only rewrite paths whose last key is the locale.

How To Test

  • Run yarn test-unit packages/ra-core/src/i18n/useTranslatable.spec.ts
  • In Storybook, open the TranslatableFields and TranslatableInputs stories, switch between locale tabs and check that each tab shows its own locale's values

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why) story already existed
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@ThieryMichel ThieryMichel added the RFR Ready For Review label Nov 16, 2026
@nawan-b
nawan-b merged commit 6bee747 into master Nov 17, 2026
15 checks passed
@nawan-b
nawan-b deleted the fix/translatable-record-handling branch November 17, 2026 14:53
@nawan-b nawan-b added this to the 5.15.8 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants