From 04c544554ce843ddd2e8f5d3abaf2fbcb4912d6e Mon Sep 17 00:00:00 2001 From: Jay Sheen Date: Thu, 30 Oct 2025 17:19:53 +0900 Subject: [PATCH] Add i18n localization to sort-type-box component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/entities/common/ui/sort-type-box.tsx | 17 ++++-- src/locales/en.json | 69 ++++++++++++------------ src/locales/ko.json | 7 +-- 3 files changed, 51 insertions(+), 42 deletions(-) diff --git a/src/entities/common/ui/sort-type-box.tsx b/src/entities/common/ui/sort-type-box.tsx index 44f71ee..a05502b 100644 --- a/src/entities/common/ui/sort-type-box.tsx +++ b/src/entities/common/ui/sort-type-box.tsx @@ -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 ( <>
- { sortOptions.map((option: Record, index: number) => ( + { options.map((option: Record, index: number) => ( <> { (index > 0) && | diff --git a/src/locales/en.json b/src/locales/en.json index 1859f4a..895df54 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -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": { diff --git a/src/locales/ko.json b/src/locales/ko.json index d3985ca..b8dd6c7 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -17,7 +17,8 @@ "noData": "데이터가 μ—†μŠ΅λ‹ˆλ‹€", "next": "λ‹€μŒ", "latest": "μ΅œμ‹ μˆœ", - "oldest": "였래된순" + "oldest": "였래된순", + "highAmountOrder": "κ³ μ•‘μˆœ" }, "menu": { "home": "ν™ˆ", @@ -423,7 +424,7 @@ "transactionId": "거래ID", "merchantTid": "거래ID", "subMallName": "μ„œλΈŒλͺ°λͺ…", - "subMallBusinessNumber": "μ„œλΈŒλͺ° μ‚¬μ—…μž 번호", + "subMallBusinessNumber": "μ„œλΈŒλͺ° μ‚¬μ—…μžλ²ˆν˜Έ", "issueChannel": "λ°œν–‰κ²½λ‘œ", "failureReason": "μ‹€νŒ¨μ‚¬μœ ", "issueNumber": "λ°œν–‰λ²ˆν˜Έ", @@ -561,7 +562,7 @@ "handWrittenIssuance": { "step1Title": "λ°œν–‰ 정보 μž…λ ₯", "step2Title": "λ°œν–‰ κΈˆμ•‘ μž…λ ₯", - "businessNumber": "μ‚¬μ—…μž 번호", + "businessNumber": "μ‚¬μ—…μžλ²ˆν˜Έ", "incomeDeduction": "μ†Œλ“κ³΅μ œ", "expenseProof": "μ§€μΆœμ¦λΉ™", "productNamePlaceholder": "μƒν’ˆλͺ…",