♻️ refactor: Add localization updates for log and server files across multiple languages

- Added new keys for "server", "subscribe", "detail", "pending", "sending", "sent", and "unknown" in log.json files for various languages.
- Introduced a "type" object with transaction types (Recharge, Withdraw, Purchase, Refund, Reward, Commission) in log.json files for multiple languages.
- Updated "traffic_ratio" to "Ratio" and added "transport" in servers.json for English localization.
- Ensured consistency and accuracy in translations for all affected languages including German, English, Spanish, French, Russian, Chinese, and more.
This commit is contained in:
web
2025-09-05 04:48:10 -07:00
parent 351fffcc78
commit 2bcd4cf30c
41 changed files with 849 additions and 150 deletions
@@ -1,6 +1,8 @@
'use client';
import { UserDetail } from '@/app/dashboard/user/user-detail';
import { Display } from '@/components/display';
import { OrderLink } from '@/components/order-link';
import { ProTable } from '@/components/pro-table';
import { filterCommissionLog } from '@/services/admin/log';
import { formatDate } from '@/utils/common';
@@ -10,9 +12,19 @@ import { useSearchParams } from 'next/navigation';
export default function CommissionLogPage() {
const t = useTranslations('log');
const sp = useSearchParams();
const today = new Date().toISOString().split('T')[0];
const getCommissionTypeText = (type: number) => {
const typeText = t(`type.${type}`);
if (typeText === `log.type.${type}`) {
return `${t('unknown')} (${type})`;
}
return typeText;
};
const initialFilters = {
search: sp.get('search') || undefined,
date: sp.get('date') || undefined,
date: sp.get('date') || today,
user_id: sp.get('user_id') ? Number(sp.get('user_id')) : undefined,
};
return (
@@ -25,9 +37,21 @@ export default function CommissionLogPage() {
header: t('column.user'),
cell: ({ row }) => <UserDetail id={Number(row.original.user_id)} />,
},
{ accessorKey: 'amount', header: t('column.amount') },
{ accessorKey: 'order_no', header: t('column.orderNo') },
{ accessorKey: 'type', header: t('column.type') },
{
accessorKey: 'amount',
header: t('column.amount'),
cell: ({ row }) => <Display type='currency' value={row.original.amount} />,
},
{
accessorKey: 'order_no',
header: t('column.orderNo'),
cell: ({ row }) => <OrderLink orderId={row.original.order_no} />,
},
{
accessorKey: 'type',
header: t('column.type'),
cell: ({ row }) => getCommissionTypeText(row.original.type),
},
{
accessorKey: 'timestamp',
header: t('column.time'),
@@ -35,7 +59,6 @@ export default function CommissionLogPage() {
},
]}
params={[
{ key: 'search' },
{ key: 'date', type: 'date' },
{ key: 'user_id', placeholder: t('column.userId') },
]}
@@ -43,7 +66,6 @@ export default function CommissionLogPage() {
const { data } = await filterCommissionLog({
page: pagination.page,
size: pagination.size,
search: filter?.search,
date: (filter as any)?.date,
user_id: (filter as any)?.user_id,
});