Java Properties Files

Last update: December 2016

 

RC-WinTrans supports the translation of Java properties files created with Sun Microsystems Java development platforms J2SE/EE/ME.  Properties files are used for what are known as resource bundles, which contain locale-specific strings (objects in general).

 

 

Character Encoding

Properties files generated/used by Sun development platforms are encoded as ASCII with Unicode escape sequences.  RC-WinTrans supports the following character encodings for source files (input) and can write target files in the following formats:

Unicode UTF-8.

UTF-16 (little-endian).

ANSI

ANSI with escaped Unicode characters.

 

Unicode Character Escapes in Java Properties Files

The standard for Java properties files is ANSI file encoding.  On the one hand this means that each character uses exactly one byte in the file.  On the other Java is Unicode-aware, so it is necessary to transport characters not included in the standard ANSI character set(any character with a Unicode character value greater than 127).  In Java properties files such characters are escaped, i.e., they are written as the sequence"\u" followed by a four-digit representation of the hexadecimal Unicode character value of the character (e.g., the German "sz" ligature (ß) is written as "\u00df".

 

See also: "Target File Encoding Dialog Box";

"Target Files Dialog Box."

 

Comments

Comments in a Java properties file can be read by RC-WinTrans and assigned to an item.  A comment text is taken over as a "note" for an item (translation unit) in the project's database.

 

To read and assign Java comments as notes the correct settings must be enabled:

1.

Open RC-WinTrans' Options dialog box (Tools menu) and select the File Types & File Converters tab.

2.

Select the list entry for the Java Properties Files Converter ("Java Properties file") and click the Options button.

3.

Check the option "Read comment line(s) before an item as a note" and confirm with "OK."

 

See also: "Notes in Source Files."

 

 

Comment Lines

As the comment for item The Java properties files converter reads any text from comment lines directly above the line with the resource item.  Comment lines are lines beginning with a number character (#) or semicolon (;).

 

EXAMPLE:

# Comment start               (Comment)

# Comment too                 (Comment)

fileopenID = Open file        (<-- Item to which the text in the two comment lines is assigned.)