From 1ff67157a91500451d6bd825cc118abde2585a0b Mon Sep 17 00:00:00 2001
From: Ashley <iamashley@duck.com>
Date: Sat, 23 Sep 2023 15:30:53 +0000
Subject: [PATCH] add Region settings

---
 html/poketube.ejs | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/html/poketube.ejs b/html/poketube.ejs
index ca1e238b..a673317f 100644
--- a/html/poketube.ejs
+++ b/html/poketube.ejs
@@ -660,7 +660,10 @@ But Please note that unofficial instances can add the same lock icon, so please
         </a>
     
 
-        
+          				<a href="/settings" style="text-decoration: none;" class="dropdown__item">
+                            <i  class="fa-light fa-globe"></i>
+Region settings        </a>
+    
                           <% if (!a) { %>  
 
         		<a href="/watch?v=<%=inv_vid.videoId%>&a=false" title="Ambient mode uses a lighting effect to make watching videos more immersive by casting gentle colors from the video into your screen’s background! owo" style="text-decoration: none;" class="dropdown__item">
@@ -1743,7 +1746,16 @@ if (isFirstLoad) {
 }
   
 </script>
-    
+     <script>
+const languageCode = localStorage.getItem("Language");
+const regionCode = localStorage.getItem("Region");
+const currentURL = location.href;
+
+if (languageCode && regionCode) {
+  location.href = currentURL + `&region=${regionCode}&hl=${languageCode}`;
+}
+
+    </script>
 <!-- app.js -->
 <!-- app.js -->
 <!-- app.js -->