Implement smart capitalization based on locale (#17860)

This commit is contained in:
Nicolas Mowen
2025-04-22 16:21:09 -06:00
committed by GitHub
parent b6e0e5698a
commit f9b2db4405
44 changed files with 95 additions and 71 deletions
+9 -1
View File
@@ -6,12 +6,13 @@ import Sidebar from "@/components/navigation/Sidebar";
import { isDesktop, isMobile } from "react-device-detect";
import Statusbar from "./components/Statusbar";
import Bottombar from "./components/navigation/Bottombar";
import { Suspense, lazy } from "react";
import React, { Suspense, lazy } from "react";
import { Redirect } from "./components/navigation/Redirect";
import { cn } from "./lib/utils";
import { isPWA } from "./utils/isPWA";
import ProtectedRoute from "@/components/auth/ProtectedRoute";
import { AuthProvider } from "@/context/auth-context";
import { useTranslation } from "react-i18next";
const Live = lazy(() => import("@/pages/Live"));
const Events = lazy(() => import("@/pages/Events"));
@@ -26,6 +27,13 @@ const Logs = lazy(() => import("@/pages/Logs"));
const AccessDenied = lazy(() => import("@/pages/AccessDenied"));
function App() {
const { i18n } = useTranslation();
// Set the lang attribute on the html element when language changes
React.useEffect(() => {
document.documentElement.lang = i18n.language;
}, [i18n.language]);
return (
<Providers>
<AuthProvider>