diff --git a/web/src/components/table/redemptions/RedemptionsColumnDefs.jsx b/web/src/components/table/redemptions/RedemptionsColumnDefs.jsx
index 6dcb32fb..4a0121d7 100644
--- a/web/src/components/table/redemptions/RedemptionsColumnDefs.jsx
+++ b/web/src/components/table/redemptions/RedemptionsColumnDefs.jsx
@@ -45,7 +45,7 @@ const renderStatus = (status, record, t) => {
if (isExpired(record)) {
return (
- {t('Expired')}
+ {t('已过期')}
);
}
@@ -61,7 +61,7 @@ const renderStatus = (status, record, t) => {
return (
- {t('Unknown')}
+ {t('未知状态')}
);
};
@@ -88,7 +88,7 @@ const renderRedeemTarget = (record, t) => {
const label = record.plan_title || `ID ${record.plan_id || '-'}`;
return (
- {`${t('Plan')}: ${label}`}
+ {`${t('订阅套餐')}: ${label}`}
);
}
@@ -113,16 +113,16 @@ export const getRedemptionsColumns = ({
dataIndex: 'id',
},
{
- title: t('Name'),
+ title: t('名称'),
dataIndex: 'name',
},
{
- title: t('Type'),
+ title: t('类型'),
dataIndex: 'redeem_type',
render: (text) =>
{renderRedeemType(text, t)}
,
},
{
- title: t('Status'),
+ title: t('状态'),
dataIndex: 'status',
key: 'status',
render: (text, record) => {
@@ -130,31 +130,31 @@ export const getRedemptionsColumns = ({
},
},
{
- title: t('Redeem target'),
+ title: t('兑换内容'),
dataIndex: 'quota',
render: (_, record) => {
return {renderRedeemTarget(record, t)}
;
},
},
{
- title: t('Created at'),
+ title: t('创建时间'),
dataIndex: 'created_time',
render: (text) => {
return {renderTimestamp(text)}
;
},
},
{
- title: t('Expires at'),
+ title: t('过期时间'),
dataIndex: 'expired_time',
render: (text) => {
- return {text === 0 ? t('Never') : renderTimestamp(text)}
;
+ return {text === 0 ? t('永不过期') : renderTimestamp(text)}
;
},
},
{
- title: t('Redeemed by'),
+ title: t('兑换用户ID'),
dataIndex: 'used_user_id',
render: (text) => {
- return {text === 0 ? t('N/A') : text}
;
+ return {text === 0 ? t('无') : text}
;
},
},
{
@@ -166,7 +166,7 @@ export const getRedemptionsColumns = ({
const moreMenuItems = [
{
node: 'item',
- name: t('Delete'),
+ name: t('删除'),
type: 'danger',
onClick: () => {
showDeleteRedemptionModal(record);
@@ -177,7 +177,7 @@ export const getRedemptionsColumns = ({
if (record.status === REDEMPTION_STATUS.UNUSED && !isExpired(record)) {
moreMenuItems.push({
node: 'item',
- name: t('Disable'),
+ name: t('禁用'),
type: 'warning',
onClick: () => {
manageRedemption(record.id, REDEMPTION_ACTIONS.DISABLE, record);
@@ -186,7 +186,7 @@ export const getRedemptionsColumns = ({
} else if (!isExpired(record)) {
moreMenuItems.push({
node: 'item',
- name: t('Enable'),
+ name: t('启用'),
type: 'secondary',
onClick: () => {
manageRedemption(record.id, REDEMPTION_ACTIONS.ENABLE, record);
@@ -203,7 +203,7 @@ export const getRedemptionsColumns = ({
position='top'
>
{
.filter(Boolean);
setSubscriptionPlans(plans);
} else {
- showError(res.data?.message || t('Failed to load subscription plans'));
+ showError(res.data?.message || t('获取订阅套餐失败'));
}
} catch (error) {
showError(error.message);
@@ -143,7 +143,7 @@ const EditRedemptionModal = (props) => {
const selectedPlan = subscriptionPlans.find(
(plan) => plan.id === Number(values.plan_id),
);
- name = selectedPlan?.title || t('Subscription redemption');
+ name = selectedPlan?.title || t('订阅套餐兑换码');
} else {
name = renderQuota(values.quota);
}
@@ -180,11 +180,11 @@ const EditRedemptionModal = (props) => {
const { success, message, data } = res.data;
if (success) {
if (isEdit) {
- showSuccess(t('Redemption updated'));
+ showSuccess(t('兑换码更新成功!'));
props.refresh();
props.handleClose();
} else {
- showSuccess(t('Redemption created'));
+ showSuccess(t('兑换码创建成功!'));
props.refresh();
formApiRef.current?.setValues(getInitValues());
props.handleClose();
@@ -198,11 +198,11 @@ const EditRedemptionModal = (props) => {
text += data[i] + '\n';
}
Modal.confirm({
- title: t('Redemption created'),
+ title: t('兑换码创建成功'),
content: (
-
{t('Download the generated redemption codes?')}
-
{t('Codes will be downloaded as a text file named after this redemption.')}
+
{t('兑换码创建成功,是否下载兑换码?')}
+
{t('兑换码将以文本文件的形式下载,文件名为兑换码的名称。')}
),
onOk: () => {
@@ -221,15 +221,15 @@ const EditRedemptionModal = (props) => {
{isEdit ? (
- {t('Edit')}
+ {t('更新')}
) : (
- {t('New')}
+ {t('新建')}
)}
- {isEdit ? t('Update redemption') : t('Create redemption')}
+ {isEdit ? t('更新兑换码信息') : t('创建新的兑换码')}
}
@@ -245,7 +245,7 @@ const EditRedemptionModal = (props) => {
icon={}
loading={loading}
>
- {t('Submit')}
+ {t('提交')}
@@ -283,10 +283,10 @@ const EditRedemptionModal = (props) => {
- {t('Basic info')}
+ {t('基本信息')}
- {t('Set the redemption name, type, and expiration')}
+ {t('设置兑换码的基本信息和兑换目标')}
@@ -295,13 +295,13 @@ const EditRedemptionModal = (props) => {
@@ -309,27 +309,27 @@ const EditRedemptionModal = (props) => {
- {t('Quota')}
+ {t('额度')}
- {t('Subscription')}
+ {t('订阅套餐')}
@@ -338,14 +338,14 @@ const EditRedemptionModal = (props) => {
@@ -371,12 +371,12 @@ const EditRedemptionModal = (props) => {
- {t('Redeem settings')}
+ {t('兑换设置')}
{redeemType === REDEMPTION_REDEEM_TYPE.SUBSCRIPTION
- ? t('Choose a plan and generation count')
- : t('Set quota amount and generation count')}
+ ? t('设置订阅套餐和生成数量')
+ : t('设置兑换码的额度和数量')}
@@ -386,18 +386,18 @@ const EditRedemptionModal = (props) => {
{
const num = parseInt(v, 10);
return num > 0
? Promise.resolve()
- : Promise.reject(t('Quota must be greater than 0'));
+ : Promise.reject(t('额度必须大于0'));
},
},
]}
@@ -426,16 +426,16 @@ const EditRedemptionModal = (props) => {
>
{
const num = parseInt(v, 10);
return num > 0
? Promise.resolve()
- : Promise.reject(t('Count must be greater than 0'));
+ : Promise.reject(t('生成数量必须大于0'));
},
},
]}
diff --git a/web/src/components/topup/index.jsx b/web/src/components/topup/index.jsx
index ed9bc79b..62cab79e 100644
--- a/web/src/components/topup/index.jsx
+++ b/web/src/components/topup/index.jsx
@@ -195,7 +195,7 @@ const TopUp = () => {
const topUp = async () => {
if (redemptionCode === '') {
- showInfo(t('Please enter a redemption code'));
+ showInfo(t('请输入兑换码!'));
return;
}
setIsSubmitting(true);
@@ -205,18 +205,18 @@ const TopUp = () => {
});
const { success, message, data } = res.data;
if (success) {
- showSuccess(t('Redemption successful'));
+ showSuccess(t('兑换成功!'));
if (data?.redeem_type === 'subscription') {
Modal.success({
- title: t('Redemption successful'),
- content: `${t('Subscription plan redeemed: ')}${data.plan_title || data.plan_id}`,
+ title: t('兑换成功!'),
+ content: `${t('成功兑换订阅套餐:')}${data.plan_title || data.plan_id}`,
centered: true,
});
await getSubscriptionSelf();
} else {
Modal.success({
- title: t('Redemption successful'),
- content: `${t('Quota redeemed: ')}${renderQuota(data?.quota || 0)}`,
+ title: t('兑换成功!'),
+ content: `${t('成功兑换额度:')}${renderQuota(data?.quota || 0)}`,
centered: true,
});
if (userState.user) {
@@ -232,7 +232,7 @@ const TopUp = () => {
showError(message);
}
} catch (err) {
- showError(t('Request failed'));
+ showError(t('请求失败'));
} finally {
setIsSubmitting(false);
}