html: Retain untranslated attributes

Without this change, the values of untranslated attributes were silently dropped.
html: Added a test for untranslated attributes
html: improve code readability

Lets make that logic readable by mere mortals.