youvsvirus / youvsvirus-unity

Unity version of the you vs virus game.
GNU General Public License v3.0
1 stars 1 forks source link

Add german language #60

Open holke opened 4 years ago

holke commented 4 years ago

The homepage is entirely german while the game texts are in english. We should add a german version of the texts and supply an option to switch languages.

holke commented 4 years ago

I am certain that there is a standard way in game development to support multiple languages, which we should look up.

My first idea was to have a global 2 dimensional dictionary "texts" with the two dimensions "language" and "description". Each text in the game is the actually a script whose update routine look up in the dictionary. For example for the restart button:

txt = texts[gameSettings.language]["RestartButtonText"]

where

texts["german"]["RestartButtonText"] = "Neustart"
texts["english"]["RestartButtonText"] = "Restart"

We can then have little german and english flags on one corner of the screen (in the menu) that can be used to switch the language.

Performance wise it does not seem too clever to update the content of each text in every frame. Are there also update routines that run like every 10 frames or so? A 1 second delay after switching the languages should not be a problem.

maccxs commented 4 years ago

if (Time.framecount % N == 0)

maccxs commented 4 years ago

called in Update. I also asked Thomas to give us access to the website. So we can make that multi-language too.

maccxs commented 4 years ago

But maybe there are infrequent update routines?

ThomasVoss commented 4 years ago

Access granted to @maccxs