Properties
The .properties format is widely used for application configuration and localization across various platforms. While no universal standard exists, LingoHub closely supports the Java ResourceBundle dialect while remaining flexible enough to handle other common variations.
Format
- Key-value pairs are delimited by the
=character and terminated by a newline. - The
=delimiter can be surrounded by whitespace. (LingoHub does not support:as a separator). - To continue a value on the next line, the current line must end with a backslash
\. - Newlines can be escaped using
\n. - Placeholders follow the
{name}syntax, where the name consists of non-whitespace characters. - Comments begin with a hash sign
#or an exclamation mark!. - LingoHub assigns comments to the subsequent key-value pair as segment descriptions.
- By default, Java
.propertiesfiles use ISO-8859-1 encoding, with non-supported characters masked using UTF-16 escaping (\u...). - LingoHub also supports UTF-8 encoding, which we recommend for improved readability.
LingoHints can be included in a comment:
# <lh>{"status": "DRAFT","qc": {"min": "3","max": "20"},"labels": ["q3-2024"],"not_translatable": false}</lh>
hello_user = Hello {username}Example
Additional example files are available on GitHub.
# This comment is interpreted as a header comment.
# Values can continue to the next line using a backslash.
welcome_message = Welcome back, \
we have missed you.
# Multi-line comments belong to the next key-value pair,
# provided they are not interrupted by a blank line.
visit_count = This is your {visit} visit to our site.
! Comments in .properties files can start with an exclamation mark.
hello_user = Hello {username}
escaped_newline = A newline can be escaped \n with a backslash.
charset_escaped = Muss gr\u00F6sser gleich {value} sein.Used by
- Java (via
java.util.ResourceBundle). - Spring Framework.
- Grails.
- GWT.
- Play Framework.
References
Updated about 1 month ago
