WordPress.org

Forums

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

  1. anoldboy
    Member
    Posted 3 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.

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

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

    Pleeaase!-)

  4. MatthiasHeil
    Member
    Posted 3 years ago #


  5. innovader
    Member
    Posted 3 years 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. Al Bee
    Member
    Posted 3 years ago #

    Thanks, worked great for me!

  7. lonerlz
    Member
    Posted 2 years ago #

    how would this work in a multilingual site?

  8. MatthiasHeil
    Member
    Posted 2 years ago #

    Fantastic - thanks!-)

  9. Steve
    Member
    Posted 2 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.

    http://downloads.wordpress.org/plugin/availability.zip

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

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic