Closed kylemilloy closed 8 months ago
It's a known issue, similar to #167. Unfortunately Google doesn't understand such tags and it translates everything.
Sure. But surely there's a change we can make here that what gets sent to Google doesn't have to be translated. I was thinking of a solution where we use preg_replace to match keys, for example the string Hello :name
and have that transform into Hello ${0}
which gets sent to Google. On the return trip, we replace the key back so that we get Bonjour ${0}
and then just swap back in our value here with Bonjour :name
If you reopen this, I can try to make the appropriate changes and submit a PR. With SVO/VOS/whatever languages it won't work all the time, but it's better than the alternative right now which still breaks.
That is actually a great idea! Laravel and most of PHP frameworks use :variable
syntax so it will cover most of use cases.
Okay. I'll focus on using colons as the default delimiter but maybe give the option to provide your own pattern or resolver method.
Problem
Right now when sending keys to be translated we include serialization keys like:
And when we send this to get translated we get:
Solution
Provide a way to ignore serialization keys or modify the match rules for identifying these.