Allow generic translation of HTML attributes
Summary
Currently, the translation system handles
- Changing the content of a tag (trmsg/trspan)
- Changing the content of the placeholder= attribute (trplaceholder)
- (plus some minor other things)
It would be nice to be able to also translate title=
, alt=
, aria-description
, data-whatever
tags, in a generic way. This would make trplaceholder
obsolete (but we'll keep it for compatibility)
Design proposition
-
<tag trattribute-alt="altText" trattribute-description="descriptionText">
would be nice, but CSS selectors cannot find trattribute-* -
<tag trattribute="alt:altText description:descriptionText">
is not as elegant but can be selected by jQuery without iterating on all HTML tags