Update index.html

This commit is contained in:
FURK4NGG
2024-09-09 16:58:53 +03:00
committed by GitHub
parent 8c62fb0805
commit ad1123ffa4
+12 -2
View File
@@ -16,10 +16,20 @@
<script>
document.addEventListener('DOMContentLoaded', () => {
const userLang = navigator.language || navigator.userLanguage;
// İçeriği dil tercihine göre yükleme
if (userLang.startsWith('tr')) {
window.location.replace('/hometr.html');
fetch('/hometr.html')
.then(response => response.text())
.then(html => {
document.documentElement.innerHTML = html; // Türkçe içeriği yükle
});
} else {
window.location.replace('/home.html');
fetch('/home.html')
.then(response => response.text())
.then(html => {
document.documentElement.innerHTML = html; // İngilizce içeriği yükle
});
}
});