My latest project idea is to create a site advertise a restaurant and one of the challenges ive set for me is to make it possible for users to choose it displayed in English or my native language. I would be glad if anyone that had experience with such project can give me recommendation on how to organise my data(the strings that will be representing titles, menus, paragraphs etc). The way i see it, i can either set one big object/array for one language and one for the other and include within identical cathegories, or i can define the cathegories and on every end point, i can set the text for one language and the text for the other. Ill try to visualise it with a very basic example:
//two objects for each language
const EN={
title: 'Welcome',
menu: 'Menu',
dishes: ['pizza', 'potatoes', 'salad']
}
const BG={
title: 'Добре Дошли',
menu: 'Меню',
dishes: ['пица', 'картофи', 'салата']
}
//one object offering values for each language
const data={
title: ['Welcome', 'Добре Дошли'],
menu: ['Menu', 'Меню'],
dishes: [['pizza', 'potatoes', 'salad'], ['пица', 'картофи', 'салата']]
}