WordPress.org

Making WordPress.org

Changes between Initial Version and Version 5 of Ticket #3875


Ignore:
Timestamp:
10/18/2018 03:31:07 PM (13 months ago)
Author:
herregroen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3875

    • Property Summary changed from Javascript Language Packs to Javascript Language Files
  • Ticket #3875 – Description

    initial v5  
    10101. wordpress.org would need to also parse JS files when generating POT files. I believe #3748 is the best way to allow this. A possible alternative here would be to use [[https://github.com/WordPress/gutenberg/tree/master/packages/babel-plugin-makepot|@wordpress/babel-plugin-makepot]] but this would likely require more effect to setup on wordpress.org.
    1111**Action required: resolve #3748.**
    12 2. wordpress.org would need to split translations into multiple files when building language packs. The simplest way to achieve this would be to change the `wporg-gp-customizations` plugin to generate multiple PO and MO files. One pair for all translation entries ( possibly only those occurring only in PHP files ) and one pair per JS file, each containing all translation entries that occur in that file. These files would then all be added to the ZIP as is currently already done. From there the process could continue as normal.
    13 **Action required: patch wporg-gp-customizations ( ticket will be created ).**
     122. wordpress.org would need to split translations into multiple files when building language packs. The simplest way to achieve this would be to change the `wporg-gp-customizations` plugin to generate multiple PO and MO files. One pair for all translation entries ( possibly only those occurring only in PHP files ) and one file per JS file, each containing all translation entries that occur in that file. These files would then all be added to the ZIP as is currently already done. From there the process could continue as normal.
     13**Action required: patch wporg-gp-customizations #3876.**
    14143. WordPress installations would download these updated language packs as normal. The normal language pack file will still exist and contain all the translations it always did preserving full BC. In addition to that the JS translations would be present on a file-by-file basis.
    1515**No action required.**
    16 4. WordPress will require a patch so that when a script is enqueued a check is done to see if a translation file exists for that specific script and, if so, load those translations using `wp_localize_script` and ensure a small inline script is added that loads those translations into `wp.i18n`. This inline script should always run before the dependant JS file is loaded.
    17 **Action required: patch WordPress Core ( ticket will be created ).**
     164. WordPress will require a patch so that when a script is enqueued a check is done to see if a translation file exists for that specific script and, if so, load those translations using `wp_localize_script` or something similar and ensure a small inline script is added that loads those translations into `wp.i18n`. This inline script should always run before the dependant JS file is loaded.
     17**Action required: patch WordPress Core #core45103**
    1818
    1919If all these steps are made I believe we'll be in a situation where: