Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • olivermd Friend
    #119720

    Hi,

    Is it possible to change the Date in other languages?

    Monday to Montag an so on ?

    best regards from Germany

    nathanbohn Friend
    #218191

    You will have to check with your hosting company to make sure you PHP has you local language installed. You will have to edit the index.php of the template. Go to templates/ja_teline/index.php
    Around Line 214 or find

    <div class="ja-day">
    <?php
    echo "<span>".date ('l')."</span>";
    echo " <div>".date ('M')." ".date ('d').date ('S')."</div>";
    ?>
    </div>

    and replace it with

    <div class="ja-day">
    <?php
    setlocale(LC_TIME, "de_DE");
    echo "<span>".strftime ('%A')."</span>";
    echo " <div>".strftime ('%b')." ".strftime ('%d').strftime (' ')."</div>";
    ?>
    </div>

    The setlocale(LC_TIME, ” “)shows what locale you are changing to. If your site is on a windows box you will need to look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp
    to find the correct locale code, in this case you would replace de_DE with germany.

    PS. The above code drops the english 2 letter suffix after the date number. so 17th becomes just 17, which makes the month and date appear on the same line. Someone may be able to help you straighten that out.

    nathanbohn Friend
    #218192

    if you wanted to still keep the 2 letter suffix you can change the last
    .strftime (' ').
    to
    .date ('S').

    pluriel72 Friend
    #218200

    Oder Du machst es so:

    [PHP]<div class=”ja-day”>
    <?php
    setlocale(LC_TIME, “de_DE”);
    echo “<span>”.strftime (‘%A’).”</span>”;
    echo ” <div>”.strftime (‘%d.’).strftime (‘%b’).” “.strftime (‘%Y’).strftime (‘ ‘).”</div>”;
    ?>
    </div>[/PHP]

    nathanbohn Friend
    #218205

    all available date displays are found at
    http://us2.php.net/manual/en/function.strftime.php

    mikeho1980 Friend
    #218375

    <?php
    setlocale(LC_TIME, "zh_HK.UTF-8");
    echo "<span>".strftime ('%A')."</span>";
    echo " <div>".strftime ('%b')."<br />".strftime ('%e').strftime (' ')."</div>";
    ?>

    For UTF-8 website, add .UTF-8

    Ferjoom Friend
    #218379

    Tks for the belp 🙂

    JanKoen Friend
    #218741

    I needed it too. Thank you!

    oddcstrand Friend
    #218764

    Hi!
    I live in Norway. On my page: http://www.kvinesdalsiden.net
    the date is “Monday 23 April” this is wrong because it is Tuesday 24 April in Norway. Has this something to do with me using sitegrund, which is based in the USA. How can I apply a time difference to this date..?

    zorcolino Friend
    #218774

    Hi
    thank you for code . Was chaning it and get the correct Date in German. within the calendar situated in the right top within Teline. However, the day besides the calendar remains still in English ( Tuesday instead of Dienstag). Can you please tell me how to change this. I would really apreciate your input.
    Kind regards

    ErikThorsen Friend
    #218790

    @oddcstrand:

    You can set server timezone difference in the global configuration in your backend. I assume this would solve your problem. Lykke til!

    seralpro Friend
    #218795

    Thanks for the help, i just changed mine to Spanish 🙂

    <div class="ja-day">
    <?php
    setlocale(LC_TIME, "es_ES");
    echo "<span>".strftime ('%A')."</span>";
    echo " <div>".strftime ('%b')." ".strftime ('%d').strftime ('')."</div>";
    ?>
    </div>

    zorcolino Friend
    #219058

    Hi Erik
    sorry for getting back to the date question again. I checked all posts in this forum, checked everything, but still get a messy date back. Iset code for German language :
    <div class=”ja-day”>
    <?php
    setlocale(LC_TIME, “de_DE.UTF-8”);
    echo “<span>”.strftime (‘%A’).”</span>”;
    echo ” <div>”.strftime (‘%b’).” “.strftime (‘%d’).strftime (”).”</div>”;
    ?>
    </div>I
    but still get day in English on frontpage, and date without day in content articles, like
    Tuesday, . April 2007
    I really dont know whats wrong.Do you have a proposal?
    Many Thanks

    seralpro Friend
    #219062

    Did you try changing to the correct language in global settings?

    borisn Friend
    #219108

    Language of my site is russian, code page – RU_ru.1251. I changed this value in Your example? but the date format in calendar is still english.
    Help me please!

Viewing 15 posts - 1 through 15 (of 27 total)

This topic contains 27 replies, has 20 voices, and was last updated by  ambiental 13 years, 9 months ago.

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