-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
749 additions
and
615 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<script setup> | ||
import Swal from 'sweetalert2'; | ||
const userLang = navigator.language || navigator.userLanguage; | ||
const isChinese = userLang.startsWith('zh'); | ||
if (isChinese) { | ||
Swal.fire({ | ||
title: '语言切换', | ||
text: '检测到您的浏览器语言为中文,是否跳转到中文站点?', | ||
icon: 'question', | ||
showCancelButton: true, | ||
confirmButtonText: '是', | ||
cancelButtonText: '否' | ||
}).then((result) => { | ||
if (result.isConfirmed) { | ||
window.location.href = '/zh_cn/'; | ||
} | ||
}); | ||
} | ||
</script> | ||
<template> | ||
<div /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Swal from 'sweetalert2'; | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
const userLang = navigator.language || navigator.userLanguage; | ||
const isChinese = userLang.startsWith('zh'); | ||
|
||
if (isChinese) { | ||
Swal.fire({ | ||
title: '语言切换', | ||
text: '检测到您的浏览器语言为中文,是否跳转到中文站点?', | ||
icon: 'question', | ||
showCancelButton: true, | ||
confirmButtonText: '是', | ||
cancelButtonText: '否' | ||
}).then((result) => { | ||
if (result.isConfirmed) { | ||
window.location.href = '/zh/'; | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.