Main Page | Report this Page
.NET DotNet Forum Index  »  ASP.NET Forum  »  Localization issue with master page....
Page 1 of 1    

Localization issue with master page....

Author Message
Savvoulidis Iordanis...
Posted: Mon Jun 29, 2009 6:42 am
Guest
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
 
miher...
Posted: Tue Jun 30, 2009 4:27 pm
Guest
"Savvoulidis Iordanis" <SavvoulidisIordanis at (no spam) discussions.microsoft.com> az
alábbiakat írta a következő üzenetben
news:D2E469BE-5A1A-414B-B614-F9CC3F6A54F5 at (no spam) microsoft.com...
Quote:
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
 
Rafael Malheiros...
Posted: Wed Jul 01, 2009 10:17 am
Guest
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" <SavvoulidisIordanis at (no spam) discussions.microsoft.com>
escreveu na notícia da
mensagem:D2E469BE-5A1A-414B-B614-F9CC3F6A54F5 at (no spam) microsoft.com...
Quote:
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
 
Savvoulidis Iordanis...
Posted: Wed Jul 01, 2009 3:08 pm
Guest
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.
 
Alexey Smirnov...
Posted: Thu Jul 02, 2009 2:23 am
Guest
On Jul 1, 11:08 pm, Savvoulidis Iordanis
<SavvoulidisIorda... at (no spam) discussions.microsoft.com> wrote:
Quote:
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.

It's a client id of the nested control.
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sat Nov 28, 2009 12:24 pm