Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Multi Lingual web sites using .net


Message #1 by Sridhar Raj G <Sridharr@i...> on Fri, 8 Mar 2002 18:18:56 +0530
Hi.,

	Thanks in advance

	Can any one help out in locating sites/sample codes where i can get

sample code for creating multi lingual 	web sites using .net 

	i have been just assigned this work to be done.

	Please help me. In this regards

	

With Regards

Sridhar G

 

Message #2 by "Jean-Christophe Cauvin" <jean-christophe.cauvin@m...> on Fri, 8 Mar 2002 17:17:57 +0100
This is a multi-part message in MIME format.



------=_NextPart_000_02D2_01C1C6C5.30CB2080

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Hi Sridar,



I did some work for standard english (en) and french (fr). I did the

following:



1. create 2 assembly resource files in your project (File->Add New 

Item...

Assembly Resource Files). For example strings.resx and strings.fr.resx

2. fill the resource files by using the editor of Visual Studio.NET

3. build the solution. VS.NET will create one satellite assembly for the 



french resources under the bin directory of your project

(bin/fr/projectName.resources.dll). English resources are contained in 

the

main dll of your project (bin/projectName.dll).

4. then edit you global.asax.vb file:

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

        Try

            Thread.CurrentThread.CurrentCulture =3D

CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))

        Catch

            Thread.CurrentThread.CurrentCulture =3D new 

CultureInfo("en")

        End Try

        Thread.CurrentThread.CurrentUICulture =3D

Thread.CurrentThread.CurrentCulture

        Application("RM") =3D New ResourceManager("projectName.strings", 



Me.GetType().Assembly.GetExecutingAssembly)

End Sub

5. To get a string identified by "home_welcomeLabel) from the resources:



    ...

    Protected WithEvents home_welcomeLabel As

System.Web.UI.WebControls.Label

    ...

    Dim rm as ResourceManager

    rm =3D Application("RM")

    home_welcomeLabel.Text =3D rm.GetString("home_welcomeLabel")



I hope it will help. If you change your language from Internet Explorer, 



you should get the right resource in the language you choose. I also

suggest that you use a program named Reflector to see the content of 

your

main dll.



  ----- Original Message -----

  From: Sridhar Raj G

  To: ASP+

  Sent: Friday, March 08, 2002 1:48 PM

  Subject: [aspx] Multi Lingual web sites using .net





  Hi.,

  Thanks in advance

  Can any one help out in locating sites/sample codes where i can get

  sample code for creating multi lingual web sites using .net

  i have been just assigned this work to be done.

  Please help me. In this regards



  With Regards

  Sridhar G

  












  Return to Index