Skip to content

Commit ca25ffb

Browse files
authored
Merge pull request #62 from nini22P/main
feat: add download link for WebGAL Terre for Android
2 parents c3ff9c3 + 5514ee8 commit ca25ffb

File tree

5 files changed

+42
-38
lines changed

5 files changed

+42
-38
lines changed

app/[locale]/download/components/DownloadWebgalTerre.tsx

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import Button from '@/components/Button/Button'
44
import useWebgalTerreAssets from '@/hooks/useWebgalTerreAssets'
55
import Link from 'next/link'
6-
import {RiGithubFill, RiMicrosoftFill, RiAppleFill, RiUbuntuFill} from 'react-icons/ri'
6+
import { RiGithubFill, RiMicrosoftFill, RiAppleFill, RiUbuntuFill, RiAndroidFill } from 'react-icons/ri'
77
import styles from '../Download.module.css'
8-
import {useLocale, useTranslations} from 'next-intl'
9-
import {i18n} from '@/i18n'
8+
import { useLocale, useTranslations } from 'next-intl'
9+
import { i18n } from '@/i18n'
1010

1111
const DownloadWebgalTerre = () => {
1212

@@ -28,20 +28,21 @@ const DownloadWebgalTerre = () => {
2828
: null
2929

3030
const platformMap = [
31-
{platform: 'windows', icon: <RiMicrosoftFill/>, label: t('downloadWindows')},
32-
{platform: 'windowsSetup', icon: <RiMicrosoftFill/>, label: t('downloadWindowsSetup')},
33-
{platform: 'windowsArm64', icon: <RiMicrosoftFill/>, label: t('downloadWindowsArm64')},
34-
{platform: 'windowsArm64Setup', icon: <RiMicrosoftFill/>, label: t('downloadWindowsArm64Setup')},
35-
{platform: 'macos', icon: <RiAppleFill/>, label: t('downloadMacos')},
36-
{platform: 'linux', icon: <RiUbuntuFill/>, label: t('downloadLinux')},
37-
{platform: 'linuxArm64', icon: <RiUbuntuFill/>, label: t('downloadLinuxArm64')},
31+
{ platform: 'windows', icon: <RiMicrosoftFill />, label: t('downloadWindows') },
32+
{ platform: 'windowsSetup', icon: <RiMicrosoftFill />, label: t('downloadWindowsSetup') },
33+
{ platform: 'windowsArm64', icon: <RiMicrosoftFill />, label: t('downloadWindowsArm64') },
34+
{ platform: 'windowsArm64Setup', icon: <RiMicrosoftFill />, label: t('downloadWindowsArm64Setup') },
35+
{ platform: 'macos', icon: <RiAppleFill />, label: t('downloadMacos') },
36+
{ platform: 'linux', icon: <RiUbuntuFill />, label: t('downloadLinux') },
37+
{ platform: 'linuxArm64', icon: <RiUbuntuFill />, label: t('downloadLinuxArm64') },
38+
{ platform: 'android', icon: <RiAndroidFill />, label: t('downloadAndroid') }
3839
]
3940

4041
const downloadUrls = webgalTerreAssets?.downloadUrl
4142
.map((item) => {
4243
const test = platformMap.find(platform => item.platform === platform.platform)
4344
if (test)
44-
return {url: item.url, ...test}
45+
return { url: item.url, ...test }
4546
})
4647

4748
const isZh = locale === 'zh-cn'
@@ -63,44 +64,44 @@ const DownloadWebgalTerre = () => {
6364
<p><strong>{t('releaseNote')}:</strong> {!(releaseNote) && t('fetching')}</p>
6465
{
6566
releaseNote &&
66-
< div dangerouslySetInnerHTML={{__html: releaseNote}} className={styles['release-note']}/>
67+
< div dangerouslySetInnerHTML={{ __html: releaseNote }} className={styles['release-note']} />
6768
}
6869
</div>
6970
</div>
7071
<div className={styles['card-button-gourp']}>
7172
<Button terre>
72-
<Link href={webgalTerreUrl} target={'_blank'}><RiGithubFill/>{t('gitHubReleases')}</Link>
73+
<Link href={webgalTerreUrl} target={'_blank'}><RiGithubFill />{t('gitHubReleases')}</Link>
7374
</Button>
7475
{
7576
downloadUrls &&
7677
downloadUrls.map((item) =>
7778
item?.url &&
78-
<Button terre key={item.platform}>
79-
<Link href={item.url} target='_top'>{item.icon}{item.label}</Link>
80-
</Button>
79+
<Button terre key={item.platform}>
80+
<Link href={item.url} target='_top'>{item.icon}{item.label}</Link>
81+
</Button>
8182
)
8283
}
8384

8485
</div>
8586
{
8687
isZh && downloadUrls && <div className={styles.cndownload}>
8788
{/*<details className='space-y-4'>*/}
88-
<div className='text-terre select-none'>
89-
{t('otherDownloadLinkInfo')}
90-
</div>
91-
<div className={styles['card-button-gourp']}>
92-
{
93-
downloadUrls &&
94-
downloadUrls.map((item) =>
95-
item?.url &&
96-
<Button terre key={item.platform}>
97-
<Link href={ghproxyStr + item.url} target='_top'>{item.icon}{item.label}</Link>
98-
</Button>
99-
)
100-
}
101-
</div>
102-
{/*</details>*/}
89+
<div className='text-terre select-none'>
90+
{t('otherDownloadLinkInfo')}
91+
</div>
92+
<div className={styles['card-button-gourp']}>
93+
{
94+
downloadUrls &&
95+
downloadUrls.map((item) =>
96+
item?.url &&
97+
<Button terre key={item.platform}>
98+
<Link href={ghproxyStr + item.url} target='_top'>{item.icon}{item.label}</Link>
99+
</Button>
100+
)
101+
}
103102
</div>
103+
{/*</details>*/}
104+
</div>
104105
}
105106
</div>
106107
)

hooks/useWebgalTerreAssets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const useWebgalTerreAssets = (webgalTerreApiUrl: string) => {
2323
{ platform: 'macos', url: findAssetsUrl(data.assets, 'mac.*.zip') },
2424
{ platform: 'linux', url: findAssetsUrl(data.assets, 'Linux.*.zip') },
2525
{ platform: 'linuxArm64', url: findAssetsUrl(data.assets, 'Linux_Arm64.*.zip') },
26+
{ platform: 'android', url: findAssetsUrl(data.assets, 'Android.*.apk') }
2627
]
27-
2828
}
2929
))
3030
} catch (error) {

locales/en.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
"multiplatform": {
7676
"title": "Multi Platform",
77-
"line0": "WebGAL Terre support Windows / macOS / Linux",
77+
"line0": "WebGAL Terre support Windows / macOS / Linux / android",
7878
"line1": "Export game support Web / Windows / macOS / Linux / android"
7979
}
8080
},
@@ -95,6 +95,7 @@
9595
"downloadMacos": "Download macOS zip",
9696
"downloadLinux": "Download Linux zip",
9797
"downloadLinuxArm64": "Download Linux Arm64 zip",
98+
"downloadAndroid": "Download Android apk",
9899
"otherDownloadLink": "Other Download Link",
99100
"otherDownloadLinkInfo": "If the above download address is slow, please try using the following download address",
100101
"systemRequirements": {
@@ -145,4 +146,4 @@
145146
"bilibili": "Bilibili",
146147
"links": "Links"
147148
}
148-
}
149+
}

locales/ja.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
"multiplatform": {
7676
"title": "マルチプラットフォームのサポート",
77-
"line0": "WebGAL Terre が Windows / macOS / Linux での開発をサポート",
77+
"line0": "WebGAL Terre が Windows / macOS / Linux / android での開発をサポート",
7878
"line1": "開発したゲームは Web / Windows / macOS / Linux / Android でプレイできる"
7979
}
8080
},
@@ -95,6 +95,7 @@
9595
"downloadMacos": "macOS zip をダウンロード",
9696
"downloadLinux": "Linux zip をダウンロード",
9797
"downloadLinuxArm64": "Linux Arm64 zip をダウンロード",
98+
"downloadAndroid": "Android apk をダウンロード",
9899
"otherDownloadLink": "その他のダウンロードリンク",
99100
"otherDownloadLinkInfo": "上記のダウンロードリンクが遅い場合は、以下のダウンロードリンクをお試しください",
100101
"systemRequirements": {
@@ -145,4 +146,4 @@
145146
"bilibili": "Bilibili",
146147
"links": "フレンドリーリンク"
147148
}
148-
}
149+
}

locales/zh-cn.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
},
7575
"multiplatform": {
7676
"title": "多平台支持",
77-
"line0": "WebGAL Terre 支持 Windows / macOS / Linux",
77+
"line0": "WebGAL Terre 支持 Windows / macOS / Linux / android",
7878
"line1": "导出游戏支持 Web / Windows / macOS / Linux / android"
7979
}
8080
},
@@ -95,6 +95,7 @@
9595
"downloadMacos": "下载 macOS 压缩包",
9696
"downloadLinux": "下载 Linux 压缩包",
9797
"downloadLinuxArm64": "下载 Linux Arm64 压缩包",
98+
"downloadAndroid": "下载 Android apk",
9899
"otherDownloadLink": "其它下载地址",
99100
"otherDownloadLinkInfo": "如果上面的下载地址下载速度比较慢,请尝试使用以下下载地址",
100101
"systemRequirements": {
@@ -145,4 +146,4 @@
145146
"bilibili": "哔哩哔哩",
146147
"links": "友情链接"
147148
}
148-
}
149+
}

0 commit comments

Comments
 (0)