wwjih123 .
VS2017
1- ( ). lang_en, lang_tr, lang_fr ..
2 - then the object properties window leaves the assembly action as an embedded resource
3-inside the lang_tr.resx file add a new line lbl_error and the value "Hata" in Turkish (whatever)
4- inside the class, the variables are defined as:
ResourceManager res_man; // declare Resource manager to access to specific cultureinfo
5-in class initialization after InitializeComponent ();
Console.WriteLine("You are speaking {0}",
System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);
res_man = new ResourceManager("MyApp.lang_"+ System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName, Assembly.GetExecutingAssembly());
lblError.Text = res_man.GetString("lbl_error");
If your ui language is Turkish, it will automatically download lang_tr.resx, if the English lang_en.resx file is downloaded, etc ...
luck
source
share