RicardoValdovinos / vite-react-boilerplate

A production ready, scalable starter template for Vite + React
MIT License
725 stars 97 forks source link

Think about adding react-intl #9

Closed Jankaz2 closed 1 month ago

Jankaz2 commented 5 months ago

Hi, as the title says, do you think about adding react-intl to this template?

cosmosdesigner commented 3 months ago

HII!! PR Open: https://github.com/RicardoValdovinos/vite-react-boilerplate/pull/11

RicardoValdovinos commented 2 months ago

Hello everyone,

After looking into both react-intl and the PR, I went ahead and updated the projects dependencies to their latest versions. I noticed this was covered in the PR but there were a couple dependencies that needed additional attention to deal with deprecation's. ESLint related packages (legacy -> flat config), for example, as well as Husky and Storybook.

I think react-intl would be a great addition but before committing to adding it, I'd like to look into what might be the best approach for integrating it into the existing project structure.

cosmosdesigner commented 2 months ago

Gotcha!!! Keep up the work!!! Just here to help!!

RicardoValdovinos commented 1 month ago

Update!

After doing some research, I decided to go with i18next + react-i18next instead of react-intl (as @cosmosdesigner suggested through his PR). It seems to be slightly more popular with an additional plugin system (including an ICU format plugin). I tried both react-intl and react-i18next and found the documentation and setup easier with react-i18next.

I also noticed react-i18next and its dependencies result in a larger bundle sizes overall but for the ease-of-use, documentation and feature set, it seems like a worthy tradeoff.

Having said that, I've updated the code base with a some small additions to get a minimal react-i18next setup working (again thank you to @cosmosdesigner for providing a reference). If you prefer react-intl, the changes required to replace react-i18next should be relatively small.

As far as the issue of lacking internationalization support goes, I think we can consider this resolved.

Check it out and let me know what you guys think!