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 / November 2005

Tip: Looking for answers? Try searching our database.

Localization Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Srinivas Chintakindi - 15 Nov 2005 05:52 GMT
Hi all,

I am developing one webapplication in asp.net with C#. This application has
to support localization. I created the complete application here in my
development environment but the localization part was done in my
HeadQuarters. The localization team can give all the supported language
resource files in the form of .resx files. All the .resx files will be saved
into separate folder which is not in my web application project metadata. I
am creating a single satelite assembly out of all the available .resx files
using ResGen.exe and AL.exe's. Resgen will create the .RESOURCE files from
the .Resx file and AL.exe will embed all the .RESOURCE files into single
satelite assembly.

In my webform code i am getting the localized string as follows.

LocRM = new ResourceManager("MyStrings.ja",
Assembly.LoadFile("C:\MyStrings.resources.dll"));

string Message = LocRM.GetString("msg");

The above code is working fine in normal conditions but it doesnot support
fallback feature. If the "MyStrings.ja" resource is not embedded in the
MyStrings.resources.dll file it should get the string from the default
resource called "MyStrings.en". The default resource is english MyStrings.en
will be always embedded in the assembly.

I am instantiating the ResourceManager class as above and the first
parameter i am passing will come dynamically from one function based on the
clients browser settings. So if the specified resource file is not available
it should get the string from default resource file. So please help me how
to do this. Providing code sample will greately helps me. Is i am doing in
correct way to support localization from the separate single satelite
assembly or is there any better way to do this?

Thanks in advance.

Srinivas Chintakindi
Marin Millar - 18 Nov 2005 18:30 GMT
I think the problem is that you are specifying the culture name when
creating your ResourceManager and you are trying to load the resource file
instead of the main assembly.  This overrides the ResourceManager internal
resource loading logic.  The ResourceManager will always search for the
appropriate .dll based on the culture.   Try something like this:

      LocRM = new ResourceManager("MyStrings", Assembly.Load("MyStrings"));
Hope this helps.
Marin Millar - 18 Nov 2005 18:32 GMT
I should also mention that ASP 2.0 now has better localization support, so
that you don't need to create your own ResourceManager.  Take a look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html
/ASP2local.asp

Rate this thread:







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.