Title: Query Parameter Lost in URL When Using $localePath
Description:
I'm encountering an issue with the $localePath function, where query parameters are being lost from the URL. When I use $localePath to generate a localized path, any query parameters included in the original path are not preserved in the output.
Steps to Reproduce:
Use the $localePath function with a URL that includes a query parameter.
console.log($localePath('/home')); // Expected output: localized path for '/home'
console.log($localePath('/home?test=test')); // Expected output: localized path for '/home?test=test'
Observe the output in the console.
Expected Behavior:
The $localePath function should return the localized path while preserving any query parameters included in the input URL. For example:
For the input '/home?test=test', the output should be something like '/<locale>/home?test=test'.
Actual Behavior:
The query parameters are not included in the output. The function returns a path without the query string:
The output for '/home?test=test' is '/<locale>/home'.
Environment:
Library Version: 1.31.1
Browser: Google Chrome
Operating System: macOS
Additional Context:
This issue affects routes where query parameters are essential for functionality.
I have checked the documentation and did not find any mention of this behavior being intentional.
Possible Solution:
If possible, it would be helpful for $localePath to internally handle query parameters or provide an option to preserve them, as it was in version 1.27.1
Title: Query Parameter Lost in URL When Using
$localePath
Description:
I'm encountering an issue with the
$localePath
function, where query parameters are being lost from the URL. When I use$localePath
to generate a localized path, any query parameters included in the original path are not preserved in the output.Steps to Reproduce:
Use the
$localePath
function with a URL that includes a query parameter.Observe the output in the console.
Expected Behavior:
The
$localePath
function should return the localized path while preserving any query parameters included in the input URL. For example:'/home?test=test'
, the output should be something like'/<locale>/home?test=test'
.Actual Behavior:
The query parameters are not included in the output. The function returns a path without the query string:
'/home?test=test'
is'/<locale>/home'
.Environment:
Additional Context:
Possible Solution:
If possible, it would be helpful for
$localePath
to internally handle query parameters or provide an option to preserve them, as it was in version 1.27.1