-
AuthorPosts
-
VisiGod Friend
VisiGod
- Join date:
- January 2006
- Posts:
- 538
- Downloads:
- 0
- Uploads:
- 4
- Thanks:
- 76
- Thanked:
- 138 times in 18 posts
June 14, 2008 at 9:14 pm #129687Maybe you applied the solution for date translation, described in this thread.
But this is a shitty solution. There are much better ways to handle the date translation and I am more and more shocked in some of the ways JA codes their templates.
Although, this solution above will be hardly applied (well not impossible) on a multilanguage site, that is build with Joom!Fish in example. Than … what could we do 😉Open index.php of the template and replace this code:
<?php
echo "<span>".date ('l')."</span>";
echo " <div>".date ('M')." ".date ('d').date ('S')."</div>";
?>
With the following:
<?php echo JHTML::_('date', date(l), JText::_('DATE_FORMAT_LC5')) ?>
Now open the language file of the template (en-GB.tpl_ja_teline_ii.ini or the one in your language) and the following row at the end of the file:
DATE_FORMAT_LC5=<span>%A,</span><div>%d %B %Y</div>
That’s it. Hope it is useful.
4 users say Thank You to VisiGod for this useful post
avekic Friendavekic
- Join date:
- July 2007
- Posts:
- 71
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 14
- Thanked:
- 4 times in 1 posts
July 17, 2008 at 12:16 pm #260521what is “language file of the template”?
(J1.013.) there is no language file of the template in this version
:confused:
orpheus2510 Friendorpheus2510
- Join date:
- July 2007
- Posts:
- 149
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 14 times in 1 posts
July 17, 2008 at 7:26 pm #260576This solution is just for J1.5!
July 21, 2008 at 11:11 pm #261277I can’t get this to work.
When I do as explained above the template returns the string DATE_FORMAT_LC5 instead of the date. It seems not to recognize the date/language strings.Joomla! 1.5.2
kjellx Friendkjellx
- Join date:
- September 2006
- Posts:
- 10
- Downloads:
- 12
- Uploads:
- 0
- Thanked:
- 4 times in 1 posts
August 27, 2008 at 12:55 pm #267555I had the same problem as you jensl. What I did to get multilanguage date formats was to replace this from the index.php file:
<?php
echo "<span>".date ('l')."</span>";
echo " <div>".date ('M')." ".date ('d').date ('S')."</div>";
?>
with the following code for both norwegian and english date formats:
<div class="ja-day">
<?php if ($this->language=="nb-no") {
$day = date("l");
$daynum = date("j");
$month = date("F");switch($day)
{
case "Monday": $day = "mandag"; break;
case "Tuesday": $day = "tirsdag"; break;
case "Wednesday": $day = "onsdag"; break;
case "Thursday": $day = "torsdag"; break;
case "Friday": $day = "fredag"; break;
case "Saturday": $day = "lørdag"; break;
case "Sunday": $day = "søndag"; break;
default: $day = ""; break;
}switch($month)
{
case "January": $month = "januar"; break;
case "February": $month = "februar"; break;
case "March": $month = "mars"; break;
case "April": $month = "april"; break;
case "May": $month = "mai"; break;
case "June": $month = "juni"; break;
case "July": $month = "juli"; break;
case "August": $month = "august"; break;
case "September": $month = "september"; break;
case "October": $month = "oktober"; break;
case "November": $month = "november"; break;
case "December": $month = "desember"; break;
default: $month = ""; break;
}echo $day . " " . $daynum .". " . $month . " " . $year;
}
?>
<?php if ($this->language=="en-gb") {
echo "<span>".date ('l')."</span>";
echo " <div>".date ('M')." ".date ('d').date ('S')."</div>";
}
?>
</div>
Now it works fine with my template.
August 28, 2008 at 5:22 pm #267730Wohooo! Nu funker det!
The suggestion above by kjellx fixed my problem. Thanks kjell
gaygiorgia Friendgaygiorgia
- Join date:
- June 2008
- Posts:
- 218
- Downloads:
- 0
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 15 times in 1 posts
August 29, 2008 at 6:39 am #267793omfg wake up naps, a dedicated thread exists about this old solution… -.-
when i’ve time i’ll try your solution visigod 😉 -
AuthorPosts
This topic contains 7 replies, has 6 voices, and was last updated by gaygiorgia 16 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum