Gå til hovedinnhold

Java Properties format (.properties)

The Java Properties format reads .properties resource bundles, extracts the value of each entry as a translatable block, and writes the translations back while preserving keys, comments, and layout. It is the standard format for Java application and library localization.

Each line is a key=value (or key:value) entry; comment lines begin with # or !. By default every value is extracted. You can restrict extraction to entries whose keys match a pattern, treat comments as translator notes, retain or resolve Java escape sequences, and control non-ASCII escaping in the output.

IDproperties
SourceBuilt-in
Extensions.properties
MIME Typestext/x-java-properties
CapabilitiesRead + Write

How kapi reads it

Parameters

ParameterTypeDefaultDescription
codeFinderRulesarrayRegex patterns that match inline codes within translatable text
commentsAreNotesbooleantrueTreat comments as translator notes attached to the following entry
escapeExtendedCharsbooleantrueEscape extended Unicode characters (non-ASCII) in output using \uXXXX notation
extraCommentsbooleanfalseRecognize semicolon and double-slash comment styles in addition to standard # and ! markers
extractOnlyMatchingKeybooleantrueWhen enabled, extract only entries whose keys match the condition; otherwise exclude matching keys
keyConditionstring.*text.*Regular expression pattern to test against property keys for extraction filtering
separatorstring=Key-value separator character (typically '=' or ':')
useCodeFinderbooleanfalseEnable regex-based inline code detection within property values
useJavaEscapesbooleanfalseKeep Java property escape sequences (\: \= \# \!) in extracted text instead of resolving them
useKeyConditionbooleanfalseFilter entries for extraction based on a regex condition applied to their keys

Configure these parameters interactively and copy the YAML on the Format Reference.

Examples

Translate only label keys

Extract only entries whose keys contain "label".

useKeyCondition: true
keyCondition: ".*label.*"
extractOnlyMatchingKey: true

UTF-8 output

Emit characters literally instead of \uXXXX escapes.

escapeExtendedChars: false

Processing notes

  • Each entry's value becomes a translatable block; keys, separators, and comments form the non-translatable skeleton.

  • Multi-line values continued with a trailing backslash are joined per the properties format.

Limitations

  • The key filter is a single regex applied to each key; there is no per-pattern routing of values to different handlers.

← Back to the Format Reference