Preventing duplicate appearance of elements with translations

A comprehensive follow-up to
I327868b8e605c0045fabd6a5882e2de4ca156e31

Includes tests.

Change-Id: I2c35f3bdd5c3f684623f6ac5bd5420af06279cd6