Skip to content

Commit

Permalink
Simplify TranslatableInputsTabContent getLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
djhi committed Jan 11, 2024
1 parent 1a7b3b9 commit 4a96cac
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 4a96cac

Please sign in to comment.