rquinio / l10n-maven-plugin

:abcd: Maven plugin to validate localization resources in Java properties files
MIT License
3 stars 1 forks source link

Detect entries spread across multiple lines and missing backslash escaping in .properties file. #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It is allowed that a property be spread across several lines in a .properties 
file:
cf java.util.Properties#load Javadoc 
(http://docs.oracle.com/javase/6/docs/api/java/util/Properties.html#load%28java.
io.Reader%29)

"A logical line holds all the data of a key-element pair, which may be spread 
out across several adjacent natural lines by escaping the line terminator 
sequence with a backslash character \."

Forgetting to escape with backslash, will result in a truncated value to be 
loaded
The 1st word of next line will be considered to be another key, whitespace 
being a valid key/value separator. So  java.util.Properties does not raise any 
exception.

It would be nice if the validation would be able to detect that somehow.

Original issue reported on code.google.com by romain.q...@gmail.com on 2 Jun 2013 at 5:07