Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fahaddsheikh's avatar

Making P2P Applications Multilingual

Okay, so we have been building a multiplayer multilingual quiz app, when you're playing with an opponent you'll both get one answer but in the language, you've selected.

What we're struggling with is how do we structure this relation in our DB, right now we have two columns one is languages and the other is quiz_questions and quiz_question_answers both of them contain the language id.

So we can tell that this question is English but with this structure, we cannot tell which of the french questions is the translation of this English question.

We've come to the conclusion that we need a translation_id which has to be the same for all translations of a question.

I would like to have feedback from all the great people here if there's a way to improve this structure or any potential problems we should be careful of

0 likes
2 replies
martinbean's avatar

@fahaddsheikh If it’s a quiz app then I assume there are questions, and then options (answers). So each question and answer option would have multiple translations.

When you deliver a question to the end users, you can then pick the translation that matches their locale preference. You’ll need to decide what to do if there isn‘t a translation for the locale they’ve picked though, i.e. if I’ve set my locale to Brazilian Portuguese but the question or answers don’t have a translation available for that locale.

fahaddsheikh's avatar

Yes, that is something we're tackling within the languages table but that is not my primary question.

My concern is :

Since this is P2P multiplayer, two players will be playing against each other simultaneously

Through the DB structure, how do we know which of the questions is the translation of the question you're seeing so we can display it to the user you're playing with.

So if your language is English and your opponent's language is French you both see the same question and answers but in different languages

Please or to participate in this conversation.