Multilines in language properties

S

Samuel Murray

G'day everyone

I'm not a Java programmer -- I'm a translator translating Java
properties files. I lead a project to help volunteer translators
translate opensource programs into their languages, and we'd like to
translate a program that uses non-standard multilines in properties
files.

I was hoping one of you could either tell me the answer or point me to
a URL with the answer to this question: what is the correct format
for multiple lines, and for multiple lines with line breaks, in a
properties file?

The non-standard properties file I have looks like this:

one = two three
+ four five
+ six seven

and I suspect that a standard properties file will look something like
this:

one = two three\
four five\
six seven

but I'm not 100% sure. And what if those line breaks should be real
breaks (hard returns, CRLFs, etc)? Do Java properties files use \n or
something similar?

Thanks in advance
Samuel Murray (leuce)
 
J

Jeff Higgins

Samuel said:
G'day everyone

I'm not a Java programmer -- I'm a translator translating Java
properties files. I lead a project to help volunteer translators
translate opensource programs into their languages, and we'd like to
translate a program that uses non-standard multilines in properties
files.

I was hoping one of you could either tell me the answer or point me to
a URL with the answer to this question: what is the correct format
for multiple lines, and for multiple lines with line breaks, in a
properties file?
 
M

Mark Space

Samuel said:
one = two three
+ four five
+ six seven

Be careful here that the program doesn't expect to see the property
"one" associated with the string "two three + four five + six seven".

Otherwise, something like:

one = two three \
four five \
six seven

is probably what you want. Note the space before the \ to get spaces
between words. End of line can be either \n or \r\n.
 
R

Roedy Green

I'm not a Java programmer -- I'm a translator translating Java
properties files. I lead a project to help volunteer translators
translate opensource programs into their languages, and we'd like to
translate a program that uses non-standard multilines in properties
files.
These materials may be helpful to you:

http://mindprod.com/jgloss/properties.html
http://mindprod.com/jgloss/localisation.html
http://mindprod.com/project/internationaliser.html

I had composed a detailed plan for a translation tool you may find
interesting. You also might want to hire me to implement it for you.
 
S

Samuel Murray

G'day Mark

Be careful here that the program doesn't expect to
see the property "one" associated with the string
"two three + four five + six seven".

Thanks for pointing that out. No, I checked the GUI and the plusses
should not be there.
Note the space before the \ to get spaces between
words. End of line can be either \n or \r\n.

Yes, the link Jeff gave also made me realise that leading spaces are
ignored. Therefore, to have a space between the words on both lines,
the space must precede the slash, and not simply precede the first
word on the next line. I also see that the space before the slash is
not compulsory -- you only need it of you need to have a space in the
line.

I suspect that for my purposes, \n would be sufficient to indicate
real breaks in the GUI.

Thanks again.
Samuel (leuce)
 
J

Jeff Higgins

Samuel said:
G'day Mark



Thanks for pointing that out. No, I checked the GUI and the plusses
should not be there.


Yes, the link Jeff gave also made me realise that leading spaces are
ignored. Therefore, to have a space between the words on both lines,
the space must precede the slash, and not simply precede the first
word on the next line. I also see that the space before the slash is
not compulsory -- you only need it of you need to have a space in the
line.

I suspect that for my purposes, \n would be sufficient to indicate
real breaks in the GUI.

one = two three\n\ <-- (the properties file processor) only requires this
three four\n\ (unseen) line terminator == \n, or \r, or \r\n.
five six\r\ <-- (the GUI) may choke on this \r
7 8
 
J

Jeff Higgins

Samuel said:
I suspect that for my purposes, \n would be sufficient to indicate
real breaks in the GUI.

one = two three\n\ <-- (the properties file processor) only requires this
three four\n\ (unseen) line terminator == \n, or \r, or \r\n.
five six\r\ <-- (the GUI) may choke on this \r
7 8

If I've understood your comment.
 
S

Samuel Murray

Samuel Murray wrote:
one = two three\n\ <-- (the properties file processor) only requires this
three four\n\ (unseen) line terminator == \n, or \r, or \r\n.
five six\r\ <-- (the GUI) may choke on this \r

Yes, that's what I meant, thanks. \n for the break in the GUI and
another slash for the break in the code.

Samuel (leuce)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top