c# - managing MultiLanguage resources -
i have created 2 resource files in project globalres.ge.resx
, globalresources.en.resx
i receive language input parameters . want know how can read values based on language. example if string lang = "en"
globalres.welcome
should see wolcome if choose lang = "ge"
globalres.welcome
should willkommen (i have created welcome line in both files)
the resource designer load appropriate text based on currentuiculture
system.threading.thread.currentthread.currentuiculture = system.globalization.cultureinfo.getcultureinfo("en-us"); bcancel.text = resource.cancel;
in .net 4.5 , later can use following properties set defaultthreadcurrentculture & defaultthreadcurrentuiculture culture.
cultureinfo.defaultthreadcurrentculture = system.globalization.cultureinfo.getcultureinfo("en-us"); cultureinfo.defaultthreadcurrentuiculture = system.globalization.cultureinfo.getcultureinfo("en-us");
Comments
Post a Comment