lokalise / i18n-ally

🌍 All in one i18n extension for VS Code
https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally
MIT License
3.93k stars 315 forks source link

Interpolated variables are being translated #1040

Open paulolopesrb opened 11 months ago

paulolopesrb commented 11 months ago

Describe the bug When automatically translating strings with interpolated variables (see screenshot attached), the variable names are also translated.

Extension Version i18n Ally v2.12.0

Framework/i18n package you are using next-intl ^2.14.6

To Reproduce Steps to reproduce the behavior:

  1. Go to any translation on the code
  2. Click on the globe icon to translate to another language
  3. See the

Device Infomation

Screenshots (the original language was PT - in the middle - with the variable names in english) image

Sinc63 commented 11 months ago

If you run the translation yourself in Google Translate you will see the same problem occur. It is more likely in some languages than others, and seems to be more likely if the whole string reads like a sentence. However since this tool knows that this context requires the interpolations not to be translated it could correct what Google gives it and restore the interpolated names.

paulolopesrb commented 11 months ago

@Sinc63 that was precisely my idea!