[wp-trac] [WordPress Trac] #41305: Add lazily evaluated translations

WordPress Trac noreply at wordpress.org
Thu Aug 3 15:45:57 UTC 2017


#41305: Add lazily evaluated translations
-------------------------+------------------------------------
 Reporter:  schlessera   |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  I18N         |     Version:  4.8
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  rest-api, performance
-------------------------+------------------------------------

Comment (by schlessera):

 > One thing that bugs me about this patch here is that it would make
 transitioning to a new translation system (still dreaming of
 MessageFormat) much harder because of all the new functions and classes.

 I think that this should not be an issue, because the added functions are
 basically lazy wrappers around `translate()`. They don't do any
 translation themselves, and when you would change the backend
 implementation for `translate()`, theses lazy variations are taken care of
 automatically.

 > I like keeping it simple with _noop() and translate_noop().

 I don't think that's simpler. It is simpler code in the implementation,
 but then makes every single usage of it more complex as a result, as you
 are splitting up the usage into two separate steps, and are making this
 much more error-prone.

 > Would you mind using .diff file extensions next time so we have syntax
 highlighting here in Trac? Thanks :-)

 Uh, sure, I wasn't aware of that distinction. Had mostly avoided Trac
 before... ;)

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


More information about the wp-trac mailing list