I use GWT I18N, which relies on annotations for messages with parameters.
Exemple :
@DefaultMessage("Here is a message <br/> with a param:{0}")
String messageToLocalize(String param);
In absence of a localized translation, the default message will be used.
I have some quite long strings to handle, which I would like to type in sevral lines for code readability (I don't speak about multiple lines for the rendered message).
I tried this :
@DefaultMessage("Here is a long \
message <br/> with a \
param:{0}")
String messageToLocalize(String param);
It fails (GWT PlugIn 4.2 and SDK 2.5.1) with an error "Invalid Escape Sequence".
Did I miss something ?
Is it a constraint on Java annotations or GWT ? (I am afraid so but couldn't find anything on that)
Is there a workaround ?
Thanks
Edit : Given first answers, the question must be rephrased : is it possible, and which character should I use to show continuation (if any) ?
The annotation processor obviously needs something to tell him.
I tried "\" because it is the char to use in property file ...
"+" does not work either.
Java doesn't support C-style string-lines representation, so you could not use such multi-line style neither in annotations declarations, nor in other places of code.
If you want to have multiply lines of a single string, you have to do something like this:
@DefaultMessage("Here is a long " +
"message <br/> with a " +
"param:{0}")