[wp-trac] [WordPress Trac] #17268: Use native gettext library when available

WordPress Trac noreply at wordpress.org
Wed Apr 5 09:41:16 UTC 2023


#17268: Use native gettext library when available
-------------------------------------------------+-------------------------
 Reporter:  linushoppe                           |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  I18N                                 |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-refresh needs-unit-  |     Focuses:
  tests dev-feedback                             |  performance
-------------------------------------------------+-------------------------

Comment (by swissspidy):

 > What if we went to an associative PHP array for our strings?
 >
 > {{{
 > <?php
 > return array( 'English string' => 'translated string' );
 > }}}
 >
 > How would performance look? We'd take a bit of a hit for loading the
 file, but it'd avoid the overhead of parsing a MO file, could be opcode-
 cached, etc.
 >
 > ryan, nikolay, and I have discussed this as an idea over the years, but
 we've never tried it out.

 If anyone's curious, I've started experimenting with that over at the
 Preferred Languages feature project: https://github.com/swissspidy
 /preferred-languages/pull/659

 Initial memory consumption and performance results are positive.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/17268#comment:110>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list