translate.storage.xml_extract.extract

Package translate :: Package storage :: Package xml_extract :: Module extract |
[hide private]
[frames] | no frames]

# Module extract

source code

Classes | [hide private]
| Translatable A node corresponds to a translatable element.
| ParseState Maintain constants and variables used during the walking of a DOM tree (via the function apply).
| IdMaker

Functions | [hide private]
Nullable(t) | source code
reduce_unit_tree(f, unit_node, *state) | source code
_process_placeable(dom_node, state) Run find_translatable_dom_nodes on the current dom_node | source code
_process_placeables(dom_node, state) Return a list of placeables and list with alternating string-placeable objects. | source code
_process_translatable(dom_node, state) | source code
_process_children(dom_node, state) | source code
compact_tag(nsmap, namespace, tag) | source code
find_translatable_dom_nodes(dom_node, state) | source code
_to_placeables(parent_translatable, translatable, id_maker) | source code
_add_translatable_to_store(store, parent_translatable, translatable, id_maker) Construct a new translation unit, set its source and location information and add it to 'store'. | source code
_contains_translatable_text(translatable) Checks whether translatable contains any chunks of text which contain more than whitespace. | source code
_make_store_adder(store) Return a function which, when called with a Translatable will add a unit to 'store'. | source code
_walk_translatable_tree(translatables, f, parent_translatable, rid) | source code
reverse_map(a_map) | source code
build_store(odf_file, store, parse_state, store_adder=None) Utility function for loading xml_filename | source code

Variables | [hide private]
| TranslatableClass = `Class('Translatable')`

Imports: etree, base, accepts, Self, IsCallable, IsOneOf, Any, Class, Number, contextmanager, nested, with_, xpath_breadcrumb, misc, xliff, StringElem

Function Details | [hide private]

### reduce_unit_tree(f, unit_node, *state) | source code
Decorators: `@accepts(IsCallable(), Translatable, state= [Any()])`

### _process_placeable(dom_node, state) | source code
Run find_translatable_dom_nodes on the current dom_node Decorators: `@accepts(etree._Element, ParseState)`

### _process_placeables(dom_node, state) | source code
Return a list of placeables and list with alternating string-placeable objects. The former is useful for directly working with placeables and the latter is what will be used to build the final translatable string. Decorators: `@accepts(etree._Element, ParseState)`

### _process_translatable(dom_node, state) | source code
Decorators: `@accepts(etree._Element, ParseState)`

### _process_children(dom_node, state) | source code
Decorators: `@accepts(etree._Element, ParseState)`

### find_translatable_dom_nodes(dom_node, state) | source code
Decorators: `@accepts(etree._Element, ParseState)`

### _to_placeables(parent_translatable, translatable, id_maker) | source code
Decorators: `@accepts(Nullable(Translatable), Translatable, IdMaker)`

### _add_translatable_to_store(store, parent_translatable, translatable, id_maker) | source code
Construct a new translation unit, set its source and location information and add it to 'store'. Decorators: `@accepts(base.TranslationStore, Nullable(Translatable), Translatable, IdMaker)`

### _contains_translatable_text(translatable) | source code
Checks whether translatable contains any chunks of text which contain more than whitespace. If not, then there's nothing to translate. Decorators: `@accepts(Translatable)`

### _make_store_adder(store) | source code
Return a function which, when called with a Translatable will add a unit to 'store'. The placeables will represented as strings according to 'placeable_quoter'. Decorators: `@accepts(base.TranslationStore)`

### _walk_translatable_tree(translatables, f, parent_translatable, rid) | source code
Decorators: `@accepts([Translatable], IsCallable(), Nullable(Translatable), Number)`

### build_store(odf_file, store, parse_state, store_adder=None) | source code
Utility function for loading xml_filename Decorators: `@accepts(lambda obj: hasattr(obj, "read"), base.TranslationStore, ParseState, Nullable(IsCallable()))`