I recently built a SaaS landing page template with React, Vite and Tailwind CSS, and I wanted it to work in English, German, French, Chinese and Arabic . Arabic was the interesting one, because it needs a right-to-left (RTL) layout, not just translated text.
This post covers the setup I ended up with and the mistakes I made along the way. I am still learning, so if you know a better way to do any of this, please tell me in the comments.
You can try the result here: live demo
The stack
React + Vite
Tailwind CSS (v3.3 or newer, because of logical properties)
i18next , react-i18next , i18next-browser-languagedetector
npm install i18next react-i18next i18next-browser-languagedetector
Enter fullscreen mode
Exit fullscreen mode
1.…