HighTechTalks DotNet Forums  

Localization Problem

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss Localization Problem in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Srinivas Chintakindi
 
Posts: n/a

Default Localization Problem - 11-15-2005 , 12:52 AM






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



Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: Localization Problem - 11-18-2005 , 01:30 PM






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.





Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default RE: Localization Problem - 11-18-2005 , 01:32 PM



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/de...us/dnvs05/html
/ASP2local.asp


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.