I'm an entry-level developer working on an e-commerce project using Laravel 10 and Vue.js 3. I've already set up i18n for translations in Vue.js, but now I'm struggling with structuring my database to support multilingual product data.
The website admin should be able to add products in two languages. I'm wondering if there's a recommended approach, library, or best practice to make this process simpler.
Should I store translations in separate tables, use JSON columns, or is there a package that helps with this? Any guidance would be greatly appreciated!
Thanks in advance!
So far, I’ve considered two possible approaches:
Using a JSON column in the database to store translations for product names, descriptions, etc. This seems simple but might make querying and filtering data more complicated. Creating a separate translations table with columns like product_id, language, name, and description. This approach seems more structured but adds complexity to queries and relationships. I expected to find a Laravel package that simplifies multilingual database handling, but I haven't found one that fits my case well. I'm looking for guidance on the best approach to balance performance, maintainability, and ease of use.