rsnext/test/integration/i18n-support
Kyle Marshall a29d8c9eaf
Ensure locale key not duplicated when navigating back to root path with a query or hash value (#24323)
This ensures that a duplicate locale key is not prepended to the path when navigating back (using browsers back button) to the root path containing query parameters or a hash value.

Current behaviour:
* `/fr?value=1` -> `/fr/another` -> click browser back button -> `/fr/fr?value=1`
* `/fr?value=1` -> `/fr?value=2` -> click browser back button -> `/fr/fr?value=1`
* `/fr#section` -> `/fr/another` -> click browser back button -> `/fr/fr#section`
* `/fr#section` -> `/fr#another` -> click browser back button -> `/fr/fr#section`

Fix:
Remove query string or hash value from path before determining whether to add the locale to the path in `addLocale` function.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

Fixes: #24287
2021-04-22 03:06:26 +00:00
..
pages Ensure default fallback values are correct with i18n (#23675) 2021-04-04 14:09:20 +00:00
test Ensure locale key not duplicated when navigating back to root path with a query or hash value (#24323) 2021-04-22 03:06:26 +00:00
next.config.js Ensure i18n + API rewrite is handled correctly (#20751) 2021-01-06 09:54:45 +00:00
server.js Add locale: false for custom-routes + i18n (#19164) 2020-11-14 03:35:42 +00:00