Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Localization

Reply
Thread Tools

Localization

 
 
Bruno Alexandre
Guest
Posts: n/a
 
      03-24-2006
Hi Guys,

I'm driving crazy here with Localization issue, this is what I have now:

masterpage.master - with some asp:linkbutton like this:

<asp:LinkButton PostBackUrl="~/login/Default.aspx" ID="lnkLogout"
runat="server" Text="<%$ Resources:language, menu_logout %>" />


Default.aspx - with some labels and Dropdowns for Login propose and in
the top of the page:
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="login_Default" Culture="auto:en-US"
UICulture="auto" %>

in Default.aspx.vb one of other thinks is:

Protected Overrides Sub InitializeCulture()
Dim lang As String = Request("ddLanguage")
If lang IsNot Nothing Or lang <> "" Then
Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang)
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(lang)
End If
End Sub


and it works FINE!
but the language choose in this DEFAULT.ASPX file is not the same in the
other pages of the website, it only overrides the CultureInfo in this
DEFAULT.ASPX file...


How can I choose a language in the Default.aspx and have THAT language
across HOLE Webpage?

I'm USING GlobalResources and a Resource called Language.resx with
several for other languages like:

Language.pt.resx
Language.fr.resx
Language.da.resx

etc...


Anyone Know how can I manage this?

I already watch this HOW TO...
> ASP.NET HOW DO I Video Series: Localization
>

http://msdn.microsoft.com/asp.net/le...t/default.aspx


but this example is just for one page (even using globalResources)


Thanks in Advance.

Bruno Alexandre
"a Portuguese in KÝbenhavn, Danmark"

 
Reply With Quote
 
 
 
 
Jules
Guest
Posts: n/a
 
      03-27-2006
As far as I can see, you have two options;

1) Move the code you have in the InitializeCulture() method to the
Global.asax Application_BeginRequest(Object obj, EventArgs e)

2) Create a base-page class of which all your pages inherit from.
Implement the InitializeCulture() method in this base class. I
personally chose to use the 2nd option because I can't work with
cookies and I store this info in the user info in a session. And I
couldn't find a way to access the Session object from the
Applicaiton_BeginRequest() method.

Hope this helps.

BTW, can anybody tell me if this is a (best/good) practice?

Kind regards,

Jules

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Localization Supported control jagdish patel ASP .Net 0 08-04-2003 01:43 PM
Problems with Enterprise Localization Framework and .NET FW 1.1 MarkMurphy ASP .Net 1 07-21-2003 08:58 AM
Can We Run Localization Toolkit in Commandline ??? Manish Pansiniya ASP .Net 6 07-14-2003 11:57 AM
ASP.NET page localization problems jmjacquel@solaire.com ASP .Net 3 07-10-2003 09:10 AM
help with localization Joe Glover ASP .Net 2 07-09-2003 12:06 PM



Advertisments