Availability Calendar
[resolved] how to change months language? (9 posts)

  1. anoldboy
    Posted 4 years 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.


  2. MatthiasHeil
    Posted 4 years 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
    Posted 4 years ago #


  4. MatthiasHeil
    Posted 4 years ago #

  5. innovader
    Posted 4 years ago #

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

    <?php for ($month = 1; $month <= 12; $month++) : ?>
    $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>


    <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. Albert
    Posted 4 years ago #

    Thanks, worked great for me!

  7. lonerlz
    Posted 4 years ago #

    how would this work in a multilingual site?

  8. MatthiasHeil
    Posted 3 years ago #

    Fantastic - thanks!-)

  9. Steve
    Posted 3 years ago #

    Hi all,

    It's been a while since I have made any adjustments to this particular plugin. Today there was some time to re-visit it and I have made a number of adjustments.

    • Bug fix for changing calendars when using the default permalink structure.
    • Changed permissions to allow users with page edit permission to manage calendars.
    • Calendar output now conforms to the "Week Starts On" setting found in "Settings > General".
    • Month and day names now make use of localisation.
    • Introduction of multiple calendars.
    • Added ability to exclude the default stylesheet.
    • The number of years shown can now be modified.
    • Fixed unexpected output during activation.
    • Moved uninstall process to uninstall.php.

    If anyone can help test the version in development it would be greatly appreciated.


    Please note there is a possibility that this plugin is unstable.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Availability Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic