The MU forums have moved to WordPress.org

language error (strange) (9 posts)

  1. Bloggproffs
    Member
    Posted 10 years ago #

    Hi im using the swedish .Mo file to translate my wpmu-admin, it worked up and untill a few months ago, i think it was about juli when it stoped working, does anyone have the same problem, or any idea on what might be going on?

    i have created a "languages" folder in wp-include, and inserted my.mo files.
    i have in wp-config.php inserted this line: define ('WPLANG', 'sv_SE'); and in mu-admin-options i have selected swedish as default. altough default language is still english, i can select the swedish file in the drop down, but even if i do and save my settings, language is still english, i think this problem occured when i switched over to 1.2.4 (i am now in 1.2.5a)

  2. andrewbillits
    Member
    Posted 10 years ago #

    I'm definetely not an expert on the multiple language bit. However try tossing the .mo file in "wp-content/languages". I think that is what WP is migrating to instead of "wp-includes/languages".

    Thanks,
    Andrew

  3. Bloggproffs
    Member
    Posted 10 years ago #

    Hi andrew, tried your sugestion, but this only caussed the .mo file to disapear from language-dropdown chooise.

    Any other ideas?

  4. Bloggproffs
    Member
    Posted 10 years ago #

    this is driving me nuts, anyone have any ideas?

  5. Bloggproffs
    Member
    Posted 10 years ago #

    my wp-config.php says:
    ('WPLANG', 'sv_SE'); is there any error in this?

    and my .mo file is named: sv_SE.mo

    edit: sorry for the double post, ment to edit.

  6. Bloggproffs
    Member
    Posted 10 years ago #

    well ok found the solution:

    in wp-includes/gettext.php

    fix this: (row 106)

    $this->enable_cache = $enable_cache;

    // $MAGIC1 = (int)0x950412de; //bug in PHP 5.0.2
    $MAGIC1 = (int) - 1794895138;
    // $MAGIC2 = (int)0xde120495; //bug
    $MAGIC2 = (int) - 569244523;
    // 64-bit fix
    $MAGIC3 = (int) 2500072158;

    $this->STREAM = $Reader;
    $magic = $this->readint();
    if ($magic == ($MAGIC1 & 0xFFFFFFFF) || $magic == ($MAGIC3 & 0xFFFFFFFF)) { // to make sure it works for 64-bit platforms
    $this->BYTEORDER = 0;
    } elseif ($magic == ($MAGIC2 & 0xFFFFFFFF)) {
    $this->BYTEORDER = 1;
    } else {
    $this->error = 1; // not MO file
    return false;
    }

    WITH THIS:

    $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;
    }

    please include this in the new release.

    Best regards - Fredrik

  7. Bloggproffs
    Member
    Posted 10 years ago #

    an addon: it only fixes problems with 64-bit windows and linux/freebsd platforms

  8. Pegan
    Member
    Posted 9 years ago #

    Thanks Bloggproffs for this fix, it works as it should.

  9. Bloggproffs
    Member
    Posted 9 years ago #

    Well mi just glad to be able to help someone ellse, i myself take so much info and knowledge from this forum.

    - Fredrik Näs

About this Topic

  • Started 10 years ago by Bloggproffs
  • Latest reply from Bloggproffs