summaryrefslogtreecommitdiffstats
path: root/src/components/Layouts/Layout.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Layouts/Layout.tsx')
-rw-r--r--src/components/Layouts/Layout.tsx13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/components/Layouts/Layout.tsx b/src/components/Layouts/Layout.tsx
index d3c13ad..a4d1d28 100644
--- a/src/components/Layouts/Layout.tsx
+++ b/src/components/Layouts/Layout.tsx
@@ -6,6 +6,9 @@ import Main from '@components/Main/Main';
import Breadcrumb from '@components/Breadcrumb/Breadcrumb';
import { t } from '@lingui/macro';
import 'prism-themes/themes/prism-coldark-cold.min.css';
+import { addPrismClasses, translateCopyButton } from '@utils/helpers/prism';
+import { useRouter } from 'next/router';
+import { config } from '@config/website';
const Layout = ({
children,
@@ -14,9 +17,17 @@ const Layout = ({
children: ReactNode;
isHome?: boolean;
}) => {
+ const router = useRouter();
+ const locale = router.locale ? router.locale : config.defaultLocale;
+
useEffect(() => {
+ addPrismClasses();
Prism.highlightAll();
- }, []);
+ });
+
+ useEffect(() => {
+ translateCopyButton(locale);
+ }, [locale]);
return (
<>