Class PoFile
java.lang.Object
ch.autumo.ui.utils.PoFile
A minimal gettext PO reader.
Understood: msgctxt, msgid, msgstr, continuation lines, the usual
C escapes (including octal), comments, references, #, fuzzy entries and the file
header entry. Not understood: plural forms (msgid_plural / msgstr[n]);
the singular translation msgstr[0] is used if present.
The lookup key is msgctxt + '\0' + msgid, or just the msgid when there is
no context (see key(String, String)). Entries with an empty translation or flagged
fuzzy are dropped, which is exactly gettext's fallback behaviour: use the source text.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charSeparator between the optional message context and the message id in a lookup key. -
Method Summary
-
Field Details
-
CONTEXT_SEPARATOR
public static final char CONTEXT_SEPARATORSeparator between the optional message context and the message id in a lookup key.- See Also:
-
-
Method Details
-
parse
Parses a PO document.- Parameters:
text- PO document- Returns:
- lookup key - translation (untranslated and fuzzy entries left out)
- Throws:
IOException- on a read error
-
key
-