Search code examples
javaresourcebundle

How to format resource bundle values to be shown in HTML format


key={0}/{1} + {2}/{3}

The above value is defined in a resource bundle and is shown as HTML text in the user interface. The above demonstrates adding fractions and I would like to format this in HTML format. Would it be possible to do this in the resource bundle property file itself. If so, how should I do this?


Solution

  • If I understand your needs correctly, then you can specify the formating in the resource file. For example add some html tags:

    key=<i>{0}/{1}</i> + <b>{2}/{3}</b>