turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 155 forks source link

Issues with rendering special character inside i18n translation jQuery Rails #418

Closed elviajero971 closed 2 years ago

elviajero971 commented 2 years ago

Hello everybody!

It seams that I'm having issues with apostrophe ' inside i18n translation file inside a Rails App ( ruby '2.7.4'and rails '6.0.3.3')

When I add a translation to a file content/fr.yml, for example: title: "contenu recommandé l'abi", it render the string correctly for the concerned content.html.erb file.

However when I add a similar translation to an another file booking/fr.yml, for example content: "l'heure de l'échange.", it doesn't render the translation properly for the concerned file booking.html.erb The only known difference to me, is that the second file booking.html.erb is rendered using javascript (specifically jQuery)

The render I have for this transaltion is: l'heure de l'échange

I've tried your syntaxe with ' and also title: 'contenu recommandé l''abi' but with no success until now.

It seems that I'm missing something here but I cannot figure out what is...

Any clues ?

elviajero971 commented 2 years ago

Update! I have finally found a solution using _html https://guides.rubyonrails.org/i18n.html#using-safe-html-translations

turquoiseowl commented 2 years ago

Thanks for the update.