Oct 8, 2012

Fun with property files

Let's say you have a property file (myprops.properties):

dialog.yes=Yes
dialog.no=No

With a localized version (myprops_sv.properties):

dialog.yes=Ja
dialog.no=Nej

Now add a spurious backslash to myprops_sv.properties:

dialog.yes=Ja         \
dialog.no=Nej

What do you get? When using the localized version you get a mix of English and Swedish ("No", "Ja"). Well, you don't really get "Ja", you get "Ja \dialog.no=Nej", but that's hard to spot if it's used for a fixed width button... Took a while to figure that one out.

No comments:

Post a Comment