Localizing problem

R

Robert Dufour

I been stepping through the code as described in the videos for Master pages
and site Navigation and the one for localization.

I get the idea behind both but I'm trying to put em together to put together
a web site that is localized AND uses master pages, whose controls (labels
etc.) can also be localized.

This is the code I came up with in the Defaultaspx page to permit the
modification of the controls depending on a language seleceted in the
dropdown list on the page, in my default.aspx.vb file (language1 is the name
of the dropdownlist on that page)
Imports System.Globalization

Imports System.Threading

Partial Class _Default

Inherits System.Web.UI.Page

Protected Overrides Sub InitializeCulture()

Dim loc As String = Request("language1")

If Not IsNothing(loc) Or loc <> "" Then

Thread.CurrentThread.CurrentUICulture = New CultureInfo(loc)

Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(loc)

Else

Thread.CurrentThread.CurrentUICulture = New CultureInfo("fr-CA")

Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture("fr-CA")

End If

Session("Locale") = loc

End Sub

If I include the default.aspx file in a master page, the
Request("language1") remains at nothing, how should I handle the change of
language in the dropdownlist when using master pages. I thought it would
remain handled the same way.

Also when I change the language selected in the default page, I will need to
change the contents of controls that are on the master page, how can I do
that?

I was thinking just now of placing the language selector on the master page
and have a change there 'trickle down' to all the other open pages, is this
possible and if so how?

If anyone has sample bits of code for doing this I would appreciate it very
much

Regards,

Bob
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,818
Messages
2,569,727
Members
45,664
Latest member
Phil79581

Latest Threads

Top