3 Replies Latest reply on Mar 27, 2008 5:26 PM by elnino

    Formatting message_xx.properties with HTML

    elnino

      Hello,


      I have made some searchs but I didn't found any issues. I sure that I haven't got the good keywords and that the problem has been already posted. Sorry for that.


      I would like to format text in the internationalized files (messages-en.properties etc...)


      It's just to put some br /, italic or bold effects. If i put some HTML tags, they are just displayed as text.


      Is it possible or should I split my sentences and apply a style in code ?


      Sorry if my English is not perfect.


      Thanks for your answers


      Regards,
      Paul

        • 1. Re: Formatting message_xx.properties with HTML

          It works fine for me. How do you display the texts? Don't forget to disable escape:



          <h:outputText value="#{messages['myText']}" escape="false"/>


          • 2. Re: Formatting message_xx.properties with HTML

            disabling escape also works for me.


            but you should keep this in mind:



            • the guys who translate your texts might not know about html and they sometimes mess up your html code: and that's sometimes difficult to find :(

            • if you ever plan to use a different gui (not html aware), you are probably better off using plain text messages

            • 3. Re: Formatting message_xx.properties with HTML
              elnino

              Shame on me....


              I didn't use h:outputText tag...


              It's working now .


              Thanks so much.


              To Martin, yes you're right, but it's just to format paragraph. I prefer formatting in each language instead of created several labels.


              The day I display my text in a non-HTML client............ Hum, I will think that you was right !


              Thanks all.