From 861de650f581cb3078d73125018e9870ef3ef266 Mon Sep 17 00:00:00 2001
From: Henrik Larsson <hankisch@gmail.com>
Date: Mon, 8 May 2023 09:32:08 +0200
Subject: [PATCH] Played around with language options

---
 components/ui/locale-switcher/locale-switcher.tsx | 4 ++--
 middleware.ts                                     | 5 +----
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/components/ui/locale-switcher/locale-switcher.tsx b/components/ui/locale-switcher/locale-switcher.tsx
index d4f074c2e..b3f2348e2 100644
--- a/components/ui/locale-switcher/locale-switcher.tsx
+++ b/components/ui/locale-switcher/locale-switcher.tsx
@@ -1,5 +1,3 @@
-'use client'
-
 import FlagEn from 'components/icons/flag-en';
 import FlagSv from 'components/icons/flag-sv';
 import {
@@ -20,6 +18,7 @@ export default function LocaleSwitcher() {
   const [isOpen, setIsOpen] = useState(false)
   const router = useRouter();
   
+  // Handle redirected pathname.
   const redirectedPathName = (locale: string) => {
     if (!pathName) return '/'
     const segments = pathName.split('/')
@@ -27,6 +26,7 @@ export default function LocaleSwitcher() {
     return segments.join('/')
   }
 
+  // Handle click on dropdown menu item (<li>).
   const handleClick = (e: any, locale: string) => {
     e.preventDefault()
 
diff --git a/middleware.ts b/middleware.ts
index b1849e5c5..decff6084 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -2,13 +2,10 @@ import createMiddleware from 'next-intl/middleware';
  
 export default createMiddleware({
   // A list of all locales that are supported
-  locales: ['sv', 'en', 'nn'],
+  locales: ['sv', 'en'],
  
   // If this locale is matched, pathnames work without a prefix (e.g. `/about`)
   defaultLocale: 'sv',
-
-  // Don't automatically detect locale, sv is default.
-  localeDetection: false
 });
  
 export const config = {