Convert transaction constants to i18n-compatible getter functions
- Convert all hardcoded constant arrays to functions accepting TFunction - Add transaction.constants namespace with 40+ translation keys - Update contant.ts: All exports now use get* prefix (e.g., getCashReceiptPurposeTypeBtnGroup) - Replace ko/en properties with single name property using t() function Updated constants: - getAllTransactionMoidTidOptionsGroup(t) - getAllTransactionStatusCodeBtnGroup(t) - getAllTransactionServiceCodeOptionsGroup(t) - getAllTransactionStatusCode(t) - getCashReceiptPurposeTypeBtnGroup(t) - getCashReceiptTransactionTypeBtnGroup(t) - getCashReceiptProcessResultBtnGroup(t) - getEscrowSearchTypeOptionsGroup(t) - getEscrowDeliveryStatusBtnGroup(t) - getEscrowSettlementStatusBtnGroup(t) - getBillingSearchTypeOptionsGroup(t) - getBillingRequestStatusBtnGroup(t) - getBillingProcessResultBtnGroup(t) - getBillingPaymentMethodBtnGroup(t) Updated components (9 files): - Filter components: all-transaction, cash-receipt, billing, escrow - List pages: billing, cash-receipt, escrow - UI components: list-item, important-info-section All constants now properly support Korean/English language switching. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { ListItemProps, TransactionCategory } from '../model/types';
|
||||
import moment from 'moment';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { AllTracsactionStatusCode } from '../model/contant';
|
||||
import { getAllTransactionStatusCode } from '../model/contant';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const ListItem = ({
|
||||
@@ -129,15 +129,16 @@ export const ListItem = ({
|
||||
const getStatusName = () => {
|
||||
let str;
|
||||
if(transactionCategory === TransactionCategory.AllTransaction){
|
||||
Loop1:
|
||||
for(let i=0;i<AllTracsactionStatusCode.length;i++){
|
||||
if(serviceCode === AllTracsactionStatusCode[i]?.serviceCode){
|
||||
let list = AllTracsactionStatusCode[i]?.list;
|
||||
const allTransactionStatusCode = getAllTransactionStatusCode(t);
|
||||
Loop1:
|
||||
for(let i=0;i<allTransactionStatusCode.length;i++){
|
||||
if(serviceCode === allTransactionStatusCode[i]?.serviceCode){
|
||||
let list = allTransactionStatusCode[i]?.list;
|
||||
if(!!list){
|
||||
Loop2:
|
||||
for(let j=0;j<list.length;j++){
|
||||
if(list[j]?.code === statusCode){
|
||||
str = list[j]?.ko;
|
||||
str = list[j]?.name;
|
||||
break Loop1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user