Skip to content

Let's use AI to Earn!

fix(web): Improved multi-page and multi-language support - Fixed hard-coded text in Register, Profile, VIP, Tasks, and Material pages. (#224)

布莱恩·奥夫托·杰森张088162a40361
diff --git a/project/web/@types/resources.d.ts b/project/web/@types/resources.d.ts
index 113a4818..bb8fbcf8 100644
--- a/project/web/@types/resources.d.ts
+++ b/project/web/@types/resources.d.ts
@@ -11,7 +11,7 @@ interface Resources {
allPlatforms: '所有平台'
accountManager: '账号管理器'
addAccount: '添加频道'
- mcpManager: 'MCP 管理器'
+ mcpManagerTit: 'MCP 管理器'
online: '在线'
offline: '离线'
checkLoginStatus: '登录状态检测'
@@ -149,6 +149,128 @@ interface Resources {
content: '您的 {{platformName}} 账号 "{{nickname}}"(位于 {{spaceName}})会话已过期。是否重新登录?'
loginAgain: '重新登录'
}
+ userManage: {
+ selected: '已选择'
+ accounts: '个账号'
+ deleteAccount: '删除账号'
+ }
+ wechatBrowserTip: {
+ clickCorner: '点击右上角的'
+ dotsButton: '按钮'
+ selectBrowser: '选择'
+ openInBrowser: '在浏览器中打开'
+ }
+ mobileDownloadTip: {
+ welcomeTitle: '欢迎使用 AitoEarn'
+ description: '为了获得完整体验,请在设备上下载 App'
+ downloadButton: '下载 App'
+ }
+ browserTip: {
+ title: '请在浏览器中打开'
+ description: '请点击右上角,通过浏览器打开'
+ button: '我知道了'
+ }
+ platformNames: {
+ douyin: '抖音'
+ xiaohongshu: '小红书'
+ }
+ sidebar: {
+ noAccounts: '暂无账户'
+ noOnlineAccounts: '暂无在线账户'
+ ipLocationTooltip: 'IP: {{ip}}\n位置: {{location}}'
+ moveUp: '上移'
+ moveDown: '下移'
+ }
+ mcpManager: {
+ title: 'MCP 管理器'
+ fetchKeysFailed: '获取MCP Key列表失败'
+ createKeyFailed: '创建MCP Key失败'
+ createAssociationFailed: '创建关联失败: {{account}}'
+ createSuccess: 'MCP Key创建成功!'
+ keyCopied: 'Key已复制到剪贴板'
+ deleteSuccess: 'MCP Key已删除'
+ deleteFailed: '删除MCP Key失败'
+ createNewKey: '创建新Key'
+ noKeys: '暂无MCP Key'
+ noKeysDesc: '点击上方按钮创建您的第一个MCP Key'
+ copy: '复制'
+ detail: '详情'
+ delete: '删除'
+ available: '可用'
+ unavailable: '不可用'
+ createdAt: '创建时间: '
+ associatedAccounts: '关联账户: '
+ accountUnit: '个'
+ pagination: '第 {{start}}-{{end}} 条,共 {{total}} 条'
+ createModal: {
+ title: '创建MCP Key'
+ keyName: 'Key名称'
+ keyNamePlaceholder: '请输入Key名称'
+ keyNameRequired: '请输入Key名称'
+ selectAccounts: '选择账户'
+ selectAccountsPlaceholder: '请选择要关联的账户'
+ selectAccountsRequired: '请选择至少一个账户'
+ selectedCount: '已选择 {{count}} 个账户:'
+ selectAccountsButton: '选择账户'
+ create: '创建'
+ cancel: '取消'
+ }
+ }
+ mediaTypes: {
+ video: '视频'
+ image: '图片'
+ article: '文章'
+ }
+ calendar: {
+ showMore: '显示更多'
+ hideMore: '隐藏更多'
+ }
+ proxy: {
+ label: '代理地址'
+ placeholder: '请输入代理地址'
+ available: '代理地址可用'
+ unavailable: '代理地址不可用'
+ verify: '验证连接'
+ hint: {
+ line1: '1. 代理类型仅支持HTTP、HTTPS、Socks5;'
+ line2: '支持以下填写格式'
+ remark: '备注'
+ username: '代理账号'
+ password: '代理密码'
+ }
+ }
+ }
+ 'aiRank': {
+ menu: {
+ aiToolRanking: 'AI工具排行榜'
+ }
+ ranking: {
+ title: 'AI工具排行榜'
+ allRanking: '总榜'
+ domesticRanking: '国内榜'
+ foreignRanking: '国外榜'
+ weekRanking: '周榜'
+ monthRanking: '月榜'
+ type: '类型'
+ cycle: '周期'
+ }
+ table: {
+ rank: '#'
+ productName: '产品名'
+ tags: '标签'
+ monthlyVisits: '月访问量'
+ monthlyDownloads: '月下载量'
+ weeklyMentions: '周提及量'
+ weeklyMentionsTooltip: '统计AI工具排行榜的周提及作品数'
+ reputation: '声望值'
+ reputationTooltip: '统计AI工具排行榜的提及作品、传播范围等多维度数据分析做出的综合评分'
+ overallScore: '综合评分'
+ overallScoreTooltip: '统计AI工具排行榜的用户使用情况等多维度数据分析做出的综合评分'
+ }
+ cycleSelect: {
+ weekRanking: '周榜'
+ monthRanking: '月榜'
+ }
}
'cgmaterial': {
header: {
diff --git a/project/web/src/app/[lng]/accounts/accountCore.tsx b/project/web/src/app/[lng]/accounts/accountCore.tsx
index 840ad671..acfad7ff 100644
--- a/project/web/src/app/[lng]/accounts/accountCore.tsx
+++ b/project/web/src/app/[lng]/accounts/accountCore.tsx
@@ -157,15 +157,15 @@ export default function AccountPageCore({
const lang = userStore.lang
if (lang === 'zh-CN') {
return {
- title: '欢迎使用 AitoEarn',
- desc: '为了获得完整体验,请在设备上下载 App',
- cta: '下载 App',
+ title: t('mobileDownloadTip.welcomeTitle'),
+ desc: t('mobileDownloadTip.description'),
+ cta: t('mobileDownloadTip.downloadButton'),
}
}
return {
- title: 'Welcome to AitoEarn',
- desc: 'To enjoy the full experience, please download the app on your device',
- cta: 'Download App',
+ title: t('mobileDownloadTip.welcomeTitle'),
+ desc: t('mobileDownloadTip.description'),
+ cta: t('mobileDownloadTip.downloadButton'),
}
})()
@@ -173,15 +173,15 @@ export default function AccountPageCore({
const lang = userStore.lang
if (lang === 'zh-CN') {
return {
- title: '请在浏览器中打开',
- desc: '请点击右上角,通过浏览器打开',
- cta: '我知道了',
+ title: t('browserTip.title'),
+ desc: t('browserTip.description'),
+ cta: t('browserTip.button'),
}
}
return {
- title: 'Please open in browser',
- desc: 'Please click the top-right corner to open via browser',
- cta: 'I understand',
+ title: t('browserTip.title'),
+ desc: t('browserTip.description'),
+ cta: t('browserTip.button'),
}
})()
@@ -259,17 +259,17 @@ export default function AccountPageCore({
<div className={styles.wechatTipStep}>
<span className={styles.stepNumber}>1</span>
<span className={styles.stepText}>
- {userStore.lang === 'zh-CN' ? '点击右上角的' : 'Click the top-right corner\'s'}
+ {t('wechatBrowserTip.clickCorner')}
<span className={styles.dotsButton}>⋯</span>
- {userStore.lang === 'zh-CN' ? '按钮' : 'button'}
+ {t('wechatBrowserTip.dotsButton')}
</span>
</div>
<div className={styles.wechatTipStep}>
<span className={styles.stepNumber}>2</span>
<span className={styles.stepText}>
- {userStore.lang === 'zh-CN' ? '选择' : 'Select'}
+ {t('wechatBrowserTip.selectBrowser')}
<span className={styles.browserButton}>🌐</span>
- {userStore.lang === 'zh-CN' ? '在浏览器中打开' : 'Open in browser'}
+ {t('wechatBrowserTip.openInBrowser')}
</span>
</div>
</div>
diff --git a/project/web/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx b/project/web/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx
index 08a54d0f..adeb15c8 100644
--- a/project/web/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx
+++ b/project/web/src/app/[lng]/accounts/components/AccountSidebar/AccountSidebar.tsx
@@ -701,7 +701,7 @@ const AccountSidebar = memo(
}}
onClick={() => setMcpManagerModalOpen(true)}
>
- {t('mcpManager')}
+ {t('mcpManagerTit')}
</Button>
</div>
</div>
@@ -783,7 +783,7 @@ const AccountSidebar = memo(
<div className="accountSidebar-ipInfo">
<span className="accountSidebar-ipType" data-type="proxy">{t('ipType.proxy')}</span>
<Tooltip
- title={`IP: ${v.ip}\n位置: ${v.location}`}
+ title={t('sidebar.ipLocationTooltip', { ip: v.ip, location: v.location })}
>
<span className="accountSidebar-ipText">
{extractCountry(v.location)}
@@ -797,7 +797,7 @@ const AccountSidebar = memo(
)}
{/* 分组排序按钮 */}
<div className="accountSidebar-groupSort">
- <Tooltip title="上移">
+ <Tooltip title={t('sidebar.moveUp')}>
<Button
type="text"
size="small"
@@ -808,7 +808,7 @@ const AccountSidebar = memo(
}}
/>
</Tooltip>
- <Tooltip title="下移">
+ <Tooltip title={t('sidebar.moveDown')}>
<Button
type="text"
size="small"
@@ -898,7 +898,7 @@ const AccountSidebar = memo(
onClick={async () => {
// 如果是移动端平台,显示下载提示
if (isMobileOnlyPlatform) {
- setMobileOnlyPlatform(account.type === PlatType.Douyin ? '抖音' : '小红书')
+ setMobileOnlyPlatform(account.type === PlatType.Douyin ? t('platformNames.douyin') : t('platformNames.xiaohongshu'))
setShowAppDownloadModal(true)
return
}
@@ -908,7 +908,7 @@ const AccountSidebar = memo(
) {
// 小红书平台即使是掉线状态也显示下载App弹窗
if (account.type === PlatType.Xhs) {
- setMobileOnlyPlatform('小红书')
+ setMobileOnlyPlatform(t('platformNames.xiaohongshu'))
setShowAppDownloadModal(true)
return
}
diff --git a/project/web/src/app/[lng]/accounts/components/AccountSidebar/MCPManagerModal.tsx b/project/web/src/app/[lng]/accounts/components/AccountSidebar/MCPManagerModal.tsx
index c2337185..a44225d3 100644
--- a/project/web/src/app/[lng]/accounts/components/AccountSidebar/MCPManagerModal.tsx
+++ b/project/web/src/app/[lng]/accounts/components/AccountSidebar/MCPManagerModal.tsx
@@ -9,6 +9,7 @@ import {
apiDeleteMCPKey,
apiGetMCPKeyList,
} from '@/api/mcp'
+import { useTransClient } from '@/app/i18n/client'
import ChooseAccountModule from '@/components/ChooseAccountModule/ChooseAccountModule'
import MCPKeyDetailModal from './MCPKeyDetailModal'
import styles from './MCPManagerModal.module.scss'
@@ -26,6 +27,7 @@ export interface IMCPManagerModalProps {
const MCPManagerModal = memo(
forwardRef<IMCPManagerModalRef, IMCPManagerModalProps>(
({ open, onClose }, ref) => {
+ const { t } = useTransClient('account')
const [mcpKeys, setMcpKeys] = useState<any[]>([])
const [isCreateModalOpen, setIsCreateModalOpen] = useState(false)
const [selectedAccounts, setSelectedAccounts] = useState<SocialAccount[]>([])
@@ -50,7 +52,7 @@ const MCPManagerModal = memo(
}
}
catch (error) {
- message.error('获取MCP Key列表失败')
+ message.error(t('mcpManager.fetchKeysFailed'))
}
finally {
setLoading(false)
@@ -80,7 +82,7 @@ const MCPManagerModal = memo(
const createRes = await apiCreateMCPKey(createParams)
if (createRes?.code !== 0) {
- message.error('创建MCP Key失败')
+ message.error(t('mcpManager.createKeyFailed'))
return
}
@@ -95,7 +97,7 @@ const MCPManagerModal = memo(
})
}
catch (error) {
- console.error(`创建关联失败: ${account.account}`, error)
+ console.error(t('mcpManager.createAssociationFailed', { account: account.account }), error)
}
}
}
@@ -103,11 +105,11 @@ const MCPManagerModal = memo(
setSelectedAccounts([])
setIsCreateModalOpen(false)
setNewKeyName('')
- message.success('MCP Key创建成功!')
+ message.success(t('mcpManager.createSuccess'))
fetchMCPKeys() // 刷新列表
}
catch (error) {
- message.error('创建MCP Key失败')
+ message.error(t('mcpManager.createKeyFailed'))
}
finally {
setLoading(false)
@@ -116,22 +118,22 @@ const MCPManagerModal = memo(
const handleCopyKey = (key: string) => {
navigator.clipboard.writeText(key)
- message.success('Key已复制到剪贴板')
+ message.success(t('mcpManager.keyCopied'))
}
const handleDeleteKey = async (key: string) => {
try {
const res = await apiDeleteMCPKey(key)
if (res?.code === 0) {
- message.success('MCP Key已删除')
+ message.success(t('mcpManager.deleteSuccess'))
fetchMCPKeys() // 刷新列表
}
else {
- message.error('删除MCP Key失败')
+ message.error(t('mcpManager.deleteFailed'))
}
}
catch (error) {
- message.error('删除MCP Key失败')
+ message.error(t('mcpManager.deleteFailed'))
}
}
@@ -146,7 +148,7 @@ const MCPManagerModal = memo(
title={(
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<KeyOutlined style={{ color: '#625BF2' }} />
- MCP 管理器
+ {t('mcpManager.title')}
</div>
)}
open={open}
@@ -163,7 +165,7 @@ const MCPManagerModal = memo(
className={styles.createButton}
loading={loading}
>
- 创建新Key
+ {t('mcpManager.createNewKey')}
</Button>
</div>
@@ -173,8 +175,8 @@ const MCPManagerModal = memo(
<div className="emptyIcon">
<KeyOutlined />
</div>
- <div className="emptyText">暂无MCP Key</div>
- <div className="emptyDesc">点击上方按钮创建您的第一个MCP Key</div>
+ <div className="emptyText">{t('mcpManager.noKeys')}</div>
+ <div className="emptyDesc">{t('mcpManager.noKeysDesc')}</div>
</div>
)
: (
@@ -192,7 +194,7 @@ const MCPManagerModal = memo(
icon={<CopyOutlined />}
onClick={() => handleCopyKey(item.key)}
>
- 复制
+ {t('mcpManager.copy')}
</Button>,
<Button
key="detail"
@@ -203,7 +205,7 @@ const MCPManagerModal = memo(
setShowDetailModal(true)
}}
>
- 详情
+ {t('mcpManager.detail')}
</Button>,
<Button
key="delete"
@@ -213,7 +215,7 @@ const MCPManagerModal = memo(
onClick={() => handleDeleteKey(item.key)}
loading={loading}
>
- 删除
+ {t('mcpManager.delete')}
</Button>,
]}
>
@@ -223,7 +225,7 @@ const MCPManagerModal = memo(
<Space>
<span>{item.desc}</span>
<Tag color={item.status === 1 ? 'green' : 'red'}>
- {item.status === 1 ? '可用' : '不可用'}
+ {item.status === 1 ? t('mcpManager.available') : t('mcpManager.unavailable')}
</Tag>
</Space>
)}
@@ -234,19 +236,19 @@ const MCPManagerModal = memo(
</div>
<div className="keyInfo">
<div className="infoItem">
- <span className="label">创建时间: </span>
+ <span className="label">{t('mcpManager.createdAt')}</span>
<span>
{' '}
{dayjs(item.createdAt).format('YYYY-MM-DD HH:mm:ss')}
</span>
</div>
<div className="infoItem">
- <span className="label">关联账户: </span>
+ <span className="label">{t('mcpManager.associatedAccounts')}</span>
<span>
{' '}
{item.accountNum}
{' '}
- 个
+ {t('mcpManager.accountUnit')}
</span>
</div>
</div>
@@ -265,7 +267,7 @@ const MCPManagerModal = memo(
total={total}
showSizeChanger
showQuickJumper
- showTotal={(total, range) => `第 ${range[0]}-${range[1]} 条,共 ${total} 条`}
+ showTotal={(total, range) => t('mcpManager.pagination', { start: range[0], end: range[1], total })}
onChange={(page, size) => {
setCurrentPage(page)
setPageSize(size)
@@ -278,7 +280,7 @@ const MCPManagerModal = memo(
</Modal>
<Modal
- title="创建MCP Key"
+ title={t('mcpManager.createModal.title')}
open={isCreateModalOpen}
onCancel={() => {
setIsCreateModalOpen(false)
@@ -294,39 +296,36 @@ const MCPManagerModal = memo(
layout="vertical"
onFinish={(values) => {
if (selectedAccounts.length === 0) {
- message.warning('请选择至少一个账户')
+ message.warning(t('mcpManager.createModal.selectAccountsRequired'))
return
}
handleAccountConfirm(selectedAccounts)
}}
>
<Form.Item
- label="Key名称"
+ label={t('mcpManager.createModal.keyName')}
name="name"
- rules={[{ required: true, message: '请输入Key名称' }]}
+ rules={[{ required: true, message: t('mcpManager.createModal.keyNameRequired') }]}
>
<Input
- placeholder="请输入Key名称"
+ placeholder={t('mcpManager.createModal.keyNamePlaceholder')}
value={newKeyName}
onChange={e => setNewKeyName(e.target.value)}
/>
</Form.Item>
- <Form.Item label="选择账户">
+ <Form.Item label={t('mcpManager.createModal.selectAccounts')}>
<div style={{ minHeight: 100, border: '1px dashed #d9d9d9', padding: 16, borderRadius: 6 }}>
{selectedAccounts.length === 0
? (
<div style={{ textAlign: 'center', color: '#999' }}>
- 请选择要关联的账户
+ {t('mcpManager.createModal.selectAccountsPlaceholder')}
</div>
)
: (
<div>
<div style={{ marginBottom: 8, fontWeight: 500 }}>
- 已选择
- {selectedAccounts.length}
- {' '}
- 个账户:
+ {t('mcpManager.createModal.selectedCount', { count: selectedAccounts.length })}
</div>
{selectedAccounts.map(account => (
<Tag key={account.id} style={{ marginBottom: 4 }}>
@@ -342,7 +341,7 @@ const MCPManagerModal = memo(
}}
style={{ marginTop: 8 }}
>
- 选择账户
+ {t('mcpManager.createModal.selectAccountsButton')}
</Button>
</div>
</Form.Item>
@@ -354,7 +353,7 @@ const MCPManagerModal = memo(
htmlType="submit"
loading={loading}
>
- 创建
+ {t('mcpManager.createModal.create')}
</Button>
<Button
onClick={() => {
@@ -364,7 +363,7 @@ const MCPManagerModal = memo(
createForm.resetFields()
}}
>
- 取消
+ {t('mcpManager.createModal.cancel')}
</Button>
</Space>
</Form.Item>
diff --git a/project/web/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx b/project/web/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx
index 6b8884cb..7e41dcca 100644
--- a/project/web/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx
+++ b/project/web/src/app/[lng]/accounts/components/AccountSidebar/UserManageModal.tsx
@@ -146,7 +146,7 @@ function SpaceInfoCard({
padding: '2px 8px',
borderRadius: '12px'
}}>
- {currentSpace.children?.length || 0} 个账号
+ {currentSpace.children?.length || 0} {t('userManage.accounts')}
</span>
</div> */}
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/index.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/index.tsx
index a24e2580..d47ec612 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/index.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTiming/CalendarTimingItem/index.tsx
@@ -196,7 +196,7 @@ const CalendarTimingItem = memo(
? (
<>
<UpOutlined style={{ marginRight: '8px' }} />
- 隐藏更多
+ {t('calendar.hideMore')}
</>
)
: (
@@ -204,7 +204,7 @@ const CalendarTimingItem = memo(
<DownOutlined style={{ marginRight: '8px' }} />
{records.length - recordsLast?.length}
{' '}
- 更多
+ {t('calendar.showMore')}
</>
)}
</Button>
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/SentList.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/SentList.tsx
index 79891703..f69bb736 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/SentList.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTiming/ListMode/SentList.tsx
@@ -121,9 +121,9 @@ const SentList: React.FC<SentListProps> = ({ platform, uid, onDataChange, accoun
const getMediaTypeTag = (mediaType: string) => {
const typeMap = {
- video: { color: 'red', text: '视频' },
- image: { color: 'blue', text: '图片' },
- article: { color: 'green', text: '文章' },
+ video: { color: 'red', text: t('mediaTypes.video') },
+ image: { color: 'blue', text: t('mediaTypes.image') },
+ article: { color: 'green', text: t('mediaTypes.article') },
}
return typeMap[mediaType as keyof typeof typeMap] || { color: 'default', text: mediaType }
}
@@ -161,7 +161,7 @@ const SentList: React.FC<SentListProps> = ({ platform, uid, onDataChange, accoun
</Avatar>
<div className={styles.userDetails}>
<div className={styles.username}>
- {account?.nickname || account?.account || post.title || '未知账户'}
+ {account?.nickname || account?.account || post.title || t('unknownAccount')}
</div>
<div className={styles.userSubtitle} style={{ display: 'flex', alignItems: 'center', gap: '6px' }}>
{platInfo && (
diff --git a/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx b/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
index c156dca0..d87540e7 100644
--- a/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
+++ b/project/web/src/app/[lng]/accounts/components/CalendarTiming/index.tsx
@@ -219,11 +219,11 @@ const CalendarTiming = memo(
}}
>
{accountList.length === 0
- ? '暂无账户'
+ ? t('sidebar.noAccounts')
: accountList.filter(
account => account.status === AccountStatus.USABLE,
).length === 0
- ? '暂无在线账户'
+ ? t('sidebar.noOnlineAccounts')
: t('listMode.noChannelsFound' as any)}
</div>
)}
diff --git a/project/web/src/app/[lng]/accounts/components/ProxyInput/index.tsx b/project/web/src/app/[lng]/accounts/components/ProxyInput/index.tsx
index 1e47d482..7aaeacec 100644
--- a/project/web/src/app/[lng]/accounts/components/ProxyInput/index.tsx
+++ b/project/web/src/app/[lng]/accounts/components/ProxyInput/index.tsx
@@ -1,6 +1,7 @@
import type { ForwardedRef } from 'react'
import { Button, Input, message } from 'antd'
import { forwardRef, memo, useEffect, useState } from 'react'
+import { useTransClient } from '@/app/i18n/client'
import styles from './proxyInput.module.scss'
export interface IProxyInputRef {}
@@ -56,6 +57,7 @@ export async function verifyProxy(proxyName: string) {
const ProxyInput = memo(
forwardRef(
({ onChange }: IProxyInputProps, ref: ForwardedRef<IProxyInputRef>) => {
+ const { t } = useTransClient('account')
const [proxyLoading, setProxyLoading] = useState(false)
const [proxyName, setProxyName] = useState('')
@@ -69,10 +71,10 @@ const ProxyInput = memo(
className={`${styles.createGroup} ${styles.proxyInput}`}
style={{ marginBottom: '20px' }}
>
- <label>代理地址</label>
+ <label>{t('proxy.label')}</label>
<Input
value={proxyName}
- placeholder="请输入代理地址"
+ placeholder={t('proxy.placeholder')}
onChange={e => setProxyName(e.target.value)}
/>
<Button
@@ -81,30 +83,30 @@ const ProxyInput = memo(
onClick={async () => {
const verifyRes = await verifyProxy(proxyName)
if (verifyRes) {
- message.success('代理地址可用')
+ message.success(t('proxy.available'))
}
else {
- message.error('代理地址不可用')
+ message.error(t('proxy.unavailable'))
}
}}
>
- 验证连接
+ {t('proxy.verify')}
</Button>
</div>
<div className={styles.proxyHint}>
- <p>1. 代理类型仅支持HTTP、HTTPS、Socks5;</p>
- <p>支持以下填写格式</p>
+ <p>{t('proxy.hint.line1')}</p>
+ <p>{t('proxy.hint.line2')}</p>
<p>
192.168.0.1:8000
- {`{备注}`}
+ {`{${t('proxy.hint.remark')}}`}
</p>
<p>
- 192.168.0.1:8000:代理账号:代理密码
- {`{备注}`}
+ 192.168.0.1:8000:{t('proxy.hint.username')}:{t('proxy.hint.password')}
+ {`{${t('proxy.hint.remark')}}`}
</p>
<p>
- socks5://192.168.0.1:8000:代理账号:代理密码
- {`{备注}`}
+ socks5://192.168.0.1:8000:{t('proxy.hint.username')}:{t('proxy.hint.password')}
+ {`{${t('proxy.hint.remark')}}`}
</p>
</div>
</>
diff --git a/project/web/src/app/[lng]/aiRank/aiRanking/page.tsx b/project/web/src/app/[lng]/aiRank/aiRanking/page.tsx
index ecae81c1..6c647f0a 100644
--- a/project/web/src/app/[lng]/aiRank/aiRanking/page.tsx
+++ b/project/web/src/app/[lng]/aiRank/aiRanking/page.tsx
@@ -14,26 +14,12 @@ import {
import { Avatar, Popover, Table, Tag, Tooltip } from 'antd'
import { useEffect, useMemo, useRef, useState } from 'react'
import { platformApi } from '@/api/hot'
+import { useTransClient } from '@/app/i18n/client'
import Cycleselects, { CycleTypeEnum } from '../components/CycleSelects'
import RankingTags from '../components/RankingTags'
import styles from './aiRanking.module.scss'
import initWeepPie from './echarts-weekPie'
-const optionsTags = [
- {
- label: '总榜',
- value: '1',
- },
- {
- label: '国内榜',
- value: '2',
- },
- {
- label: '国外榜',
- value: '3',
- },
-]
-
function parseChineseNumber(input: string): number {
if (!input)
return 0
@@ -88,6 +74,7 @@ function parseChineseNumber(input: string): number {
}
export default function Page() {
+ const { t } = useTransClient('aiRank')
const [params, setParams] = useState<GetAiToolsRankingApiParams>({
dateType: '',
startDate: '',
@@ -97,6 +84,21 @@ export default function Page() {
const [data, setData] = useState<AiToolsRankingItemType[]>([])
const aiRankingContentRef = useRef<HTMLDivElement>(null)
+ const optionsTags = [
+ {
+ label: t('ranking.allRanking'),
+ value: '1',
+ },
+ {
+ label: t('ranking.domesticRanking'),
+ value: '2',
+ },
+ {
+ label: t('ranking.foreignRanking'),
+ value: '3',
+ },
+ ]
+
useEffect(() => {
if (params.dateType === '' || params.startDate === '')
return
@@ -143,10 +145,10 @@ export default function Page() {
)
},
width: '40px',
- key: '序号',
+ key: 'rank',
},
{
- title: '产品名',
+ title: t('table.productName'),
render: (text, prm) => {
return (
<div className="aiRanking-productName">
@@ -169,7 +171,7 @@ export default function Page() {
key: 'title',
},
{
- title: '标签',
+ title: t('table.tags'),
render: (text, prm) => {
return (
<div className="aiRanking-productName">
@@ -183,7 +185,7 @@ export default function Page() {
key: 'title',
},
{
- title: '月访问量',
+ title: t('table.monthlyVisits'),
render: (text, prm) => {
return prm.stats.viewCount
},
@@ -194,23 +196,23 @@ export default function Page() {
key: 'title',
},
{
- title: '月下载量',
+ title: t('table.monthlyDownloads'),
render: (text, prm) => {
return prm.downCount
},
sorter: (a, b) =>
parseChineseNumber(b.downCount) - parseChineseNumber(a.downCount),
width: 80,
- key: '月下载量',
+ key: 'monthlyDownloads',
},
{
title: () => {
return (
<>
- <Tooltip title="统计AI工具排行榜的周提及作品数">
+ <Tooltip title={t('table.weeklyMentionsTooltip')}>
<QuestionCircleOutlined />
</Tooltip>
- 周提及量
+ {t('table.weeklyMentions')}
</>
)
},
@@ -256,10 +258,10 @@ export default function Page() {
title: () => {
return (
<>
- <Tooltip title="统计AI工具排行榜的提及作品、传播范围等多维度数据分析做出的综合评分">
+ <Tooltip title={t('table.reputationTooltip')}>
<QuestionCircleOutlined />
</Tooltip>
- 声望值
+ {t('table.reputation')}
</>
)
},
@@ -274,10 +276,10 @@ export default function Page() {
title: () => {
return (
<>
- <Tooltip title="统计AI工具排行榜的用户使用情况等多维度数据分析做出的综合评分">
+ <Tooltip title={t('table.overallScoreTooltip')}>
<QuestionCircleOutlined />
</Tooltip>
- 综合评分
+ {t('table.overallScore')}
</>
)
},
@@ -294,21 +296,21 @@ export default function Page() {
},
]
return columns
- }, [])
+ }, [t])
return (
<div className={styles.aiRanking}>
<div className="aiRanking-title">
- AI工具排行榜 ·
+ {t('ranking.title')} ·
{' '}
{optionsTags.find(v => v.value === params.area)?.label}
{' '}
·
- {params.dateType === CycleTypeEnum.Week ? '周榜' : '月榜'}
+ {params.dateType === CycleTypeEnum.Week ? t('ranking.weekRanking') : t('ranking.monthRanking')}
</div>
<div className="aiRanking-head">
<div className="aiRanking-head-item">
- <div className="aiRanking-head-title">类型</div>
+ <div className="aiRanking-head-title">{t('ranking.type')}</div>
<RankingTags
options={optionsTags}
defaultValue={optionsTags[0].value}
@@ -322,7 +324,7 @@ export default function Page() {
/>
</div>
<div className="aiRanking-head-item">
- <div className="aiRanking-head-title">周期</div>
+ <div className="aiRanking-head-title">{t('ranking.cycle')}</div>
<div className="aiRanking-head-cycleselects">
<Cycleselects
defaultType={CycleTypeEnum.Week}
diff --git a/project/web/src/app/[lng]/aiRank/components/CycleSelects/index.tsx b/project/web/src/app/[lng]/aiRank/components/CycleSelects/index.tsx
index a0e07fe1..756fe5f4 100644
--- a/project/web/src/app/[lng]/aiRank/components/CycleSelects/index.tsx
+++ b/project/web/src/app/[lng]/aiRank/components/CycleSelects/index.tsx
@@ -3,6 +3,7 @@ import { Button, Select } from 'antd'
import dayjs from 'dayjs'
import isoWeek from 'dayjs/plugin/isoWeek'
import { forwardRef, memo, useEffect, useState } from 'react'
+import { useTransClient } from '@/app/i18n/client'
import styles from './cycleSelects.module.scss'
dayjs.extend(isoWeek)
@@ -126,6 +127,7 @@ const Cycleselects = memo(
{ onChange, defaultType, disable }: ICycleselectsProps,
ref: ForwardedRef<ICycleselectsRef>,
) => {
+ const { t } = useTransClient('aiRank')
// 1周榜 2=月榜
const [active, setActive] = useState<CycleTypeEnum>(defaultType)
const [value, setValue] = useState('')
@@ -176,7 +178,7 @@ const Cycleselects = memo(
setActive(CycleTypeEnum.Week)
}}
onChange={setValue}
- title="周榜"
+ title={t('cycleSelect.weekRanking')}
options={weekOptions}
/>
@@ -189,7 +191,7 @@ const Cycleselects = memo(
setActive(CycleTypeEnum.Month)
}}
onChange={setValue}
- title="月榜"
+ title={t('cycleSelect.monthRanking')}
options={monthsOptions}
/>
</div>
diff --git a/project/web/src/app/[lng]/aiRank/layout.tsx b/project/web/src/app/[lng]/aiRank/layout.tsx
index 2cef5094..6219374b 100644
--- a/project/web/src/app/[lng]/aiRank/layout.tsx
+++ b/project/web/src/app/[lng]/aiRank/layout.tsx
@@ -4,34 +4,32 @@ import Icon from '@ant-design/icons'
import { Menu } from 'antd'
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
import { useEffect, useState } from 'react'
+import { useTransClient } from '@/app/i18n/client'
import { removeLocalePrefix } from '@/app/layout/layout.utils'
import styles from './aiRank.module.scss'
import Ranking from './svgs/ranking.svg'
type MenuItem = Required<MenuProps>['items'][number]
-const items: MenuItem[] = [
- {
- key: '/aiRank/aiRanking',
- label: 'AI工具排行榜',
- icon: <Icon component={Ranking} />,
- },
-].map((v) => {
- // @ts-ignore
- v.label = <span title={v.label}>{v.label}</span>
- return v
-})
-
export default function AiRankLayout({
children,
}: {
children: React.ReactNode
}) {
+ const { t } = useTransClient('aiRank')
const router = useRouter()
const pathname = usePathname()
const searchParams = useSearchParams()
const [currChooseRoute, setCurrChooseRoute] = useState<string>()
+ const items: MenuItem[] = [
+ {
+ key: '/aiRank/aiRanking',
+ label: <span title={t('menu.aiToolRanking')}>{t('menu.aiToolRanking')}</span>,
+ icon: <Icon component={Ranking} />,
+ },
+ ]
+
useEffect(() => {
setCurrChooseRoute(removeLocalePrefix(pathname))
}, [pathname, searchParams])
diff --git a/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx b/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx
index 71ea5dbc..12755a28 100644
--- a/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx
+++ b/project/web/src/app/[lng]/cgmaterial/cgmaterialPageCore.tsx
@@ -22,10 +22,7 @@ import {
apiUpdateMaterialGroupInfo,
} from '@/api/material'
import { getMediaGroupList, getMediaList } from '@/api/media'
-import { PublishStatus } from '@/api/plat/types/publish.types'
import { apiGetPostsRecordStatus, apiImportPostsRecord } from '@/api/statistics'
-import { EngagementPostsResponse } from '@/api/types/engagement'
-import { PlatType } from '@/app/config/platConfig'
import { PubType } from '@/app/config/publishConfig'
import { useTransClient } from '@/app/i18n/client'
import AvatarPlat from '@/components/AvatarPlat'
diff --git a/project/web/src/app/i18n/locales/en/account.json b/project/web/src/app/i18n/locales/en/account.json
index 67bc0bab..3d94fb42 100644
--- a/project/web/src/app/i18n/locales/en/account.json
+++ b/project/web/src/app/i18n/locales/en/account.json
@@ -10,7 +10,7 @@
"allPlatforms": "All Platforms",
"accountManager": "Acct Manager",
"addAccount": "Add Channels",
- "mcpManager": "MCP Manager",
+ "mcpManagerTit": "MCP Manager",
"online": "Online",
"offline": "Offline",
"checkLoginStatus": "Check Login Status",
@@ -152,5 +152,90 @@
"selected": "Selected",
"accounts": "accounts",
"deleteAccount": "Delete Accounts"
+ },
+ "wechatBrowserTip": {
+ "clickCorner": "Click the top-right corner's",
+ "dotsButton": "button",
+ "selectBrowser": "Select",
+ "openInBrowser": "Open in browser"
+ },
+ "mobileDownloadTip": {
+ "welcomeTitle": "Welcome to AitoEarn",
+ "description": "For a complete experience, please download the App on your device",
+ "downloadButton": "Download App"
+ },
+ "browserTip": {
+ "title": "Please open in browser",
+ "description": "Please click the top right corner to open with browser",
+ "button": "Got it"
+ },
+ "platformNames": {
+ "douyin": "Douyin",
+ "xiaohongshu": "Xiaohongshu"
+ },
+ "sidebar": {
+ "noAccounts": "No accounts",
+ "noOnlineAccounts": "No online accounts",
+ "ipLocationTooltip": "IP: {{ip}}\nLocation: {{location}}",
+ "moveUp": "Move up",
+ "moveDown": "Move down"
+ },
+ "mcpManager": {
+ "title": "MCP Manager",
+ "fetchKeysFailed": "Failed to fetch MCP keys",
+ "createKeyFailed": "Failed to create MCP key",
+ "createAssociationFailed": "Failed to create association: {{account}}",
+ "createSuccess": "MCP Key created successfully!",
+ "keyCopied": "Key copied to clipboard",
+ "deleteSuccess": "MCP Key deleted",
+ "deleteFailed": "Failed to delete MCP Key",
+ "createNewKey": "Create New Key",
+ "noKeys": "No MCP Keys",
+ "noKeysDesc": "Click the button above to create your first MCP Key",
+ "copy": "Copy",
+ "detail": "Detail",
+ "delete": "Delete",
+ "available": "Available",
+ "unavailable": "Unavailable",
+ "createdAt": "Created at: ",
+ "associatedAccounts": "Associated accounts: ",
+ "accountUnit": "",
+ "pagination": "{{start}}-{{end}} of {{total}} items",
+ "createModal": {
+ "title": "Create MCP Key",
+ "keyName": "Key Name",
+ "keyNamePlaceholder": "Enter key name",
+ "keyNameRequired": "Please enter key name",
+ "selectAccounts": "Select Accounts",
+ "selectAccountsPlaceholder": "Please select accounts to associate",
+ "selectAccountsRequired": "Please select at least one account",
+ "selectedCount": "{{count}} account(s) selected:",
+ "selectAccountsButton": "Select Accounts",
+ "create": "Create",
+ "cancel": "Cancel"
+ }
+ },
+ "mediaTypes": {
+ "video": "Video",
+ "image": "Image",
+ "article": "Article"
+ },
+ "calendar": {
+ "showMore": "Show more",
+ "hideMore": "Hide more"
+ },
+ "proxy": {
+ "label": "Proxy Address",
+ "placeholder": "Enter proxy address",
+ "available": "Proxy address is available",
+ "unavailable": "Proxy address is unavailable",
+ "verify": "Verify Connection",
+ "hint": {
+ "line1": "1. Proxy types supported: HTTP, HTTPS, Socks5;",
+ "line2": "Supported formats:",
+ "remark": "remark",
+ "username": "username",
+ "password": "password"
+ }
}
}
diff --git a/project/web/src/app/i18n/locales/en/aiRank.json b/project/web/src/app/i18n/locales/en/aiRank.json
new file mode 100644
index 00000000..26d35111
--- /dev/null
+++ b/project/web/src/app/i18n/locales/en/aiRank.json
@@ -0,0 +1,33 @@
+{
+ "menu": {
+ "aiToolRanking": "AI Tools Ranking"
+ },
+ "ranking": {
+ "title": "AI Tools Ranking",
+ "allRanking": "All",
+ "domesticRanking": "Domestic",
+ "foreignRanking": "Foreign",
+ "weekRanking": "Weekly",
+ "monthRanking": "Monthly",
+ "type": "Type",
+ "cycle": "Cycle"
+ },
+ "table": {
+ "rank": "#",
+ "productName": "Product Name",
+ "tags": "Tags",
+ "monthlyVisits": "Monthly Visits",
+ "monthlyDownloads": "Monthly Downloads",
+ "weeklyMentions": "Weekly Mentions",
+ "weeklyMentionsTooltip": "Statistics of weekly mentioned works in AI tool rankings",
+ "reputation": "Reputation",
+ "reputationTooltip": "Comprehensive score based on multi-dimensional data analysis of mentioned works, dissemination scope, etc.",
+ "overallScore": "Overall Score",
+ "overallScoreTooltip": "Comprehensive score based on multi-dimensional data analysis of user usage, etc."
+ },
+ "cycleSelect": {
+ "weekRanking": "Weekly",
+ "monthRanking": "Monthly"
+ }
+}
+
diff --git a/project/web/src/app/i18n/locales/zh-CN/account.json b/project/web/src/app/i18n/locales/zh-CN/account.json
index 51ec3ae9..b3c9cb02 100644
--- a/project/web/src/app/i18n/locales/zh-CN/account.json
+++ b/project/web/src/app/i18n/locales/zh-CN/account.json
@@ -10,7 +10,7 @@
"allPlatforms": "所有平台",
"accountManager": "账号管理器",
"addAccount": "添加频道",
- "mcpManager": "MCP 管理器",
+ "mcpManagerTit": "MCP 管理器",
"online": "在线",
"offline": "离线",
"checkLoginStatus": "登录状态检测",
@@ -152,5 +152,90 @@
"selected": "已选择",
"accounts": "个账号",
"deleteAccount": "删除账号"
+ },
+ "wechatBrowserTip": {
+ "clickCorner": "点击右上角的",
+ "dotsButton": "按钮",
+ "selectBrowser": "选择",
+ "openInBrowser": "在浏览器中打开"
+ },
+ "mobileDownloadTip": {
+ "welcomeTitle": "欢迎使用 AitoEarn",
+ "description": "为了获得完整体验,请在设备上下载 App",
+ "downloadButton": "下载 App"
+ },
+ "browserTip": {
+ "title": "请在浏览器中打开",
+ "description": "请点击右上角,通过浏览器打开",
+ "button": "我知道了"
+ },
+ "platformNames": {
+ "douyin": "抖音",
+ "xiaohongshu": "小红书"
+ },
+ "sidebar": {
+ "noAccounts": "暂无账户",
+ "noOnlineAccounts": "暂无在线账户",
+ "ipLocationTooltip": "IP: {{ip}}\n位置: {{location}}",
+ "moveUp": "上移",
+ "moveDown": "下移"
+ },
+ "mcpManager": {
+ "title": "MCP 管理器",
+ "fetchKeysFailed": "获取MCP Key列表失败",
+ "createKeyFailed": "创建MCP Key失败",
+ "createAssociationFailed": "创建关联失败: {{account}}",
+ "createSuccess": "MCP Key创建成功!",
+ "keyCopied": "Key已复制到剪贴板",
+ "deleteSuccess": "MCP Key已删除",
+ "deleteFailed": "删除MCP Key失败",
+ "createNewKey": "创建新Key",
+ "noKeys": "暂无MCP Key",
+ "noKeysDesc": "点击上方按钮创建您的第一个MCP Key",
+ "copy": "复制",
+ "detail": "详情",
+ "delete": "删除",
+ "available": "可用",
+ "unavailable": "不可用",
+ "createdAt": "创建时间: ",
+ "associatedAccounts": "关联账户: ",
+ "accountUnit": "个",
+ "pagination": "第 {{start}}-{{end}} 条,共 {{total}} 条",
+ "createModal": {
+ "title": "创建MCP Key",
+ "keyName": "Key名称",
+ "keyNamePlaceholder": "请输入Key名称",
+ "keyNameRequired": "请输入Key名称",
+ "selectAccounts": "选择账户",
+ "selectAccountsPlaceholder": "请选择要关联的账户",
+ "selectAccountsRequired": "请选择至少一个账户",
+ "selectedCount": "已选择 {{count}} 个账户:",
+ "selectAccountsButton": "选择账户",
+ "create": "创建",
+ "cancel": "取消"
+ }
+ },
+ "mediaTypes": {
+ "video": "视频",
+ "image": "图片",
+ "article": "文章"
+ },
+ "calendar": {
+ "showMore": "显示更多",
+ "hideMore": "隐藏更多"
+ },
+ "proxy": {
+ "label": "代理地址",
+ "placeholder": "请输入代理地址",
+ "available": "代理地址可用",
+ "unavailable": "代理地址不可用",
+ "verify": "验证连接",
+ "hint": {
+ "line1": "1. 代理类型仅支持HTTP、HTTPS、Socks5;",
+ "line2": "支持以下填写格式",
+ "remark": "备注",
+ "username": "代理账号",
+ "password": "代理密码"
+ }
}
}
diff --git a/project/web/src/app/i18n/locales/zh-CN/aiRank.json b/project/web/src/app/i18n/locales/zh-CN/aiRank.json
new file mode 100644
index 00000000..6ba3e1f9
--- /dev/null
+++ b/project/web/src/app/i18n/locales/zh-CN/aiRank.json
@@ -0,0 +1,33 @@
+{
+ "menu": {
+ "aiToolRanking": "AI工具排行榜"
+ },
+ "ranking": {
+ "title": "AI工具排行榜",
+ "allRanking": "总榜",
+ "domesticRanking": "国内榜",
+ "foreignRanking": "国外榜",
+ "weekRanking": "周榜",
+ "monthRanking": "月榜",
+ "type": "类型",
+ "cycle": "周期"
+ },
+ "table": {
+ "rank": "#",
+ "productName": "产品名",
+ "tags": "标签",
+ "monthlyVisits": "月访问量",
+ "monthlyDownloads": "月下载量",
+ "weeklyMentions": "周提及量",
+ "weeklyMentionsTooltip": "统计AI工具排行榜的周提及作品数",
+ "reputation": "声望值",
+ "reputationTooltip": "统计AI工具排行榜的提及作品、传播范围等多维度数据分析做出的综合评分",
+ "overallScore": "综合评分",
+ "overallScoreTooltip": "统计AI工具排行榜的用户使用情况等多维度数据分析做出的综合评分"
+ },
+ "cycleSelect": {
+ "weekRanking": "周榜",
+ "monthRanking": "月榜"
+ }
+}
+