Added logic to base langauge on lang attribute of html element.
Added minimised version of initial file.