| __init__.py |
|
287 |
- |
| common.py |
See https://lxml.de/tutorial.html#namespaces |
3436 |
- |
| parse.py |
Parse an XLIFF 1.2 file into a message resource.
Sections identify files and groups within them,
with the first identifier part parsed as the <file> "original" attribute,
and later parts as <group> "id" attributes.
An entry's value represents the <target> of a <trans-unit>,
or the <source> if `source_entries` is True.
Other elements and attributes are represented by metadata.
Comments are parsed from the <note> elements,
as well as being represented by metadata.
Metadata keys encode XML element data, using XPath expressions as keys.
XLIFF files generated by XCode are detected from the presence of a
`<tool tool-id="com.apple.dt.xcode"/>` element inside each `<file>`.
For such files, XCode-style printf strings are parsed as variable references,
and plural & device variance is supported.
NOTE: At most one substitution is supported,
and combinations of selectors (such as device + plural) are not supported.
|
9521 |
- |
| parse_trans_unit.py |
|
3480 |
- |
| parse_xcode.py |
|
20714 |
- |
| serialize.py |
Serialize a resource as an XLIFF 1.2 file.
Sections identify files and groups within them,
with the first identifier part parsed as the <file> "original" attribute,
and later parts as <group> "id" attributes.
An entry's value is represented as the <target> of a <trans-unit>,
or the <source> if `source_entries` is True.
Metadata keys encode XML element data, using XPath expressions as keys.
For namespaced attribute and element names of the form `ns:foo`,
the resource should have an `xmlns:ns` metadata entry with its URI value.
Entry comment values are ignored unless the Entry contains no `note` metadata entries.
SelectMessage values are only supported in .stringsdict files,
and their structure must closely match that generated by parse_xliff().
`source_entries` is not supported with SelectMessage values.
|
17811 |
- |
| utils.py |
Does this resource appear to be generated by XCode?
|
888 |
- |