Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • VisiGod Friend
    #129687

    Maybe 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.

    avekic Friend
    #260521

    what is “language file of the template”?

    (J1.013.) there is no language file of the template in this version

    :confused:

    orpheus2510 Friend
    #260576

    This solution is just for J1.5!

    jensl Friend
    #261277

    I 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 Friend
    #267555

    I 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.

    jensl Friend
    #267730

    Wohooo! Nu funker det!

    The suggestion above by kjellx fixed my problem. Thanks kjell

    gaygiorgia Friend
    #267793

    omfg wake up naps, a dedicated thread exists about this old solution… -.-
    when i’ve time i’ll try your solution visigod 😉

Viewing 7 posts - 1 through 7 (of 7 total)

This topic contains 7 replies, has 6 voices, and was last updated by  gaygiorgia 16 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum