Stichoza / google-translate-php

🔤 Free Google Translate API PHP Package. Translates totally free of charge.
MIT License
1.79k stars 380 forks source link

fix (french): replace ${\d} delimiter with #{\d} to resolve currency bugs #202

Closed kylemilloy closed 7 months ago

kylemilloy commented 7 months ago

There is a bug that occurs with french sometimes where the delimiter we use accidentally gets malformed so that the $ follows afterwards. This happens because in french (and some other languages) instead of showing a currency like $20.00 we show it as 20,00$ and so Google is taking our ${0} values and trying to be helpful by making these {0}$. Instead we change the symbol to #{0} which is ignored.

Resolves #201

@Stichoza