Name Description Size
__init__.py 124
parse.py Parse an Android strings XML file into a message resource. If any internal DOCTYPE entities are declared, they are included as messages in an "!ENTITY" section. Resource and entry attributes are parsed as metadata. All XML, Android, and printf escapes are unescaped except for %n, which has a platform-dependent meaning. Spans of text and entities wrapped in an <xliff:g> will be parsed as expressions with a "translate": "no" attribute. Spans including elements will be wrapped with open/close markup with a similar attribute. 17278
serialize.py Serialize a resource as an Android strings XML file. Section comments and metadata are not supported. Resource and entry metadata must be stringifiable, as they're stored in XML attributes. Messages in '!ENTITY' sections are included in a !DOCTYPE declaration. Otherwise, sections must be anonymous. Multi-part message identifiers are only supported for <string-array> values, for which the second part must be convertible to an int. Expressions with a "translate": "no" attribute will be wrapped with an <xliff:g> element. If such an expression includes a "source" attribute, that will be used as the element body instead of the literal string or variable name; any variable name will be assigned to the element's "id" attribute. Markup with a "translate": "no" attribute on both the open and close elements will be rendered as <xliff:g> elements. Except for "entity" and "reference", function annotations are ignored. 15736