Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Internationalization / January 2005

Tip: Looking for answers? Try searching our database.

Problem with CurrentUICulture and fallback

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Versteijn - 10 Jan 2005 09:18 GMT
Dear all,

I have written a simple localized application in ASP.NET. In my
global.asax I initialize CurrentUICulture with the culture found in
Request.UserLanguages(0).

On my test system, the culture is en-US, so my application switches to
en (fallback process) for which I have created a resource satellite
assembly. CurrentUICulture.Name seems to stay at 'en-US' though, while
I depend on the CurrentUICulture.Name in paths (e.g. for localized
images), and expect it to be 'en'!

What can I do to make this work? Can I determine which culture has
eventually been chosen, even when fallback is used? Or is there a
better solution to this?

Any suggestions are welcome.
Thank you in advance.

Freek Versteijn.
Michael (michka) Kaplan [MS] - 10 Jan 2005 15:44 GMT
Well, you want CurrentCulture to be a specific culture; if you want
CurrentUILanguage to be neutral then that is straightforward enough; just
set the CurrentCulture with the Request.UserLanguages(0) using the
CreateSpecificCulture method. You could then use the Parent to find the
neutral culture.

One warning -- you will want some exception handling in place to take care
of the times that "zh" happens to  be in accept language (since its not a
valid culture). This would apply to other "invalid" strings as well.

Signature

MichKa [MS]
NLS Collation/Locale/Keyboard Technical Lead
Globalization Infrastructure, Fonts, and Tools
Microsoft Windows International Division

This posting is provided "AS IS" with
no warranties, and confers no rights.

> Dear all,
>
[quoted text clipped - 16 lines]
>
> Freek Versteijn.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.