zbraniecki/l20n — pull request #6 by stasm (2012-01-17 23:21:31+00:00)
Title: Make reordering work with retranslation

When retranslating a node, if it's been translated before and some child nodes have been reordered, `l10n-path` attributes end up pointing to wrong nodes. For instance, assuming `l10n-path="strong[2]"` was meant to match the first `strong` in the translation with the second `strong` in the source content, if the content has already been translated at least once and the nodes have already been reordered according to instructions in `l10n-path`, the relevant `strong` is now the first strong.

In this patch, instead of keeping a shadow copy of the source content somewhere, I suggest that we detect if the node in the current DOM already defines a `l10n-path` and follow it if so.

Hopefully the comments in the code will make this much clearer.