From fed18c582074b66fc660946dc2f419031cc6c1b5 Mon Sep 17 00:00:00 2001 From: fkellner Date: Tue, 10 Sep 2024 14:31:53 +0200 Subject: [PATCH] geosolutions-it#10158: set HTML document language once per mount/update As requested, the document language is now set when the component is mounted or the language is changed instead of with every rerender. --- web/client/components/I18N/Localized.jsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/web/client/components/I18N/Localized.jsx b/web/client/components/I18N/Localized.jsx index 6b194d08afc..8473efee2be 100644 --- a/web/client/components/I18N/Localized.jsx +++ b/web/client/components/I18N/Localized.jsx @@ -37,7 +37,6 @@ class Localized extends React.Component { if (typeof children === 'function') { children = children(); } - document.documentElement.setAttribute("lang", this.props.locale); return ( { return Object.keys(messages).reduce((previous, current) => { return typeof messages[current] === 'string' ? {