On Thu, Jan 23, 2014 at 10:18:22AM +0100, Pino Toscano wrote:
If you notice the notes reading, I'm sorting the list by
"language", so
the empty string (= no translation) should always be the first, if
present. So your lists above would actually be:
[ "", "some notes" ]
[ "en", "some notes"; "ru", "..." ]
[ "", "..."; "ru", "..." ]
[]
I did that to just refactor without actually changing the behaviour,
that is show the untranslated notes, thus also printing nothing if there
are notes[..]= entries but no notes= one.
Other than that, sorting the list will help later when printing all the
translated notes to JSON.
OK, got it. Can you still change the patch to avoid the _ match
case. I think something like this should work:
| { Index_parser.notes = ("", notes) :: _ } -> (* print notes *)
| { Index_parser.notes = _ :: _ }
| { Index_parser.notes = [] } -> (* no untranslated notes *)
ACK with that change.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top