[wp-trac] [WordPress Trac] #17268: Use native gettext library when available
WordPress Trac
noreply at wordpress.org
Sun Aug 13 20:37:58 UTC 2017
#17268: Use native gettext library when available
-------------------------------------------+-----------------------------
Reporter: linushoppe | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: I18N | Version:
Severity: normal | Resolution:
Keywords: early has-patch needs-refresh | Focuses: performance
-------------------------------------------+-----------------------------
Comment (by Mte90):
This patch include the native gettext support and dynamic-mo-loader.
Probably is not the better way to add external libraries in WordPress but
to do performance analysis and debug I think that is good enough.
The native patch code became an alias to the gettext php version and this
class is used from WordpPress or dynamic-mo-loader.
Using my patch with WordPress with the native (php7.1-intl package on
VVV's ubuntu) show a difference of 300ms (using Yoast SEO plugin on the
settings page) without dinamyc-mo-loader.
With dynamic-mo-loader there is another boost of 50ms so 350ms instead the
gettext php version (probably because of the cache enabled in this library
there is this boost).
I created two filter for dynamic-mo-loader:
{{{#!php
<?php
add_filter( 'load_mo_dynamic', '__return_true' ); //there is another
parameter that is $domain
add_filter( 'load_mo_cache_mo_dynamic', '__return_true' ); //to enable the
cache
}}}
Both the filter are true on default so you can do all the test that you
want.
In any case dynamic-mo-loader contain few little improvements on the code
https://github.com/aucor/dynamic-mo-loader/pull/6 by me
--
Ticket URL: <https://core.trac.wordpress.org/ticket/17268#comment:85>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list