We started with an audit of Velobici's codebase and quickly found out that there was one main problem we had to solve before making content translatable.
The challenge was that content was coming from 3 different places: Sanity CMS, Swell e-commerce platform, and the code itself.
So we started by migrating as much content as possible to Sanity, and only leaving products related content on Swell, which makes it easier to translate in places like the Cart.
We used Sanity's official internationalization plugin along with Next.js built-in internationalized routing feature to enable translation for each page.
To avoid any redundant code, we created GROQ utility queries to pull translations from Sanity for a specific language and fallback to English if the translated content doesn't exist.