Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #63944


Ignore:
Timestamp:
09/08/2025 06:54:14 AM (14 months ago)
Author:
dd32
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #63944 – Description

    initial v1  
    22
    33The current workflow is that translations for a script are declared with:
    4 ```php
     4{{{#!php
    55wp_set_script_translations( 'my-script', 'my-domain', $optional_path );
    6 ```
     6}}}
     7
    78If I omit the `$optional_path`, translations are looked up only in the "global" `wp-content/languages/plugins` directory. No "local" plugin path is looked at.
    89
    910I need to declare the local path explicitly if I want it to be used:
    10 ```php
     11{{{#!php
    1112wp_set_script_translations( 'my-script', 'my-domain', plugin_dir_path( __FILE__ ) . 'languages' );
    12 ```
     13}}}
    1314
    1415The expected behavior, however, is that I can: