diff --git a/gradle/changelog/html_language_tag.yaml b/gradle/changelog/html_language_tag.yaml new file mode 100644 index 0000000000..f53a9bf6e2 --- /dev/null +++ b/gradle/changelog/html_language_tag.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: Language tag of top level html element ([#1705](https://github.com/scm-manager/scm-manager/pull/1705)) diff --git a/scm-ui/ui-webapp/src/containers/Index.tsx b/scm-ui/ui-webapp/src/containers/Index.tsx index 74ac89c02c..12edbc7e10 100644 --- a/scm-ui/ui-webapp/src/containers/Index.tsx +++ b/scm-ui/ui-webapp/src/containers/Index.tsx @@ -29,6 +29,7 @@ import ScrollToTop from "./ScrollToTop"; import IndexErrorPage from "./IndexErrorPage"; import { useIndex } from "@scm-manager/ui-api"; import { Link } from "@scm-manager/ui-types"; +import i18next from "i18next"; const Index: FC = () => { const { isLoading, error, data } = useIndex(); @@ -36,6 +37,10 @@ const Index: FC = () => { // TODO check componentDidUpdate method for anonymous user stuff + i18next.on("languageChanged", (lng) => { + document.documentElement.setAttribute("lang", lng); + }); + if (error) { return ( <>