Forums

Availability Calendar
how to change months language? (6 posts)

  1. anoldboy
    Member
    Posted 5 months ago #

    I have installed the "availability" plugin and it works fine. Now I want to change the months in my language. Could you please help me with this?

    thank you.

    http://wordpress.org/extend/plugins/availability/

  2. MatthiasHeil
    Member
    Posted 4 months ago #

    I would also love to learn about this. The easiest way would be hard coding the months' names just like the days' abbreviations in calendar.php

  3. MatthiasHeil
    Member
    Posted 3 months ago #

    Pleeaase!-)

  4. MatthiasHeil
    Member
    Posted 3 months ago #


  5. innovader
    Member
    Posted 3 months ago #

    Hi there!
    Add this array at the beginning of the for-loop in calendar.php:

    <?php for ($month = 1; $month <= 12; $month++) : ?>
    <?php
    $trans = array (
        'January'   => 'Januar',
        'February'  => 'Februar',
        'March'     => 'März',
        'May'       => 'Mai',
        'June'      => 'Juni',
        'July'      => 'Juli',
        'October'   => 'Oktober',
        'December'  => 'Dezember',
    );
    $ger_month = date('F Y', mktime(0, 0, 0, $month, 1, $this->year));
    $ger_month = strtr($ger_month, $trans);
    ?>

    And change

    <th colspan="7"><?=date('F Y', mktime(0, 0, 0, $month, 1, $this->year))?></th>

    into:

    <th colspan="7"><?php echo $ger_month;?></th>

    You can add the ignored months (cause they are equal to german) in the array to change them into other languages.

  6. planetshaker
    Member
    Posted 1 month ago #

    Thanks, worked great for me!

Reply

You must log in to post.

About this Plugin

About this Topic