Wednesday, March 21, 2012

Localization

Hello,

I am working on a web site which is using localization features since it will uses various languages.

I have a button to switch from one language to another. I am converting it to AJAX.

Usually I have a class from which every page inherits so when the language it is changed the page is refresh and that class changes culture (see the class at the end of this post)

Now, by using AJAX I suppose all I need to do is to place all the localized content inside Update Panels so when I switch language those panels content will be updated with the new culture. right?

This is confusing me.


Thanks,

Miguel

' Config
Public Class Config
Inherits Page

' Culture | Initialize Culture
Protected Overrides Sub InitializeCulture()

' Call base class implementation
MyBase.InitializeCulture()

' Get culture from profile
Dim culture As String = CType(Context.Profile, ProfileCommon).Settings.Culture

' Check if user has requested specific culture
If (culture IsNot Nothing) AndAlso (culture <> "Auto") Then

' Assign culture UI
MyBase.UICulture = culture

' Assign culture with region
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture)

End If

End Sub ' InitializeCulture

End Class ' Config

Try to take a look at this reading about Ajax & Localization -http://blog.languagetranslation.com/public/item/126228

No comments:

Post a Comment