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

WordPress Trac noreply at wordpress.org
Tue Sep 26 12:38:44 UTC 2017


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

Comment (by Mte90):

 I spent few hours working on this days and the last patch fix many unit
 tests but showed many issue between the native module and the POMO
 implementation in WordPress.
 First of all they work in a different way, while in WordPress you can have
 the access to all the strings/entries in an array with the native is not
 possible because it is everything in the memory so many unit tests are not
 useful for native.
 Also the headers on gettext are not available but the unit tests use them
 and the only way to get that values is to parse the text.
 So many methods used in the unit tests are not available but I backported
 a few about the export that the native doesn't include so probably will be
 better to split up the code to avoid a duplication between different
 classes.
 Debug with gettext is very difficult because actually my patch is not
 working anymore and I don't understand why in any case the code now is
 more clean and organized.
 The native method use also the cache from the webserver so there can be
 issue with that when someone update the files.
 Again the unit tests doesn't use a textdomain but check only the methods
 so probably the native methods needs a specific suite of unit tests.
 In any case to cover the needs of unit tests is required a parse of the mo
 files that there is the issues on performance (without consider the
 cache).

 What are the next steps? Someone else that try the various patch (the
 17268.2.diff is wrong is incomplete) and give their feedbacks or help me
 on fix the various issue because alone is a difficult task.

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


More information about the wp-trac mailing list