Changes between Initial Version and Version 1 of Ticket #45103, comment 6
- Timestamp:
- 10/18/2018 12:06:22 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #45103, comment 6
initial v1 14 14 }}} 15 15 16 Then in `WP_Scripts` there could be tracking of what handles have been registered as having translation strings for when time comes to write `wp.i18n.setLocaleData` inline. The beauty of this is is saves having to auto-detect whether js files have translations or not (which could get expensive) and also ensures that the translation is only loaded when the script itself is enqueued. 16 Then in `WP_Scripts` there could be tracking of what handles have been registered as having translation strings for when time comes to write `wp.i18n.setLocaleData` inline. The beauty of this is is saves having to auto-detect whether js files have translations or not (which could get expensive) and also ensures that the translation is only loaded when the script itself is enqueued. Plus it handily links the domain to the script so there's no guessing at what domain the script file belongs to (or trying to auto-detect that which could be difficult). 17 17 18 18 So the new api bits would be the function `wp_script_has_translation` and the logic etc for `WP_Scripts::has_translation`
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)