carbon
carbon copied to clipboard
Overriding i18n strings requires original typing that can't be changed
Current behaviour
When trying to override locales by following https://carbon.sage.com/?path=/docs/textarea--character-limit-story, the original typing is still being enforced causing type errors in my implementation. E.g. my override only needs to pass in count
for this https://github.com/Sage/carbon/blob/master/src/locales/locale.ts#L24-L26, but I get the error that formattedCount
is required.
Expected behaviour
Custom implementation of Carbon locales should not require the original typing.
CodeSandbox or Storybook URL
n/a
JIRA Ticket (Sage Only)
No response
Suggested Solution
No response
Carbon Version
123.9.0
Design Tokens Version
No response
What browsers are you seeing the problem on?
Firefox, Chrome, Safari, Microsoft Edge
What Operating System are you seeing the problem on?
MacOS
Anything else we should know?
No response
Confidentiality
- [X] I confirm there is no confidential or commercially sensitive information included.
We could probably update the type it's recursively partial as currently it only sets the first level to be so
type RecursivePartial<T> = {
[P in keyof T]?: RecursivePartial<T[P]>;
};
FE-6333
Following the changes made in Carbon v137.0.0 whereby translations are provided by Carbon, I do not believe there is any issue outstanding here now. I am going to close this issue with this in mind.