Add i18n localization to sort-type-box component
- Replace hardcoded Korean sort labels with translation keys - Add useTranslation hook to sort-type-box.tsx - Add common.highAmountOrder to ko.json and en.json - Use filter.sortOrders.latest for latest sort option - Convert default sortOptions to use t() function Now supports dynamic language switching for sort options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
import { SortTypeKeys, SortTypeBoxProps } from '../model/types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const SortTypeBox = ({
|
||||
sortType,
|
||||
onClickToSort,
|
||||
sortOptions = [
|
||||
{ key: SortTypeKeys.LATEST, label: '최신순' },
|
||||
{ key: SortTypeKeys.HIGH_AMOUNT, label: '고액순' }
|
||||
]
|
||||
sortOptions
|
||||
}: SortTypeBoxProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const defaultSortOptions = [
|
||||
{ key: SortTypeKeys.LATEST, label: t('filter.sortOrders.latest') },
|
||||
{ key: SortTypeKeys.HIGH_AMOUNT, label: t('common.highAmountOrder') }
|
||||
];
|
||||
|
||||
const options = sortOptions || defaultSortOptions;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="sort-options">
|
||||
{ sortOptions.map((option: Record<string, any>, index: number) => (
|
||||
{ options.map((option: Record<string, any>, index: number) => (
|
||||
<>
|
||||
{ (index > 0) &&
|
||||
<span className="sort-divider">|</span>
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
"noData": "No data available",
|
||||
"next": "Next",
|
||||
"latest": "Latest",
|
||||
"oldest": "Oldest"
|
||||
"oldest": "Oldest",
|
||||
"highAmountOrder": "High Amount"
|
||||
},
|
||||
"menu": {
|
||||
"home": "Home",
|
||||
@@ -53,31 +54,31 @@
|
||||
"close": "Close",
|
||||
"apply": "Apply",
|
||||
"merchant": "Merchant",
|
||||
"orderNumberTid": "OID/TID",
|
||||
"orderNumberTid": "Order No./TID",
|
||||
"period": "Period",
|
||||
"issuanceDate": "Issuance Date",
|
||||
"issuanceDate": "Issue Date",
|
||||
"transactionStatus": "Transaction Status",
|
||||
"paymentMethod": "Payment Method",
|
||||
"transactionAmount": "Transaction Amount",
|
||||
"detailSearch": "Detail Search",
|
||||
"detailSearch": "Detailed Search",
|
||||
"purpose": "Purpose",
|
||||
"transactionCategory": "Transaction Category",
|
||||
"progressStatus": "Progress Status",
|
||||
"approvalIssuanceNumber": "Approval/Issuance Number",
|
||||
"transactionCategory": "Payment Type",
|
||||
"progressStatus": "Payment Status",
|
||||
"approvalIssuanceNumber": "Approval/Issue Number",
|
||||
"requestStatus": "Request Status",
|
||||
"processingResult": "Processing Result",
|
||||
"processingResult": "Result",
|
||||
"deliveryStatus": "Delivery Status",
|
||||
"searchOptions": {
|
||||
"cardNumber": "Card Number",
|
||||
"approvalNumber": "Approval Number",
|
||||
"buyerName": "Buyer Name",
|
||||
"buyerName": "Purchaser Name",
|
||||
"virtualAccountNumber": "Virtual Account Number",
|
||||
"depositorName": "Depositor Name",
|
||||
"phoneNumber": "Phone Number",
|
||||
"giftCardNumber": "Gift Card Number",
|
||||
"customerId": "Customer ID",
|
||||
"culturelandId": "Cultureland ID",
|
||||
"tmoneyCardNumber": "T-money Card Number",
|
||||
"tmoneyCardNumber": "Tmoney Card Number",
|
||||
"issueNumber": "Issue Number"
|
||||
},
|
||||
"periods": {
|
||||
@@ -86,7 +87,7 @@
|
||||
"6months": "6 Months",
|
||||
"custom": "Custom"
|
||||
},
|
||||
"transactionType": "Transaction Type",
|
||||
"transactionType": "Payment Type",
|
||||
"transactionTypes": {
|
||||
"all": "All",
|
||||
"deposit": "Deposit",
|
||||
@@ -393,7 +394,7 @@
|
||||
"fields": {
|
||||
"billKey": "Bill Key",
|
||||
"tid": "TID",
|
||||
"orderNumber": "Order Number",
|
||||
"orderNumber": "Order No.",
|
||||
"approvalNumber": "Approval Number",
|
||||
"approvalDate": "Approval Date",
|
||||
"approvalDay": "Approval Day",
|
||||
@@ -404,10 +405,10 @@
|
||||
"installmentMonthly": "{{count}} Month Installment",
|
||||
"lumpSum": "Lump Sum",
|
||||
"productName": "Product Name",
|
||||
"buyerName": "Buyer Name",
|
||||
"buyer": "Buyer",
|
||||
"originalTid": "Original TID",
|
||||
"originalAmount": "Original Amount",
|
||||
"buyerName": "Purchaser Name",
|
||||
"buyer": "Purchaser",
|
||||
"originalTid": "Original Transaction TID",
|
||||
"originalAmount": "Original Transaction Amount",
|
||||
"partCancelTid": "Partial Cancel TID",
|
||||
"reApprovalTid": "Re-approval TID",
|
||||
"partCancelAmount": "Partial Cancel Amount",
|
||||
@@ -418,8 +419,8 @@
|
||||
"receiptInfo": "Cash Receipt",
|
||||
"transactionId": "Transaction ID",
|
||||
"merchantTid": "Transaction ID",
|
||||
"subMallName": "Sub Mall Name",
|
||||
"subMallBusinessNumber": "Sub Mall Business Number",
|
||||
"subMallName": "Sub-mall Name",
|
||||
"subMallBusinessNumber": "Sub-mall Business Number",
|
||||
"issueChannel": "Issue Channel",
|
||||
"failureReason": "Failure Reason",
|
||||
"issueNumber": "Issue Number",
|
||||
@@ -427,8 +428,8 @@
|
||||
"issueDateTime": "Issue Date Time",
|
||||
"purpose": "Purpose",
|
||||
"paymentMethod": "Payment Method",
|
||||
"transactionStatus": "Transaction Status",
|
||||
"transactionMethod": "Transaction Method",
|
||||
"transactionStatus": "Payment Status",
|
||||
"transactionMethod": "Payment Method",
|
||||
"transactionType": "Transaction Type",
|
||||
"deliveryStatus": "Delivery Status",
|
||||
"deliveryRegistration": "Delivery Registration",
|
||||
@@ -516,26 +517,26 @@
|
||||
},
|
||||
"constants": {
|
||||
"all": "All",
|
||||
"orderNumber": "Order Number",
|
||||
"orderNumber": "Order No.",
|
||||
"tid": "TID",
|
||||
"approval": "Approval",
|
||||
"approvalComplete": "Approval/Payment Complete",
|
||||
"cancel": "Cancel",
|
||||
"cancelShort": "Cancellation",
|
||||
"totalCancel": "Total Cancellation/Cancel",
|
||||
"totalCancelShort": "Total Cancellation",
|
||||
"cancelShort": "Post-cancel",
|
||||
"totalCancel": "Pre-cancel / Cancel",
|
||||
"totalCancelShort": "Pre-cancel",
|
||||
"refund": "Refund",
|
||||
"deposit": "Deposit",
|
||||
"waitingDeposit": "Waiting Deposit",
|
||||
"issueCancel": "Issue Cancel",
|
||||
"issueCancel": "Serial Number Cancel",
|
||||
"creditCard": "Credit Card",
|
||||
"virtualAccount": "Virtual Account",
|
||||
"accountTransfer": "Account Transfer",
|
||||
"accountSimpleTransfer": "Account Simple Payment",
|
||||
"mobilePayment": "Mobile Payment",
|
||||
"accountTransfer": "Bank Transfer",
|
||||
"accountSimpleTransfer": "Simple Account Payment",
|
||||
"mobilePayment": "Mobile Phone",
|
||||
"ssgMoney": "SSG Money",
|
||||
"ssgBank": "SSG Bank Account",
|
||||
"cultureLand": "Culture Gift Certificate",
|
||||
"cultureLand": "Gift Voucher",
|
||||
"tmoneyPay": "Tmoney Pay",
|
||||
"request": "Request",
|
||||
"requestCancel": "Request Cancel",
|
||||
@@ -550,23 +551,23 @@
|
||||
"purchaseReject": "Purchase Reject",
|
||||
"refundProcessing": "Refund Processing",
|
||||
"depositComplete": "Deposit Complete",
|
||||
"inProgress": "In Progress",
|
||||
"inProgress": "Progressing",
|
||||
"success": "Success",
|
||||
"failure": "Failure"
|
||||
},
|
||||
"handWrittenIssuance": {
|
||||
"step1Title": "Enter Issue Information",
|
||||
"step2Title": "Enter Issue Amount",
|
||||
"businessNumber": "Business Number",
|
||||
"incomeDeduction": "Income Deduction",
|
||||
"expenseProof": "Expense Proof",
|
||||
"businessNumber": "Business registration Number",
|
||||
"incomeDeduction": "Income Tax Deduction",
|
||||
"expenseProof": "Proof of Expenditure",
|
||||
"productNamePlaceholder": "Product Name",
|
||||
"buyerNamePlaceholder": "Buyer Name",
|
||||
"issueNumberPlaceholder": "Business Number OR Phone Number",
|
||||
"emailPlaceholder": "TEST123@nicepay.com",
|
||||
"phoneNumberPlaceholder": "01012345678",
|
||||
"issueAmount": "Issue Amount",
|
||||
"vatAutoCalc": "VAT Auto Calculate",
|
||||
"vatAutoCalc": "VAT Automatic Calculation",
|
||||
"errorMessage": "The issue amount must equal the sum of supply amount, VAT, tax-free amount, and service charge."
|
||||
},
|
||||
"list": {
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
"noData": "데이터가 없습니다",
|
||||
"next": "다음",
|
||||
"latest": "최신순",
|
||||
"oldest": "오래된순"
|
||||
"oldest": "오래된순",
|
||||
"highAmountOrder": "고액순"
|
||||
},
|
||||
"menu": {
|
||||
"home": "홈",
|
||||
|
||||
Reference in New Issue
Block a user