I want to support multiple languages NPC dialogues in my multiplayer game. So for example, if a player selects the English language he should see NPC dialogs in English and if he selects Korean he should see them in Korean.
My dialogs are written in the groovy script and being handled at the server-side. And I will keep dialogue translations in JSON files.
Should I return a translated dialog page to the players directly from the server-side or I should just return a dialogue page id and do the translation at the client-side? for the later, I need to keep a copy of my dialogues JSON translations at the client.
Sometimes I would also need to format the text before displaying it. For example, an NPC dialogue text might look like
Hi <playerName> !
the playerName should be replaced by an actual name.
I am not sure if I should do all this stuff at the server-side or at the client-side.
To me, the client ‘dialog’ code should be as dumb as possible. Everything should come from the server.
…but I don’t know what your dialogs look like.
Usually, it’s some prompt text at the top and then a set of options. Then I’d have a generic UI that can display a prompt and some options. Get the prompt and the options from the server and then send back the selected prompt… repeat as necessary.
I had a common library I used for this once upon a time… there will surely be something like it in MOSS eventually.