0

Tools

Using Jhipster v5.0.1, thymeleaf v3.0.9 and JDK1.8.0

Goal

Escape a single quote (') in Thymeleaf from a message.properties file (ressource bundle).

The message is the following in messages_fr.properties:

email.demandeconge.textcra=Votre Cra de {0} est à l'état Brouillon. Vous êtes invité(e) à le mettre à jour et à le soumettre.

It is found in the email.html template:

                                             <span th:text="#{email.demandeconge.textcra(${conge.mois})}">
                                                   Votre Cra de mois est à l'état Brouillon. Vous êtes invité(e) à le mettre à jour et à le soumettre.
                                              </span>

Issue

In the email, it prints: Votre Cra de mois est à létat Brouillon.

Try

1) In message.properties:

l\'état => prints l\état

l"&#39";état => prints l"&#39";état (without the double quotes. They are here because if I put "&#39" without double quotes it gives ' in the post.

2) in email.html:

                                             <span th:text="#{"email.demandeconge.textcra(${conge.mois})"}">
                                                   Votre Cra de mois est à l'état Brouillon. Vous êtes invité(e) à le mettre à jour et à le soumettre.
                                              </span>

=> prints ??email.demandeconge.textcra(${conge.mois})??

Could you help me please?

Thanks

Manuela

  • Sorry with double single quote it works. See this [link](https://stackoverflow.com/questions/4449639/apostrophe-doesnt-get-translated-properly-when-placed-in-a-resource-bundle/4449668). – Manuela CodingPadawan Nov 20 '18 at 13:13
  • 1
    Possible duplicate of [Apostrophe doesn't get translated properly when placed in a resource bundle](https://stackoverflow.com/questions/4449639/apostrophe-doesnt-get-translated-properly-when-placed-in-a-resource-bundle) – Metroids Nov 20 '18 at 16:06

0 Answers0