From 4a96cac824be7781d771515cc16968e09a134beb Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Thu, 11 Jan 2024 12:43:56 +0100 Subject: [PATCH] Simplify TranslatableInputsTabContent getLabel --- .../src/input/TranslatableInputsTabContent.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/ra-ui-materialui/src/input/TranslatableInputsTabContent.tsx b/packages/ra-ui-materialui/src/input/TranslatableInputsTabContent.tsx index f1a4f44fd49..a5ca53fb311 100644 --- a/packages/ra-ui-materialui/src/input/TranslatableInputsTabContent.tsx +++ b/packages/ra-ui-materialui/src/input/TranslatableInputsTabContent.tsx @@ -28,10 +28,9 @@ export const TranslatableInputsTabContent = ( () => ({ getSource: (source: string) => `${source}.${locale}`, getLabel: (source: string) => { - const itemSource = source.replace(`.${locale}`, ''); return parentSourceContext - ? parentSourceContext.getLabel(itemSource) - : getResourceFieldLabelKey(resource, itemSource); + ? parentSourceContext.getLabel(source) + : getResourceFieldLabelKey(resource, source); }, }), [locale, parentSourceContext, resource]