Lingo.dev + .properties (Java)
Lingo.dev CLI translates Java .properties files while preserving key-value structure, escape sequences, and Java localization conventions. The CLI works seamlessly with Java's ResourceBundle system, maintains properties file format exactly, handles Unicode and special character escaping correctly, preserves {0}
, {1}
placeholders for MessageFormat, and integrates with Maven and Gradle build processes.
Quick Setup
Configure for Java properties files:
{
"locale": {
"source": "en",
"targets": ["es", "fr", "de"]
},
"buckets": {
"properties": {
"include": ["src/main/resources/messages_[locale].properties"]
}
}
}
Reminder: [locale]
is a placeholder that should remain in the config literally, as it's replaced with the actual locale during CLI run.
Translate Properties Files
npx lingo.dev@latest i18n
Preserves properties file format, escape sequences, and Java-specific conventions while translating values.
Properties File Structure
Basic Key-Value Pairs
welcome.message=Welcome to our application
login.button=Log In
logout.button=Log Out
error.invalid.credentials=Invalid username or password
Namespace Organization
# Authentication messages
auth.login.title=Sign In
auth.login.subtitle=Enter your credentials
auth.register.title=Create Account
auth.forgot.password=Forgot Password?
# Navigation items
nav.home=Home
nav.dashboard=Dashboard
nav.settings=Settings
MessageFormat Placeholders
welcome.user=Welcome back, {0}!
items.count=You have {0} items in your cart
validation.min.length=Field must be at least {0} characters long
date.format=Today is {0,date,short}
Java-Specific Features
Unicode Escape Sequences
japanese.greeting=\u3053\u3093\u306b\u3061\u306f
euro.symbol=Price: 100\u20ac
Unicode escapes are preserved during translation.
Line Continuation
long.message=This is a very long message that \
spans multiple lines for better \
readability in the source file
Special Character Escaping
file.path=C:\\Users\\Documents\\file.txt
key.with.spaces=key\ with\ spaces=value with spaces
special.chars=Contains \= equals and \: colons
Advanced Configuration
Multiple Properties Files
"properties": {
"include": [
"src/main/resources/messages_[locale].properties",
"src/main/resources/validation_[locale].properties"
]
}
Lock Configuration Keys
"properties": {
"include": ["src/main/resources/messages_[locale].properties"],
"lockedKeys": ["app.version", "build.timestamp", "api.endpoint"]
}