To be sharp: the WebAPI team (hi @mounirlamouri !) recommended not to set the lang/dir attributes “magically” with `l10n.js`. So even if `l10n.js` supported frames, we’d still have to write most of this code to set the lang/dir attributes of these framed documents.

However, I’d be tempted to let `mozL10n.translate` update the lang/dir attributes of the target element *if these attributes are only defined* — only in this case, and only for the target element: It would *not* set lang/dir attributes in child elements magically.

@mounirlamouri > if you agree with that?

If yes, then the second question would be: should `l10n.js` supports frames (i.e. try to translate all frame children)? I tend to think it should not, but usually you disagree with me. :-p

Note that as far as I know, the SMS app is the only one that requires localized frames so far: such a code factorization does not seem really important yet, but I agree we should do it if it makes sense. I’ll trust our WebAPI folks to judge that.