Java .properties Translation Files
Format, encoding, and workflow for the standard JVM translation format.
Java .properties files are plain-text key=value files used by JVM applications for both configuration and translation. For translations, one file lives per locale — messages.properties for the default, messages_de.properties for German, messages_fr_CA.properties for Canadian French — and Java's ResourceBundle picks the right file based on the active Locale. Used by Spring Boot, the Spring Framework, Hibernate, Apache projects, and most Java desktop applications, .properties is effectively the lingua franca of JVM internationalization.
- What it is: plain-text key=value file
- File extension:
.properties - Encoding: ISO-8859-1 (legacy) or UTF-8 (Java 9+ ResourceBundle)
- Bundle naming:
messages_<lang>[_<COUNTRY>].properties - Plurals: not native — use ICU MessageFormat or ChoiceFormat
- Used by: Spring Boot, Spring, Hibernate, Apache, JSF, Struts, most JVM apps
What a .properties translation file looks like
A typical message bundle uses dot-separated keys, simple key=value lines, and comments starting with # or !. Placeholders use Java MessageFormat syntax ({0}, {1}) for positional substitution; ICU MessageFormat adds named arguments and full plural rules:
# messages_de.properties
# German translations for the application
app.name = Mein Anwendungsname
app.welcome = Willkommen, {0}!
# Login screen
login.username = Benutzername
login.password = Passwort
login.submit = Anmelden
# Cart messages — uses ICU MessageFormat
cart.items = {count, plural, one {1 Artikel im Warenkorb} other {# Artikel im Warenkorb}}
# Errors
error.notFound = Seite nicht gefunden
error.forbidden = Zugriff verweigertEditing .properties translation files
- IntelliJ IDEA / Eclipse: built-in resource bundle editors show all locales side by side, validate key consistency, and warn on missing translations.
- Cloud TMS platforms: Locize, Phrase, Crowdin, Lokalise import .properties natively; translators work in a CAT UI, the export round-trips back to per-locale files.
- Text editors: fine for spot fixes. Watch out for backslash escaping, separator characters (`=`/`:`), and encoding (ISO-8859-1 vs UTF-8).
Common .properties translation workflows
- Spring Boot. Place messages bundles under
src/main/resources/. Configurespring.messages.basename=messages. Spring auto-resolvesmessages_<locale>.propertiesbased on the request. - Adding a language. Copy
messages.propertiestomessages_<locale>.properties, translate values. ResourceBundle picks it up automatically. - Translator handoff. Export the default bundle to a TMS, translate, import per-locale files back into the resources folder.
- Encoding migration. If your project still uses ISO-8859-1, consider migrating to UTF-8 (Java 9+). Saves you from
\\uXXXXescapes for non-Latin characters.
How to translate .properties files in Locize
Locize imports and exports Java .properties files:
- Get started
- Import your
messages.propertiesfile - Edit translations in the CAT view with translation memory, glossary, and style guide applied automatically
- Use bulk actions for AI / machine translation, then route results through a review workflow
- Export back to
.propertiesper locale — or convert to JSON, YAML, gettext, XLIFF, or any other supported format
Frequently asked questions
A .properties file is a plain-text key=value file used by Java applications for configuration and translation. For translations, the convention is one bundle per language: `messages.properties` for the default, `messages_de.properties` for German, `messages_fr_CA.properties` for Canadian French. Java's ResourceBundle picks the right file based on the active Locale.
Historically ISO-8859-1 (latin-1), which means non-latin characters had to be escaped as `\\uXXXX` Unicode literals. Since Java 9, ResourceBundle reads UTF-8 .properties files natively. For new projects use UTF-8 directly; for legacy bundles you may still encounter Unicode escapes.
For each locale create a sibling file with the locale code suffix (`messages_de.properties`). Either translate by hand in a Java-aware editor, or import the default into a translation management system (Locize, Phrase, Crowdin), translate in a CAT UI, and export back to per-locale .properties files.
Not natively. Java has `MessageFormat` and `ChoiceFormat` for limited plural and selection logic embedded in single messages, and ICU MessageFormat (via the `icu4j` library) for full CLDR plural rules. Most modern Java apps use ICU MessageFormat and store the message strings in .properties; Locize preserves whichever format your messages use.
Backslash is the escape character (`\\\\`, `\\n`, `\\t`, `\\:`, `\\=`). Both `=` and `:` work as the key/value separator. Lines starting with `#` or `!` are comments. Trailing whitespace on values is significant unless escaped. Use a Java-aware editor or formatter to avoid subtle bugs.
Spring Boot (default), the Spring Framework, Hibernate, Apache projects (Tomcat, Maven, Ant), JavaServer Faces, Struts, JSP-based web apps, and most JVM desktop applications. .properties is the lingua franca of JVM internationalization.