From d76e7c054e51471c908707634f5dbdcd3422b8d9 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 3 Jan 2022 15:32:01 +0100
Subject: chore: add line numbers to all prism blocks and translate copy button

---
 src/components/Layouts/Layout.tsx | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'src/components/Layouts/Layout.tsx')

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 (
     <>
-- 
cgit v1.2.3

