QuiiBz / next-international

Type-safe internationalization (i18n) for Next.js
https://next-international.vercel.app
MIT License
1.2k stars 54 forks source link

chore(docs): add rtl support #273

Closed gustaveWPM closed 8 months ago

gustaveWPM commented 8 months ago

Hello. I've added a documentation page about RTL support, as we previously discussed here: https://github.com/QuiiBz/next-international/issues/220

I've documented two possible implementations. However, the second, proposing an implementation based on a useEffect call, seems to be a bad choice, after some rethinking.

I've written the documentation for it anyway in this PR, but I think we should remove it because of the point I mentioned in "Caveat".

Note that this choice of implementation will cause an UI flickering when your user loads your web pages for the first time.
This is because the page will first be mounted with the default dir attribute value of your HTML node, then updates when the component including the useEffect is mounted. This will introduce CLS (Cumulative Layout Shift) issues.

As a reminder, we thought this might be a good idea here:

Thanks in advance for your review and for your feedback.

Closes https://github.com/QuiiBz/next-international/issues/220

vercel[bot] commented 8 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-international ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2023 9:01am
gustaveWPM commented 8 months ago

I had to proofread my contribution several times and refine it a little. I think I'm OK on my side for a review.