0

I have a program that has several languages but to change language you have to edit app.config file before or after restarting. My goal is to localize the project so I can change the language at runtime. The language translation lists are in XML files. How can ı resource them and be able to change language onruntime with a combobox or if you have suggeestions I am open to it.

public static void LoadLang(string PLang) { 
    try { 
        FileStream fs = new FileStream(PLang, FileMode.Open); 
        DSLang = CsvLibrary.readCsv(";",fs).Tables[0]; 
        fs.Close(); 
    } catch (Exception E) { 
        MessageBox.Show(MultiLang.GetText("Message97") + E.Message);  
        //MessageBox.Show("Language load error : " + E.Message); 
    } 
}
Kalana
  • 5,631
  • 7
  • 30
  • 51
  • most of the time codes help us to identify best suitable answer for an question rather than details. – Kalana Dec 16 '19 at 05:51
  • @Kalana yeah ı agree but the code isnt gonna be really usefull here since ı will change it all the way around if ı want it on runtime. Right now the programs reads the app.config get csv files and replaces the string. But it does it in launch after that to change the language you have to restart. I know that ı need to resource these language files but cant get my head around the actual solution thx. – Bearsomeness Dec 16 '19 at 06:02
  • You need to read and learn about using resource files for language switching in application. – Chetan Dec 16 '19 at 06:36
  • @chetanRanpariya I agree but ı dont know much about resourcing a xml file. If anyone else have some valuable information as well that would be lovely . – Bearsomeness Dec 16 '19 at 12:23
  • You need to read and learn if you don't know about resource files. That will give you valuable information. read [here](https://stackoverflow.com/questions/1142802/how-to-use-localization-in-c-sharp) and [here](https://www.codeproject.com/Articles/5447/NET-Localization-using-Resource-file) – Chetan Dec 17 '19 at 08:04

0 Answers0