1

I have a fully working code, written for Windows, built with Visual Studio.

What I want to do, is to add another language to that software. My idea is to have two flags (one English and one German) in the window corner, and to have the language change when user clicks on one of the flags.

What is the common, and best way to do this kind of thing?

So far, my idea is to create two files, and to store all the strings that software will use in those files. One file would hold all strings in English, and the other file will hold all strings in German. Then, I believe that, when a click on a flag icon is detected, software would load all the strings in a list, or vector, or something similar, and then, I would just printout whichever string i need with vector.at(i).

Also, how would I save the currently used language on application exit, so the next time the app is started, that language is used?

Rorschach
  • 734
  • 2
  • 7
  • 22
  • This is a common issue known as internationalization or i18n. Have a look at [this question](http://stackoverflow.com/questions/195497/resources-for-i18n-in-c). – TartanLlama Jul 01 '15 at 09:36
  • And this http://stackoverflow.com/questions/203886/internationalisation-in-visual-studio – Miki Jul 01 '15 at 09:38

1 Answers1

0

The most commonly used way is more or less same as your idea. Also, to store currently used language on exit, you can create a configuration file writing the lang at application exit and read it on app start.

Shreevardhan
  • 12,233
  • 3
  • 36
  • 50