Commit ad1fabe
committed
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@59097 602fd350-edb4-49c9-b593-d223f7449a821 parent 66afbbd commit ad1fabe
2 files changed
Lines changed: 34 additions & 25 deletions
File tree
- src/wp-includes/interactivity-api
- tests/phpunit/tests/interactivity-api
Lines changed: 33 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
202 | 222 | | |
203 | 223 | | |
204 | 224 | | |
| |||
296 | 316 | | |
297 | 317 | | |
298 | 318 | | |
| 319 | + | |
299 | 320 | | |
300 | 321 | | |
301 | 322 | | |
| |||
973 | 994 | | |
974 | 995 | | |
975 | 996 | | |
976 | | - | |
977 | | - | |
| 997 | + | |
978 | 998 | | |
979 | 999 | | |
980 | | - | |
981 | | - | |
| 1000 | + | |
982 | 1001 | | |
983 | | - | |
| 1002 | + | |
984 | 1003 | | |
985 | | - | |
| 1004 | + | |
986 | 1005 | | |
987 | 1006 | | |
988 | 1007 | | |
989 | 1008 | | |
990 | 1009 | | |
991 | 1010 | | |
992 | 1011 | | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | 1012 | | |
1000 | 1013 | | |
1001 | 1014 | | |
| |||
1016 | 1029 | | |
1017 | 1030 | | |
1018 | 1031 | | |
1019 | | - | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1020 | 1038 | | |
1021 | 1039 | | |
1022 | 1040 | | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
| 1041 | + | |
1029 | 1042 | | |
1030 | 1043 | | |
1031 | 1044 | | |
| |||
1035 | 1048 | | |
1036 | 1049 | | |
1037 | 1050 | | |
1038 | | - | |
| 1051 | + | |
1039 | 1052 | | |
1040 | 1053 | | |
1041 | 1054 | | |
| |||
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 128 | | |
133 | 129 | | |
0 commit comments