Register   Login
     
  Latest Posts  
RE: News Articles Tokens
by ray-isc on 3/21/2010 3:04 PM
RE: Can'd add photo
by rsobari on 3/21/2010 10:17 AM
Tracking image/file clicks
by spirit on 3/21/2010 8:46 AM
Catcha doesnt seem to work
by chaloum on 3/20/2010 8:16 PM
RE: Recently created articles are not shown in list
by atriage on 3/20/2010 10:15 AM
RE: Recently created articles are not shown in list
by spirit on 3/20/2010 10:08 AM
RE: Introducing the most powerful News Slider for Ventrian News Articles
by jhoelz on 3/19/2010 9:29 PM
Rich Snippets for Review, Ratings etc!
by georgelew on 3/19/2010 7:49 PM
Recently created articles are not shown in list
by atriage on 3/19/2010 11:18 AM
RE: News Articles Tokens
by spirit on 3/19/2010 10:43 AM
  Forums  
Subject: ArticleView Page not localizable
Prev Next
You are not authorized to post a reply.

Page 1 of 212 > >>
Author Messages
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


5/30/2009 2:56 AM  

I have installed News Articles 00.07.39 on DNN 5. i have some problems :

1) Comments and post comments not localizable on ArticleView Page

2) Post Rating not localizable on ArticleView Page

3) Date/Time not localiable on ArticleView Page and Year not localizable on Archives Page(mounth have not problem on Archives page)

 

Regards,

Mehran

Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


5/30/2009 3:09 AM  
You can change them in the templates e.g. view.item.html

For the date time, you can pick your own date formatting, e.g. [CREATEDATE:MMM dd yyyy]

The only spot I can't see this working is in a multiple language per single portal format.

Scott McCulloch
Site Administrator
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


5/30/2009 3:29 AM  

Thank you, about Date/Time, I have customized and changed date and time dynamically in Default.aspx.vb

Private Sub Page_Load (..)

      MY changes DateTimeFormatInfo

End Sub

This changes work fine in all Portal pages and standard modules also work fine in "Current Articles" and "My Articles" but not working in "ArticleView" and "Archive" part of News ArticlesModule.

I use this Date/Time Customization and work fine with other modules like Feedback Center.

 

Warm Regards,

Mehran

 

Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


5/30/2009 7:05 PM  
So is everything OK now?

Scott McCulloch
Site Administrator
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


5/31/2009 12:44 AM  

My problem with Date/Time in ArticleView and Archives pages exist, I try to describe in previous message. something is different in this two pages. you could easily test it, only replace attached defalt.aspx.vb file with standard file located in DNN root.

 

Regards,

Mehran

 

 

 


Attachment: Default.aspx.zip

Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


6/01/2009 5:02 AM  
I don't really want to recompile my dotnetnuke install.

Are you saying that the date format is not changing? If not, please use the date expressions to format the date as posted earlier.

[CREATEDATE:MMM dd yyyy]

You can substitute the MMM dd yyyy with any combination of characters, e.g. MM for a shortern month.

You can find more about .net datetime formats here

Or you can just use [CREATEDATE], [PUBLISHDATE], etc in your template only. This will use the "d" format string which will be the configured date format for that locale.


Scott McCulloch
Site Administrator
nafisehUser is Offline
Registered Users

Posts:25


6/01/2009 5:02 AM  
Hi

I've got the same problem.

In two templates (Listing.Item.html and View.Item.html) same token is used for date [PUBLISHSTARTDATE:MMMM dd, yyyy HH:mm] .
It seems that they should behave like each other. in listing the persian calendar works fine but in view mentioned calendar doesn't work.

As Mehran told we changed the default.aspx.vb file. So it's universal. Actually changing the format of date is not enough for us because we need shamsi date. Also [CREATEDATE:MMM dd yyyy] act the same and can't help us.

Do you have any guidance for us? Localization of date is necessary for news and we really need it.

Looking forward an answer!

Regards,

Nafiseh
Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


6/01/2009 5:10 AM  
When you say "doesn't work", do you mean the CSS calendar? It's not really clear.

If you can provide a link to a live article, it may help.

Scott McCulloch
Site Administrator
Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


6/01/2009 5:11 AM  
Also - I'm not sure what "shamsi date" is.

Scott McCulloch
Site Administrator
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


6/01/2009 6:11 AM  

Recompile is not needed, it is easy and safe, only replace default.aspx.vb (I attached in my previes message) with original file in your running website ( and take a copy backup ), Recompile is not needed.only view it in browser. As Nafiseh told Localization of date is necessary for news and we really need it, it is not changing date format, Shamsi date is specially for persian culture and is deferent from gregorian calendar. please take a loot at below URL :

http://www.codeproject.com/KB/vb/Hijri_Shamsi_Date.aspx?fid=254936&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=1371550

As you know computer calendar work with gregorian calendar and any other kind of calendars need to convert from gregorian, we do it by some changes in default.aspx.vb ( install versian of DNN ) . Only two part of of NewsArticles Module have problem and i sure you could fix it for all persian users :) . ArticleView" and "Archive" .

I hope to be clear.

Regards,

Mehran

Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


6/01/2009 6:25 AM  
Mehran,

I still don't know what is the issue.

What are you expecting it to display? Can you try and do what I suggested? Change the template to use something like [PUBLISHDATE] in your template as opposed to the one that has the date format in it.

Please provide "specific" examples of what it is displaying and what you expect it to display. Also, where it is working, show me what it is displaying (and where).

Scott McCulloch
Site Administrator
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


6/01/2009 6:40 AM  
Scott

Please look at below URLs, This is live sample :

http://www.tebyan-kz.ir/tabid/56/Default.aspx

http://www.tebyan-kz.ir/tabid/56/articleType/ArticleView/articleId/1/--ACD.aspx

And let me know, Is it clear.

Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


6/01/2009 6:47 AM  
I can see the date "05/03/1388", I expect that is the issue.

But can you please try my suggestion:-

Change the template to use something like [PUBLISHDATE] in your template as opposed to the one that has the date format in it.

Scott McCulloch
Site Administrator
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


6/01/2009 7:06 AM  
I changed [PUBLISHSTARTDATE:MMMM dd, yyyy HH:mm] to [PUBLISHDATE:MMMM dd, yyyy HH:mm] in View.Item.html

You can see again

MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


6/01/2009 7:09 AM  
NewArticles Search module not work for persian language too, "smirabolg" help me to fix it in

http://www.ventrian.com/Support/ProductForums/tabid/118/forumid/3/tpage/1/view/topic/postid/40270/Default.aspx#44004

I hope this bug fix in next release too.
Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


6/01/2009 7:11 AM  
Please change it to [PUBLISHDATE] only.

No date expression at all.

Scott McCulloch
Site Administrator
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


6/01/2009 7:13 AM  
And as you can see in button of
http://www.tebyan-kz.ir/tabid/56/Default.aspx

in NewsArchives :

May (Month)-----converted ------>>> ارديبهشت ( Shamsi Month)
But
Year 2009 -------//----->>> 1388 (not converted )(Shamsi Year)
MehranUser is Offline
Registered Users
Ventrian Super Newbie
Ventrian Super Newbie
Posts:17


6/01/2009 7:15 AM  
Now changed to [PUBLISHDATE] only, no date expression.
nafisehUser is Offline
Registered Users

Posts:25


6/01/2009 9:52 PM  
Hi again

Just let me describe about the differences of gregorian calendar and persian calendar

2009/06/06 in gregorian calendar is 1388/03/12 in persian calendar

in .net we can use a simple convert to change the date to persian

for example with a control user which I explain below:

we have a variable called enDate which contains gregorian date. with using System.Globalization and insert the below code in page_load of our user control in Visual studio we can convert the date to persian one. It's just a sample with c#:

namespace PersianDate
{
public partial class PersianDateCo : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{

DateTime enDate;
string faDate;
string faYear;
string faMonth;
string faDay;

PersianCalendar pc = new PersianCalendar();
faYear = pc.GetYear(enDate).ToString();
faMonth = pc.GetMonth(enDate).ToString();
faDay = pc.GetDayOfMonth(enDate).ToString();
faDate = faYear + "/" + faMonth + "/" + faDay;

lblPersianDate.Text = faDate.ToString();

}
}
}

But what we have done with dotnetnuke. We just change the default.aspx.vb :
we use these namespaces:

Imports System.IO
Imports DotNetNuke.Entities.Tabs
Imports DotNetNuke.Security.Permissions
Imports DotNetNuke.UI.Skins
Imports DotNetNuke.UI.Utilities
Imports System.Reflection
Imports System.Globalization
Imports System.Threading

and add below code in page_load

Dim strLang As String = System.Globalization.CultureInfo.CurrentCulture.ToString()
If strLang = "fa-IR" Then
ChangeCultureToPersian()
End If

and this function:

Public Shared Sub ChangeCultureToPersian()

Dim calture As New CultureInfo("fa-IR")

Dim info As DateTimeFormatInfo = calture.DateTimeFormat

info.AbbreviatedDayNames = New String() {"ى", "د", "س", "چ", "پ", "ج", "ش"}

info.DayNames = New String() {"يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"}

info.AbbreviatedMonthNames = New String() {"فروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دي", "بهمن", "اسفند", ""}

info.MonthNames = New String() {"فروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دي", "بهمن", "اسفند", ""}

info.AMDesignator = "ق.ظ"

info.PMDesignator = "ب.ظ"

info.ShortDatePattern = "dd/MM/yyyy"

info.FirstDayOfWeek = DayOfWeek.Saturday

Dim PersianCal As New PersianCalendar

GetType(DateTimeFormatInfo).GetField("calendar", (BindingFlags.NonPublic Or (BindingFlags.Public Or BindingFlags.Instance))).SetValue(info, PersianCal)

Dim obj As Object = GetType(DateTimeFormatInfo).GetField("m_cultureTableRecord", (BindingFlags.NonPublic Or (BindingFlags.Public Or BindingFlags.Instance))).GetValue(info)

obj.GetType.GetMethod("UseCurrentCalendar", (BindingFlags.NonPublic Or BindingFlags.Instance)).Invoke(obj, New Object() {PersianCal.GetType.GetProperty("ID", (BindingFlags.NonPublic Or BindingFlags.Instance)).GetValue(PersianCal, Nothing)})

GetType(CultureInfo).GetField("calendar", (BindingFlags.NonPublic Or (BindingFlags.Public Or BindingFlags.Instance))).SetValue(calture, PersianCal)

Thread.CurrentThread.CurrentCulture = calture

Thread.CurrentThread.CurrentUICulture = calture

CultureInfo.CurrentCulture.DateTimeFormat = info

CultureInfo.CurrentUICulture.DateTimeFormat = info

End Sub


This method should change the Date to persian in any place. In ventrian news article module in two place the date change to persian correctly but in the main view as Mehran told, still stay in gregorian date. It seems the codes for date which is used within differenet part of this module are not the same. Because the date in 2 of them are converted easily and in right way but others remain as before in gregorian date.
Scott McCullochUser is Offline
Administrators
Ventrian Master
Ventrian Master
Posts:17204


6/01/2009 10:28 PM  
Posted By Mehran on 6/01/2009 7:15 AM
Now changed to [PUBLISHDATE] only, no date expression.


And what happened? Lets get it working in view article only first.


Scott McCulloch
Site Administrator
You are not authorized to post a reply.
Page 1 of 212 > >>

Forums > General > Bugs & Problems > ArticleView Page not localizable



ActiveForums 3.7