FAQ / Server Products

How can I make News2Web output dates in other languages?
You can change the HTML template to do this via javascript. The following example changes the the day of the week and month to French. Note, you can change the default templates to apply the change to all pages that have not already been changed.

In the HTML Header template, add the following javascript before the </head> tag:

<script type="text/javascript">
function fnConvertDate(strDate)
var strOut;
var strArr = strDate.split(" ");

if(strArr[0]=="Mon,") strOut = "Lundi";
else if(strArr[0]=="Tue,") strOut = "Mardi";
else if(strArr[0]=="Wed,") strOut = "Jeudi";
else if(strArr[0]=="Thu,") strOut = "Mercredi";
else if(strArr[0]=="Fri,") strOut = "Venredi";
else if(strArr[0]=="Sat,") strOut = "Samedi";
else if(strArr[0]=="Sun,") strOut = "Dimanche";

strOut += ", " + strArr[1] + " ";

if(strArr[2]=="Jan") strOut += "Janvier";
else if(strArr[2]=="Feb") strOut += "Février";
else if(strArr[2]=="Mar") strOut += "Mars";
else if(strArr[2]=="Apr") strOut += "Avril";
else if(strArr[2]=="May") strOut += "Mai";
else if(strArr[2]=="Jun") strOut += "Juin";
else if(strArr[2]=="Jul") strOut += "Julliet";
else if(strArr[2]=="Aug") strOut += "Août";
else if(strArr[2]=="Sep") strOut += "Septembre";
else if(strArr[2]=="Oct") strOut += "Octobre";
else if(strArr[2]=="Nov") strOut += "Novembre";
else if(strArr[2]=="Dec") strOut += "Décembre";

strOut += " " +strArr[3];


Then change the Story Template to from:

<tr><td><font size=-2><?HXM_SOURCE?>, <?HXM_DATE?></font></td></tr>


<tr><td><font size=-2><?HXM_SOURCE?>, <script type="text/javascript">fnConvertDate('<?HXM_DATE?>');</script></font></td></tr>

(and make the same change to the Header Template date). This is just an example, there are other ways to acheive the same result may be more efficient - please feel free to let us know if you have one!

There are also the following guides: