diff --git a/web/client/components/I18N/Localized.jsx b/web/client/components/I18N/Localized.jsx index ea51c864309..6b194d08afc 100644 --- a/web/client/components/I18N/Localized.jsx +++ b/web/client/components/I18N/Localized.jsx @@ -37,6 +37,7 @@ class Localized extends React.Component { if (typeof children === 'function') { children = children(); } + document.documentElement.setAttribute("lang", this.props.locale); return ( { expect(dom.innerHTML).toBe("my message"); }); + it('correctly sets the document language', () => { + ReactDOM.render( + + {() => } + + , document.getElementById("container")); + expect(document.documentElement.lang).toBe("it-IT"); + ReactDOM.render( + + {() => } + + , document.getElementById("container")); + expect(document.documentElement.lang).toBe("de-DE"); + }); + it('localizes wrapped HTML component', () => { var localized = ReactDOM.render(