Skip to content

Commit 231cb01

Browse files
committed
init
1 parent a3f115e commit 231cb01

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/lib/components/LanguageSelector.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<script>
22
import { page } from '$app/stores';
3-
import { base } from '$app/paths';
43
import { flip } from 'svelte/animate';
54
import { fly } from 'svelte/transition';
65
6+
// Base path from build config
7+
const BASE_PATH = '/deva-support';
8+
79
const languages = [
810
{ code: 'en', name: 'English', flag: '🇺🇸' },
911
{ code: 'zh-cn', name: '简体中文', flag: '🇨🇳' },
@@ -27,7 +29,7 @@
2729
});
2830
2931
function changeLanguage(langCode) {
30-
window.location.href = `${base}/${langCode}`;
32+
window.location.href = `${BASE_PATH}/${langCode}`;
3133
}
3234
3335
function getCurrentLanguage() {

src/routes/+layout.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<script>
22
import './layout.css';
33
import LanguageSelector from '$lib/components/LanguageSelector.svelte';
4-
import { base } from '$app/paths';
4+
5+
// Base path from build config
6+
const BASE_PATH = '/deva-support';
57
68
let { children } = $props();
79
</script>
810

911
<svelte:head>
10-
<link rel="icon" href="{base}/favico.png" />
12+
<link rel="icon" href="{BASE_PATH}/favico.png" />
1113
<link rel="preconnect" href="https://fonts.googleapis.com" />
1214
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1315
<link

src/routes/+page.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<script>
22
import { browser } from '$app/environment';
3-
import { base } from '$app/paths';
3+
4+
// Base path from build config
5+
const BASE_PATH = '/deva-support';
46
57
// Redirect to browser language or default to English
68
if (browser) {
@@ -26,7 +28,7 @@
2628
targetLang = baseLang;
2729
}
2830
29-
window.location.href = `${base}/${targetLang}`;
31+
window.location.href = `${BASE_PATH}/${targetLang}`;
3032
}
3133
</script>
3234

0 commit comments

Comments
 (0)