Correct the lang and dir attributes for documentation language

The lang and dir attributes must reflect the actual language
that is being displayed or edited. "qqq", or whatever the documentation
language code is, shouldn't be a value for lang.

When the target language is the documentation language, use
the site's content language code for this, assuming that that
will be the documentation language.

Change-Id: I7319894f0b627cac118c48d4738993c8106f9ca8