Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Multilines in language properties

Reply
Thread Tools

Multilines in language properties

 
 
Samuel Murray
Guest
Posts: n/a
 
      02-29-2008
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)

 
Reply With Quote
 
 
 
 
Jeff Higgins
Guest
Posts: n/a
 
      03-01-2008

Samuel Murray wrote:
> 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?


<http://java.sun.com/javase/6/docs/api/java/util/Properties.html#load(java.io.Reader)>

>
> 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)
>



 
Reply With Quote
 
 
 
 
Mark Space
Guest
Posts: n/a
 
      03-01-2008
Samuel Murray wrote:

> 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.

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      03-02-2008
On Fri, 29 Feb 2008 06:05:35 -0800 (PST), Samuel Murray
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone who
said :

>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.
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
Samuel Murray
Guest
Posts: n/a
 
      03-02-2008

G'day Mark

On Mar 1, 9:14 pm, Mark Space <(E-Mail Removed)> wrote:

> 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)
 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      03-02-2008

Samuel Murray wrote:
>
> G'day Mark
>
> On Mar 1, 9:14 pm, Mark Space <(E-Mail Removed)> wrote:
>
>> 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.
>


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


 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      03-02-2008

Samuel Murray wrote:
>
>
> 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.



 
Reply With Quote
 
Samuel Murray
Guest
Posts: n/a
 
      03-03-2008
On Mar 2, 10:15 pm, "Jeff Higgins" <(E-Mail Removed)> wrote:

> Samuel Murray wrote:


> > 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


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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CompositeControls: ViewState properties w/ Mapped properties probl =?Utf-8?B?Q2hyaXN0b3BoZSBQZWlsbGV0?= ASP .Net 1 01-19-2006 09:19 AM
Making Custom Control Properties Visible in Visual Studio's Properties Palette Nathan Sokalski ASP .Net 0 10-17-2005 02:05 AM
Re: C++ properties Library Created (was Binding together Properties of Objects) Victor Porton C++ 1 08-29-2004 08:02 PM
Problems parsing when Properties.dtd.properties Kent Lichty Java 0 04-16-2004 03:08 PM
file w/ multilines? lallous Java 6 01-27-2004 01:55 AM



Advertisments