WordPress.org

Ready to get started?Download WordPress

Forums

HOWTO: make localization work on 64 bit systems (3 posts)

  1. hmans
    Member
    Posted 8 years ago #

    WordPress' localization support seems to be broken on 64bit systems. Apply the changes as described below to wp-includes/gettext.php to make it work. You will need to add one line and change another.

    (around line 100 in gettext.php:)


    $this->enable_cache = $enable_cache;

    // $MAGIC1 = (int)0x950412de; //bug in PHP 5
    $MAGIC1 = (int) - 1794895138;
    // $MAGIC2 = (int)0xde120495; //bug
    $MAGIC2 = (int) - 569244523;
    $MAGIC3 = (int) 2500072158; // <- 64 BIT FIX: ADD THIS LINE!

    $this->STREAM = $Reader;
    $magic = $this->readint();
    if ($magic == $MAGIC1 || $magic == $MAGIC3) { // <- 64 BIT FIX: CHANGE THIS LINE!
    $this->BYTEORDER = 0;
    } elseif ($magic == $MAGIC2) {
    $this->BYTEORDER = 1;
    } else {
    $this->error = 1; // not MO file
    return false;
    }

  2. Fairweb
    Member
    Posted 7 years ago #

    Thanks ! I was getting mad with this ! The problem occured for me on version 2.0.5 and I finally sorted it out with your solution.

  3. MajusC00L
    Member
    Posted 7 years ago #

    Hi

    It worked just fine to fix my admin panel and my date formatting that had changed fom french to english for no reason a few days ago. This solution brought everything back in french.

    Efficient and simple

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic