Localization issue with master page.

  • Thread starter Thread starter Savvoulidis Iordanis
  • Start date Start date
S

Savvoulidis Iordanis

Starting to practice localization/globalization, I have a master page
containing a autopostback combobox (XML datasource based) with all the
languages my site supports. What should I write (and where, content or
master?) so that when the user selects a language, the current page refreshes
and displays texts in the new language?

All my .resx files are created in advance, for all languages, but I can't
figure out how to active them in the new language. I don't want to depend
only on browser language settings, but let the user select a language he
wants.

In the master page, I tried (VB):

Page.UICulture = combo_language.Value
Page.Culture = combo_language.Value

but i see no changes after refresh.

In the browser settings, I have deleted all languages in the list, but still
no changes after refresh, although language dependent database data are
displayed, using code that gets the selected lang, as a session parameter

TIA
 
Starting to practice localization/globalization, I have a master page
containing a autopostback combobox (XML datasource based) with all the
languages my site supports. What should I write (and where, content or
master?) so that when the user selects a language, the current page refreshes
and displays texts in the new language?

All my .resx files are created in advance, for all languages, but I can't
figure out how to active them in the new language. I don't want to depend
only on browser language settings, but let the user select a language he
wants.

In the master page, I tried (VB):

Page.UICulture = combo_language.Value
Page.Culture = combo_language.Value

but i see no changes after refresh.

In the browser settings, I have deleted all languages in the list, but still
no changes after refresh, although language dependent database data are
displayed, using code that gets the selected lang, as a session parameter

TIA

Please check this
http://groups.google.com/group/micr....aspnet/browse_thread/thread/3e6485f062589e24
 
"Savvoulidis Iordanis" <[email protected]> az
alábbiakat írta a következő üzenetben
Starting to practice localization/globalization, I have a master page
containing a autopostback combobox (XML datasource based) with all the
languages my site supports. What should I write (and where, content or
master?) so that when the user selects a language, the current page
refreshes
and displays texts in the new language?

All my .resx files are created in advance, for all languages, but I can't
figure out how to active them in the new language. I don't want to depend
only on browser language settings, but let the user select a language he
wants.

In the master page, I tried (VB):

Page.UICulture = combo_language.Value
Page.Culture = combo_language.Value

but i see no changes after refresh.

In the browser settings, I have deleted all languages in the list, but
still
no changes after refresh, although language dependent database data are
displayed, using code that gets the selected lang, as a session parameter

TIA

Hi,

Scott Stanfield does what You would like with a simple page in this video :
http://www.asp.net/learn/videos/video-40.aspx
It could be used as a good starting point.

Hope You find this useful.
-Zsolt
 
Hi,
To change culture you should override da InitializeCulture Event

protected override void InitializeCulture()

The problem is that the SelectIndexChangedEvent of the DropDownList in the
MasterPage happens after the InitializeCulture of the Content Page. So you
cannot use the information.

Better then use master pages create a base class that inherits from Page and
overrides da InitiCulture Event and then use it as your base class instead
of Page;

I'll give you a exemple using queryStrings

protected override void InitializeCulture()
{

try
{
UICulture = Request.QueryString["cult"];
}
catch (Exception)
{


}


base.InitializeCulture();
}

I hope it helps.

Rafael Malheiros

"Savvoulidis Iordanis" <[email protected]>
escreveu na notícia da
mensagem:D[email protected]...
 
I already did that. I found out what was wrong. For some reason, the name of
the combo in the request.form collection is not just let's say
"combo_language" but "ctl100_combo_language_VI" (I remind I use a
masterpage). I don't know what the "_VI" suffix is, but it worked for me. I
found that out, looking in the request.form.keys collection.
 
I already did that. I found out what was wrong. For some reason, the nameof
the combo in the request.form collection is not just let's say
"combo_language" but "ctl100_combo_language_VI" (I remind I use a
masterpage). I don't know what the "_VI" suffix is, but it worked for me.I
found that out, looking in the request.form.keys collection.

It's a client id of the nested control.
 
Back
Top