Home > Blockchain >  I18n message multiline
I18n message multiline

Time:03-16

I search how to have a text in messages.properties on multiline

something like

help.precision=It's cold ouside.

Yesterday It's was minus 20.

I have very long text, with linefeed (more than 300 character).

CodePudding user response:

There you go:

help.precision=It's cold ouside. \
  Yesterday It's was minus 20.

An extra \ at the end of first line will allow you to write multi-line strings in properties file.

CodePudding user response:

So, the problem you are trying to solve here is how to maintain a multiline string in .properties file.

mostly, .properties file work with java, so, we need to understand which letter (or combination of letters) are used in java to act as a new line markup.

In java "/n" is a newline character. So, if you add "/n" in the string, it will be processed as a newline giving a string the treatment of multiline string.

help.precision=It's cold ouside.\n Yesterday It's was minus 20.
  • Related