I don't have any code for this yet (I have no idea on how to start), but I was planning to make this game (RPG), where one of the special features is a 'language' selection thing.

I experimented using a static class to show the different dialogue lines (to keep the code clean) which are set in two separate .cs files. One for English, or for some other language.

Now, the game asks the player to select the language before the game loads. I wanted to do something that when the player selects, let's say English, the EnglishLanguage.cs file 'loads' it, and ignores the existence of the SomeOtherLanguage.cs, even though they have the same class name and methods inside. I want to to something like this so that I can add more languages into the game eventually.

How can I do this?

~VZ

Make one version.
Store all your label names, button captions, dialoges, questions etc. in a resource in as many languages as you like. Then when the user has choosen a language, set all of your UI elements and variables accordingly.
Serialization is perhaps another possibility.
Success!

Edited 5 Years Ago by ddanbe: n/a

Then when the user has choosen a language, set all of your UI elements and variables accordingly.

That line confused me a little bit.

Tho, thanks for the response. I've researched about resources, and I think I can find the answer in there. Thanks!

This article has been dead for over six months. Start a new discussion instead.