Java JDK .properties (Resource Bundle) Parser Plugin

Plugin source location: <serge_root>/lib/Serge/Engine/Plugin/parse_properties.pm

This parser extracts strings from files in Java .properties format.

Note that .properties files don't have an official way to provide context or comments for localized strings. This plugin supports special #.flag and #.param=value comment lines that affect the key=value line that goes immediately below it. For example, #.internal allows one to prevent certain strings from being extracted for translation, #.context=value sets the context for the string, and one or more #.comment=comment line lines define a comment that will be extracted and associated with the string. All other (unknown) flags are appended as hashtags to the hint; in other words, #.myhashtag is equivalent to #.comment=#myhashtag line. If there's a blank line between such special comments and a key=value line, these comments are discarded.

Code Examples

example.properties
key1 = string #.settings #.ui #.admin key2 : string #.internal key3 = non-translatable string #.context=verb key4 = string #.comment=comment line 1 #.comment=comment line 2 key5 = string key6 = multi-line \ string ...

Usage

example-project.serge