Open sebsobseb opened 4 years ago
A solution would be to use \b in the regex:
new RegExp(':' + replacementName + '\\b', 'g'),
Laravel sorts by length before doing the replacements - https://github.com/laravel/framework/blob/v7.0.0/src/Illuminate/Translation/Translator.php#L217
Laravel sorts by length before doing the replacements - https://github.com/laravel/framework/blob/v7.0.0/src/Illuminate/Translation/Translator.php#L217
That's even better
I have a translation message like this:
'items_from_to' => ':from - :to of :total'
When translating...
I see: 1 - 10 of 10tal
instead of 1 - 10 of 100