Globalisation help needed.

J

Jensen bredal

Hello there,

I need to implement globalisation in my asp.net app.

I have chosen to use text files to contains my string and use
ResGen.exe to build ressource dlls


I have written the following code in Global.asax.cs



*************
protected void Application_Start(Object sender, EventArgs e)

{



Assembly a = Assembly.GetExecutingAssembly();


ResMan = new ResourceManager("MyNameSpace.strings",
a); //My public Global resource member tha i use in // forms to access
resources.


}

.....

.......



.........


protected void Application_BeginRequest(Object sender, EventArgs e)

{

try

{

if (Request.UserLanguages != null)

Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(Request.UserLanguages[0]);

else

// Default to English if there are no user languages

Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-us");

Thread.CurrentThread.CurrentUICulture =
Thread.CurrentThread.CurrentCulture;

}

catch

{

Thread.CurrentThread.CurrentCulture = new
CultureInfo("en-us");

//ex.

}

}


*************




i have of course build my string.Language-code.text with resgen.exe

Finally , in my my aspx.cs i use

rm= Global.Resman
to acces the string as follow:


Label.Text = rm.GetString("MyString"); where
MyString = Localtring in string.Language-code.text



when i lunch the application , i get the following error:

System.Resources.MissingManifestResourceException: Could not find any
resources appropriate for the specified culture (or the neutral culture) in
the given assembly. Make sure "MyNamespace.strings.resources" was correctly
embedded or linked into assembly "BouyOnsale". baseName: MyNamespace.strings
locationInfo: <null> resource file name: MyNamespace.strings.resources
assembly: BouyOnsale, Version=1.0.1640.35778, Culture=neutral,
PublicKeyToken=null

......................


Any idea what i'm doing wrong?



Thanks in advance

JB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top