Skip to content

Commit 3e4dbbf

Browse files
authored
Merge pull request #208 from Chitzi/patch-1
Remove space in the parameters
2 parents bd9ef8a + f47197b commit 3e4dbbf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/GoogleTranslate.php

+3
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ function ($matches) {
364364
*/
365365
protected function injectParameters(string $string, array $replacements): string
366366
{
367+
// Remove space added by google in the parameters
368+
$string = preg_replace('/#\{\s*(\d+)\s*\}/', '#{$1}', $string);
369+
367370
return preg_replace_callback(
368371
'/\#{(\d+)}/',
369372
fn($matches) => $replacements[$matches[1]],

0 commit comments

Comments
 (0)