473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem accessing string resources

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.CurrentCultu re;

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.


Nov 16 '05 #1
1 2041
When I try to call ResourceManager.GetResourceSet() for the current thread's
culture, Am getting null. Any idea why it is so?
Thanks,
Sreekanth.
"Sreekanth" <sr*******@yahoo.com> wrote in message
news:cs*********@news.mch.sbs.de...
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.CurrentCultu re;

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.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Frank L | last post by:
Greetings, I am somewhat puzzled by a difference that occurs when I compile my web application out of VS.NET or if I compile it through NAnt. The issue is with how the resources get compiled into...
3
by: Jagdip Singh | last post by:
Hi, We are facing problem accessing to DB2. Seems like database manager is down I tried starting it using db2start but it was neither showing any messages nor returning to command prompt...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
2
by: Fredrik Rodin | last post by:
All, I'm having problems with my resource manager in ASP.NET 2.0 after conversion from ASP.NET 1.1. Here is a background: In ASP.NET 1.1 All my user controls and aspx pages inherit from...
8
by: Ben Fidge | last post by:
Hi I have a small WinForms app that needs to copy files from a shared drive on a network. If I connect to the mapped drive using Explorer, a password dialog pops-up and I have to provide...
3
by: C-Services Holland b.v. | last post by:
Hi all, I've created a custom button which I can stick into my toolbox. This all works well and I see my button in the designer. This button uses customised graphics and I want to stick it in...
1
by: Damien \zaide\ Desmarets | last post by:
Hi, I have a little problem with the 2.0 framework. I use a web farm with 2003 server and IIS. I have installed SFU 3.5 to use NFS on windows, it works great with ASP.NET 1.1 and IIS 6.0. So I...
4
by: TCook | last post by:
Hey All, I am building a solution which will have many strings that will need to be localized (i.e. strings for toolbars, strings for different WinForms, strings for messages and error messages,...
0
by: ramesh.nrk | last post by:
Hi, I am developing a windows application which should support different language for this I am using "Resource Manager" default in .net framework. Here I am developing dll for Resource because...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.