| 1 |
<?php |
| 2 |
if (!defined('ABSPATH')) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* Registered script handles whose JavaScript calls wp.i18n.__() and therefore |
| 8 |
* needs a wp_set_script_translations() registration plus a per-locale JED JSON |
| 9 |
* file in languages/. |
| 10 |
* |
| 11 |
* This is DATA, not logic. It is the single source of truth shared by three |
| 12 |
* consumers, which is what keeps them from drifting apart: |
| 13 |
* |
| 14 |
* - ABJ_404_Solution_WPUtils::registerScriptTranslations() reads it at |
| 15 |
* admin_enqueue_scripts time and registers every handle that the current |
| 16 |
* screen actually enqueued (wp_set_script_translations() is a no-op for a |
| 17 |
* handle that was never registered, so one call covers every screen). |
| 18 |
* - scripts/build-script-translations.php reads it to know which JS file |
| 19 |
* supplies the msgids for each handle's JSON files. |
| 20 |
* - ScriptTranslationsTest asserts that every JS file under includes/ that |
| 21 |
* contains a translation call appears here, so adding a new translated |
| 22 |
* script without wiring it up fails the suite instead of silently shipping |
| 23 |
* an English-only string. |
| 24 |
* |
| 25 |
* Keys are wp_enqueue_script() handles; values are the JS source path relative |
| 26 |
* to the plugin root. |
| 27 |
* |
| 28 |
* @return array<string, string> |
| 29 |
*/ |
| 30 |
// allow-no-test-found: static data file (returns the handle-to-source map, no logic); the map is verified against the real on-disk JS sources in ScriptTranslationsTest. |
| 31 |
return array( |
| 32 |
'abj404-stats-confidence-chart' => 'includes/js/statsConfidenceChart.js', |
| 33 |
'abj404-support-request-modal-view' => 'includes/js/support-request-modal-view.js', |
| 34 |
'abj404-tools-migrate-plugin' => 'includes/js/toolsMigratePlugin.js', |
| 35 |
); |
| 36 |
|