Open huyenltnguyen opened 5 months ago
I am all for localization. Though I wonder if it might be out of scope for a component library.
It also can be a bit of a hassle sometimes depending on how we go about implementing it.
To elaborate further I personally wanna vote for option 2. This is a component library and I would rather leave the localization to the site level. Additionally when it comes to localization practices in React (that I am somewhat aware of), they would realistically store those localization in a separate file managed by their own website and use another component to switch the language.
I also fear any workflow we make could interfere with this and potentially bring bloat. It's probably best to just leave the localization to the library users.
Description
We currently have English strings in our components as fallback text:
https://github.com/freeCodeCamp/ui/blob/1fe2aea4d8ed19714aeb81872b602b94f4b04ac1/src/close-button/close-button.tsx#L47
It is for convenience, as components such as
CloseButton
shouldn't have any label text other than "Close". However, supporting default text requires setting up a localization workflow as well as including the translations in the package bundle.I'm opening this issue to discuss whether we should: