Changing the display language

I am making a game in C, in which I want the user to select the language they want to play in by choosing from a predefined list of languages.

Any idea how I could implement this idea?
You could have the text saved to different files and determine which one to load based on what language the user chooses if that makes and sense. Lazy Example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
int Language;
std::ifstream TextFile;

std::cout << "Choose A Language\n1: English\n2: Spanish";
std::cin >> Language;

if(Language == 1)
{
    TextFile.open("EnglishVersionOfText.txt", std::ios_base::in);
}
else
{
    TextFile.open("SpanishVersionOfText.txt", std::ios_base::in);
}
I'll try and implement this!

Also, I am sorry it is irrelevant to the question I asked but is there a way to change d colour of the outpouts produced?
but how will I perform different operations if i use a text file.
I basically want to replace the output questions or statements displayed on the screen to be in different language depending on what d user chooses without affecting the operations performed by the program
I read a tutorial online a while back that said you could use the system() function to do that, but you're better off just getting a graphics library. You'll need a graphics or gaming library anyways to get a game going in C++ that isn't text-only.
Thanks the language problem is sorted!

What is a system() function though?
closed account (18hRX9L8)
Don't use system(). http://www.cplusplus.com/forum/articles/11153/
use the concol library and setcolor(). http://www.cplusplus.com/articles/2ywTURfi/
Topic archived. No new replies allowed.