[wp-trac] [WordPress Trac] #62244: Just-in-time translation loading for plugins/themes not in the directory

WordPress Trac noreply at wordpress.org
Thu Oct 17 14:30:09 UTC 2024


#62244: Just-in-time translation loading for plugins/themes not in the directory
-------------------------+-----------------------------
 Reporter:  swissspidy   |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  I18N         |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 This is a follow-up to the just-in-time translation loading we added in
 WordPress 4.6, see #34114.

 We could theoretically expand this to custom plugins as well.

 If no translation files are found for a given domain, we could use
 `get_plugins()` and check if there's a plugin with a matching slug, get
 its `Domain Path` value (like `_get_plugin_data_markup_translate` does)
 and then store that location in `WP_Textdomain_Registry`.

 This way, custom plugins won't need to call `load_plugin_textdomain()`
 anymore as long as they define `Domain Path` in the plugin headers.

 Question is whether we can do this in a performant way, minimizing file
 reads, adding caching, etc.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62244>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list