WordPress.org

Forums

New php-gettext, speed up WordPress l10n (6 posts)

  1. nicokaiser
    Member
    Posted 10 years ago #

    As anyone who uses foreign language support in WordPress 1.5 may have noticed, switching to language to something other than english slows down WordPress. On my server, no request was finished in under 2 seconds.

    So I had a look at the "gettext.php" and optimized it a little bit (pushes request time down to 0.1 secs again), and Danilo Segan (the author and maintainer of php-gettext) made a new release with these changes:

    https://savannah.nongnu.org/projects/php-gettext/

    1. Download the package
    2. Replace gettext.php and streams.php (in wp-includes)

    Additionally you can replace
    $input = new FileReader($mofile)
    in function load_textdomain (wp-l10n.php) with
    $input = new CachedFileReader($mofile)
    which also saves a few microseconds.

    Would be nice if this would be integrated into WordPress 1.5.1 (any developers here?)

    Nico.

  2. Nico,

    If you want this in 1.5.1 file a request on mosquito and it may make it into 1.5.1

    westi

  3. nicokaiser
    Member
    Posted 10 years ago #

  4. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    Thanks. Great work.

  5. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

  6. mastamind
    Member
    Posted 10 years ago #

    Wow! This patch is incredible... Load time from >= 6 sec to <=2 sec! Again... WOW and thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.