Apostrophe doesn't get translated properly when placed in a resource bundle

user339108 picture user339108 · Dec 15, 2010 · Viewed 34k times · Source

Apostrophe doesn't get translated properly when placed in a resource bundle.

key = {0}'s brush is {1} centimeters tall

(e.g. Sam's brush is 4 centimeters tall)

The apostrophe gets missed if I format the above key from a java.util.ResourceBundle What could be the problem here?

Answer

Raghuram picture Raghuram · Dec 15, 2010

You should escape the single quote as

key = {0}''s brush is {1} centimeters tall