Welcome to Dream.In.Code
Become an Expert!

Join 150,068 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,796 people online right now. Registration is fast and FREE... Join Now!




Multi Language(Localization)

 
Reply to this topicStart new topic

Multi Language(Localization)

seko
26 Feb, 2008 - 06:40 AM
Post #1

New D.I.C Head
*

Joined: 8 Nov, 2007
Posts: 14


My Contributions
when the user select language , page language changing to selecting language via localresource files but if user click another link of a page ,language returning the default value.
I am waiting your detailed answers.

vb

Protected Overrides Sub InitializeCulture()
If Request.Form("ListBox1") IsNot Nothing Then
Dim selectedLanguage As String = _
Request.Form("ListBox1")
UICulture = Request.Form("ListBox1")
Culture = Request.Form("ListBox1")
Thread.CurrentThread.CurrentCulture = _
CultureInfo.CreateSpecificCulture(selectedLanguage)
Thread.CurrentThread.CurrentUICulture = New _
CultureInfo(selectedLanguage)
End If
MyBase.InitializeCulture()
End Sub


This post has been edited by PsychoCoder: 27 Feb, 2008 - 09:24 PM
User is offlineProfile CardPM
+Quote Post

seko
RE: Multi Language(Localization)
27 Feb, 2008 - 01:05 AM
Post #2

New D.I.C Head
*

Joined: 8 Nov, 2007
Posts: 14


My Contributions
this code is working but if I use masterpage it does not working.

vb

Protected Overrides Sub InitializeCulture()
'string culture = Request.Form["ddSelLanguage"];
Session("Language") = Request.Form("ListBox1")
Dim culture As String = Session("Language")

If String.IsNullOrEmpty(culture) Then
culture = "Auto"
End If

'Use this
UICulture = culture
Culture = culture
'OR This
If culture <> "Auto" Then
Dim MyCltr As System.Globalization.CultureInfo = New System.Globalization.CultureInfo(culture)
System.Threading.Thread.CurrentThread.CurrentCulture = MyCltr
System.Threading.Thread.CurrentThread.CurrentUICulture = MyCltr
End If
MyBase.InitializeCulture()
End Sub


This post has been edited by PsychoCoder: 27 Feb, 2008 - 09:24 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 10:52PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month