Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect typedefinition for TranslationStrings (fix suggested) #3032

Closed
huineng opened this issue Oct 22, 2024 · 2 comments · Fixed by #3077
Closed

incorrect typedefinition for TranslationStrings (fix suggested) #3032

huineng opened this issue Oct 22, 2024 · 2 comments · Fixed by #3077

Comments

@huineng
Copy link

huineng commented Oct 22, 2024

This is an incorrect type definition for TranslationStrings

https://github.com/carbon-design-system/carbon-components-angular/blob/7967695ff011a0e42761f4fcf766820bdd2e1bef/src/i18n/i18n.service.ts#L138C1-L138C60

it should in fact support nested values like in the en.ts file

i suggest to modify it to

export type TranslationStrings = {
  [key: string]: string | { [key: string]: string | TranslationStrings };
};

Thanks

latest carbon-angular-components. version

@klaascuvelier
Copy link
Contributor

I think you are correct, but I think your suggestion can be simplified to

export type TranslationStrings = {
  [key: string]: string | TranslationStrings;
};

I created a PR where I updated the type :)

Copy link

🎉 This issue has been resolved in version 5.56.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants