Very good
But my request to change the entire portal based on the language
I Change Default.aspx for Persian but is best to change Portal core for all language
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Scrolltop As HtmlControls.HtmlInputHidden = CType(Page.FindControl("ScrollTop"), HtmlControls.HtmlInputHidden)
If Scrolltop.Value <> "" Then
DotNetNuke.UI.Utilities.DNNClientAPI.AddBodyOnloadEventHandler(Page, "__dnn_setScrollTop();")
Scrolltop.Value = Scrolltop.Value
End If
'Bazrafshan
If (CultureInfo.CurrentCulture.ToString.ToLower = "fa-ir".ToLower) Then
PersianDate.ChangeCultureToPersian()
End If
End Sub
'Bazrafshan
Public Shared Sub ChangeCultureToPersian()
Dim info As New CultureInfo("fa-IR")
Dim dateTimeFormat As DateTimeFormatInfo = info.DateTimeFormat
dateTimeFormat.AbbreviatedDayNames = New String() {ChrW(1609), ChrW(1583), ChrW(1587), ChrW(1670), ChrW(1662), ChrW(1580), ChrW(1588)}
dateTimeFormat.DayNames = New String() {ChrW(1610) & ChrW(1705) & ChrW(1588) & ChrW(1606) & ChrW(1576) & ChrW(1607), ChrW(1583) & ChrW(1608) & ChrW(1588) & ChrW(1606) & ChrW(1576) & ChrW(1607), ChrW(1587) & ChrW(1607) & " " & ChrW(1588) & ChrW(1606) & ChrW(1576) & ChrW(1607), ChrW(1670) & ChrW(1607) & ChrW(1575) & ChrW(1585) & ChrW(1588) & ChrW(1606) & ChrW(1576) & ChrW(1607), ChrW(1662) & ChrW(1606) & ChrW(1580) & ChrW(1588) & ChrW(1606) & ChrW(1576) & ChrW(1607), ChrW(1580) & ChrW(1605) & ChrW(1593) & ChrW(1607), ChrW(1588) & ChrW(1606) & ChrW(1576) & ChrW(1607)}
dateTimeFormat.AbbreviatedMonthNames = New String() {ChrW(1601) & ChrW(1585) & ChrW(1608) & ChrW(1585) & ChrW(1583) & ChrW(1610) & ChrW(1606), ChrW(1575) & ChrW(1585) & ChrW(1583) & ChrW(1610) & ChrW(1576) & ChrW(1607) & ChrW(1588) & ChrW(1578), ChrW(1582) & ChrW(1585) & ChrW(1583) & ChrW(1575) & ChrW(1583), ChrW(1578) & ChrW(1610) & ChrW(1585), ChrW(1605) & ChrW(1585) & ChrW(1583) & ChrW(1575) & ChrW(1583), ChrW(1588) & ChrW(1607) & ChrW(1585) & ChrW(1610) & ChrW(1608) & ChrW(1585), ChrW(1605) & ChrW(1607) & ChrW(1585), ChrW(1570) & ChrW(1576) & ChrW(1575) & ChrW(1606), ChrW(1570) & ChrW(1584) & ChrW(1585), ChrW(1583) & ChrW(1610), ChrW(1576) & ChrW(1607) & ChrW(1605) & ChrW(1606), ChrW(1575) & ChrW(1587) & ChrW(1601) & ChrW(1606) & ChrW(1583), ""}
dateTimeFormat.MonthNames = New String() {ChrW(1601) & ChrW(1585) & ChrW(1608) & ChrW(1585) & ChrW(1583) & ChrW(1610) & ChrW(1606), ChrW(1575) & ChrW(1585) & ChrW(1583) & ChrW(1610) & ChrW(1576) & ChrW(1607) & ChrW(1588) & ChrW(1578), ChrW(1582) & ChrW(1585) & ChrW(1583) & ChrW(1575) & ChrW(1583), ChrW(1578) & ChrW(1610) & ChrW(1585), ChrW(1605) & ChrW(1585) & ChrW(1583) & ChrW(1575) & ChrW(1583), ChrW(1588) & ChrW(1607) & ChrW(1585) & ChrW(1610) & ChrW(1608) & ChrW(1585), ChrW(1605) & ChrW(1607) & ChrW(1585), ChrW(1570) & ChrW(1576) & ChrW(1575) & ChrW(1606), ChrW(1570) & ChrW(1584) & ChrW(1585), ChrW(1583) & ChrW(1610), ChrW(1576) & ChrW(1607) & ChrW(1605) & ChrW(1606), ChrW(1575) & ChrW(1587) & ChrW(1601) & ChrW(1606) & ChrW(1583), ""}
dateTimeFormat.AMDesignator = ChrW(1602) & "." & ChrW(1592)
dateTimeFormat.PMDesignator = ChrW(1576) & "." & ChrW(1592)
dateTimeFormat.ShortDatePattern = "yyyy/MM/dd"
dateTimeFormat.FirstDayOfWeek = DayOfWeek.Saturday
Dim calendar As New PersianCalendar
GetType(DateTimeFormatInfo).GetField("calendar", (BindingFlags.NonPublic Or (BindingFlags.Public Or BindingFlags.Instance))).SetValue(dateTimeFormat, calendar)
Dim objectValue As Object = RuntimeHelpers.GetObjectValue(GetType(DateTimeFormatInfo).GetField("m_cultureTableRecord", (BindingFlags.NonPublic Or (BindingFlags.Public Or BindingFlags.Instance))).GetValue(dateTimeFormat))
objectValue.GetType.GetMethod("UseCurrentCalendar", (BindingFlags.NonPublic Or BindingFlags.Instance)).Invoke(RuntimeHelpers.GetObjectValue(objectValue), New Object() {RuntimeHelpers.GetObjectValue(calendar.GetType.GetProperty("ID", (BindingFlags.NonPublic Or BindingFlags.Instance)).GetValue(calendar, Nothing))})
GetType(CultureInfo).GetField("calendar", (BindingFlags.NonPublic Or (BindingFlags.Public Or BindingFlags.Instance))).SetValue(info, calendar)
Thread.CurrentThread.CurrentCulture = info
Thread.CurrentThread.CurrentUICulture = info
CultureInfo.CurrentCulture.DateTimeFormat = dateTimeFormat
CultureInfo.CurrentUICulture.DateTimeFormat = dateTimeFormat
End Sub
|