WordPress/wp-includes/interactivity-api
czapla 8786fe5da6 Interactivity API: Move interactivity-router i18n strings to Script Module data.
Moves the 'loading' and 'loaded' i18n strings for the `interactivity-router` to the script module data via the `script_module_data_@wordpress/interactivity-router` filter.

Key changes:

- Add the `filter_script_module_interactivity_router_data()` method, hooked into the `script_module_data_@wordpress/interactivity-router` filter, to set the `i18n` data with the 'loading' and 'loaded' messages.
- Rename the `print_router_loading_and_screen_reader_markup()` method to `print_router_markup()` and remove the screen reader markup from it because it's no longer needed.
- Remove the `loading` and `loaded` strings from the `core/router` store state because they're no longer needed.
- Initialize the `core/router` store with a minimal navigation object to prevent errors in the interactivity-router script module when the store is not properly initialized.
- Update corresponding unit tests to reflect these changes.

This change ensures that the `interactivity-router` i18n messages are localized in a single place and removes the need to initialize them in the `core/router` store state.

Props jonsurrell, swissspidy, czapla. 
See #60647.

Built from https://develop.svn.wordpress.org/trunk@59097


git-svn-id: http://core.svn.wordpress.org/trunk@58493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-09-26 17:55:13 +00:00
..
class-wp-interactivity-api-directives-processor.php Interactivity API: Print debug warning when server directives processing encounters errors 2024-06-04 07:18:17 +00:00
class-wp-interactivity-api.php Interactivity API: Move interactivity-router i18n strings to Script Module data. 2024-09-26 17:55:13 +00:00
interactivity-api.php Interactivity API: Directives cannot derive state on the server 2024-06-04 11:01:16 +00:00