martinandert / react-translate-component

A component for React that utilizes the Counterpart module to provide multi-lingual/localized text content.
MIT License
322 stars 31 forks source link

Translation won't work if string contains `.` #42

Open erpardeepjain opened 4 years ago

erpardeepjain commented 4 years ago

Support I have string

Explore and get a feel for the game before moving onto micro-level. You can play for 1 hour for just ₹50. And win lot more.

If I apply translation for this string it is not working, My observation is beacuse string contains . and translation is not working after ., Any comments or suggestion on this.

martinandert commented 4 years ago

The dot is used to separate translation keys. You can set a custom separator like this:

counterpart.setSeparator('*');
erpardeepjain commented 4 years ago

That's great, I was not aware about this. thanks. Don't you think by default setSeparator value should not be . as many of the developer are not aware of this and many of the strings contains .. Just a suggestion.