473,408 Members | 2,888 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,408 software developers and data experts.

Globalization of ASP.NET applications problem

I'm hoping someone here can help with this one as I've
been looking all around for a solution to this and I've
yet to find one that is satisfactory.

I'm trying to add support for different languages to my
ASP.NET project. I have read the docs in MSDN and several
sites and newsgrops but still can't get this working as
advertized.

I have created string resources in both a .txt and a .resx
and get the same results with both. I have tried using
VS.NET to compile the satellite assemblies for me and I
have built them myself.

I have the following problems:
When I let VS.NET build my .resx files by adding them to
the project, it correctly creates the satellite assemblies
and places them in bin/en-GB/appname.resource.dll and
thats fine. However when I use ildasm to look at the dll I
see that the name of the resource section is the fully
qualified namespace of my app with the culture on the end.
I have no problem with using the full app name but the
culture should not be there from what I've seen since I
have to specify this name on the constructor to
ResourceManager and I want multiple cultures. This means
given that I have a resx called strings.en-GB.resx and
assuming a namespace of Namespace.Something.App I have to
create a resource manager like this:

new ResourceManager("Namespace.Something.App.strings.e n-
GB")

which is not good. I can get around this problem by
manually building using resgen and al but from what I see
this should work without the en-GB on the end.

The second, and probably more major problem since I cannot
get around it, is that when I write code that matches all
of the examples it looks like the satellite assemblies are
not being found.

Assembly a = Assembly.GetExecutingAssembly();
ResourceManager rm = new ResourceManager("myapp", a);
errorMsg.Text = rm.GetString("PAGE_ERROR");

I've checked that the current UI and thread culture is en-
GB but nothing is being retrieved from the en-GB
satellite. Its as though it cannot be found and it falls
back to culture neutral.

When I try this explicitly setting the satellite it works
fine eg.

Assembly a = Assembly.GetExecutingAssembly
().GetSatelliteAssembly(CultureInfo.CurrentUICultu re);

Its as though the resource manager is not looking up the
satellite assembly. Obviously I don't want to have to use
code like the above since I'd have to have different
resource managers for each culture which sort of defeats
the point. I've been over this so many times now, I must
be missing something obvious but I can't see what it is.

Hopefully someone can help me with one or both of these
problems. Preferably the latter if they can but both would
be nice.

Thanks

Rob Garfoot
Nov 18 '05 #1
2 1935
Ok I've got this working now, I have absolutely no idea
what I did but it works.
-----Original Message-----
I'm hoping someone here can help with this one as I've
been looking all around for a solution to this and I've
yet to find one that is satisfactory.

I'm trying to add support for different languages to my
ASP.NET project. I have read the docs in MSDN and several
sites and newsgrops but still can't get this working as
advertized.

I have created string resources in both a .txt and a .resxand get the same results with both. I have tried using
VS.NET to compile the satellite assemblies for me and I
have built them myself.

I have the following problems:
When I let VS.NET build my .resx files by adding them to
the project, it correctly creates the satellite assembliesand places them in bin/en-GB/appname.resource.dll and
thats fine. However when I use ildasm to look at the dll Isee that the name of the resource section is the fully
qualified namespace of my app with the culture on the end.I have no problem with using the full app name but the
culture should not be there from what I've seen since I
have to specify this name on the constructor to
ResourceManager and I want multiple cultures. This means
given that I have a resx called strings.en-GB.resx and
assuming a namespace of Namespace.Something.App I have to
create a resource manager like this:

new ResourceManager("Namespace.Something.App.strings.e n-
GB")

which is not good. I can get around this problem by
manually building using resgen and al but from what I see
this should work without the en-GB on the end.

The second, and probably more major problem since I cannotget around it, is that when I write code that matches all
of the examples it looks like the satellite assemblies arenot being found.

Assembly a = Assembly.GetExecutingAssembly();
ResourceManager rm = new ResourceManager("myapp", a);
errorMsg.Text = rm.GetString("PAGE_ERROR");

I've checked that the current UI and thread culture is en-
GB but nothing is being retrieved from the en-GB
satellite. Its as though it cannot be found and it falls
back to culture neutral.

When I try this explicitly setting the satellite it works
fine eg.

Assembly a = Assembly.GetExecutingAssembly
().GetSatelliteAssembly(CultureInfo.CurrentUICult ure);

Its as though the resource manager is not looking up the
satellite assembly. Obviously I don't want to have to use
code like the above since I'd have to have different
resource managers for each culture which sort of defeats
the point. I've been over this so many times now, I must
be missing something obvious but I can't see what it is.

Hopefully someone can help me with one or both of these
problems. Preferably the latter if they can but both wouldbe nice.

Thanks

Rob Garfoot
.

Nov 18 '05 #2
On Fri, 21 Nov 2003 02:22:19 -0800 Rob Garfoot wrote:
Rob Garfoot wrote:
Ok I've got this working now, I have absolutely no idea
what I did but it works.


Does it work on another server than the one you are developing on?
Michael
Nov 18 '05 #3

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

Similar topics

3
by: Xavier MT | last post by:
Hi, I have a site that has some text in spanish and it doesn't display well, for example with a ñ it displays some weird boxes, can anyone help me or point me to some help
0
by: FM | last post by:
Hi, I use the following code to set the current culture. If Not IsNothing(Session("language")) Then System.Threading.Thread.CurrentThread.CurrentCulture = New...
1
by: francois | last post by:
hi, I have an ASP.NET application with a piece of code that looks like this: (it is a VB.NET snippet) Thread.CurrentThread.CurrentCulture = New CultureInfo(Session.Item("Culture").ToString)...
0
by: Frédéric Mayot | last post by:
Hi, I developped a framework in a class library. This framework is used by web applications and contains the web form base class. I want the base class to contain a resource manager in order to...
11
by: Cor Ligthert | last post by:
Hello everybody, Jay and Herfried are telling me every time when I use CDate that using the datetime.parseexact is always the best way to do String to datetime conversions. They don't tell why...
2
by: jason | last post by:
DOTNET 2.0 VS 2005. My client is saying August 13,2006.. julian date should equal 225. Here's what I'm doing: <%@ Import Namespace="system.globalization" %> <script language="VB"...
2
by: Terry Olsen | last post by:
I'm a bit confused on how to make my app work in all cultures, particularly with parsing the date out of a string. I read dates from different web sites. The formats I've run into include...
5
by: Basildk | last post by:
Hi. I have a strange problem. We have an asp.net application running on several server with different setups. On 2 of our servers we experience that the globalization settings are misbehaving....
0
by: Sparkiee | last post by:
Hi, A lil bit of help required from you guys, I am trying to make a windows service that will also focus on globalization, the problem i am facing is when i am trying to put globalization code in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.