S
Sreekanth
Hi,
I am trying to globalize my application by separating out all the strings
into resource files. For testing purpose, I have created two resource files.
MyApp.resx, MyApp.en-US.resx. These resx files are built into binary
resource files(.resources) and embedded into MyApp.exe by my make script.
The problem, Even after setting my machine culture to English -United
states, my application is always picking from the nuetral resource file. If
I dont link MyApp.resx(default resource file) during make, it is throwing
MissingManifestResourceException. While debugging, I found that CultureInfo
am getting using CurrentThread.CurrentCulture is giving the right culture
i.e en-US. Code snippet I have used is as below.
///////////////////////////
ResourceManager aResourceManager = new ResourceManager("Namespace.MyApp",
System.Reflection.Assembly.GetExecutingAssembly());
System.Globalization.CultureInfo aCultureInfo =
System.Threading.Thread.CurrentThread.CurrentCulture;
string test = aResourceManager.GetString("test", aCultureInfo); //Is always
picking from the string from the neutral resources file. Culture specific
string is never taken.
////////////////////////////
Could you please let me know where I am doing wrong.
Thanks,
Sreekanth.
I am trying to globalize my application by separating out all the strings
into resource files. For testing purpose, I have created two resource files.
MyApp.resx, MyApp.en-US.resx. These resx files are built into binary
resource files(.resources) and embedded into MyApp.exe by my make script.
The problem, Even after setting my machine culture to English -United
states, my application is always picking from the nuetral resource file. If
I dont link MyApp.resx(default resource file) during make, it is throwing
MissingManifestResourceException. While debugging, I found that CultureInfo
am getting using CurrentThread.CurrentCulture is giving the right culture
i.e en-US. Code snippet I have used is as below.
///////////////////////////
ResourceManager aResourceManager = new ResourceManager("Namespace.MyApp",
System.Reflection.Assembly.GetExecutingAssembly());
System.Globalization.CultureInfo aCultureInfo =
System.Threading.Thread.CurrentThread.CurrentCulture;
string test = aResourceManager.GetString("test", aCultureInfo); //Is always
picking from the string from the neutral resources file. Culture specific
string is never taken.
////////////////////////////
Could you please let me know where I am doing wrong.
Thanks,
Sreekanth.