Add i18n localization foundation to additional-service entity
- Convert 10 constant files to i18n-compatible getter functions: - ars/constant.ts: ARS status codes and payment methods - sms-payment/constant.ts: SMS payment status codes - link-pay/constant.ts: Link payment status codes - account-holder-auth/constant.ts: Account holder verification - account-holder-search/constant.ts: Account holder search types - face-auth/constant.ts: Face authentication types - fund-account/constant.ts: Fund account status codes - alimtalk/constant.ts: Alimtalk status and transaction types - payout/constant.ts: Payout search types - key-in/constant.ts: Key-in cancel types - Refactor lib/payment-status-utils.ts to curried functions with TFunction - Add 63 translation keys to additionalService namespace in ko.json/en.json - Localize 2 UI components as examples: - ui/filter/ars-filter.tsx - ui/ars/resend-sms-bottom-sheet.tsx 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,55 +1,57 @@
|
||||
export const getPaymentStatusText = (status?: string): string => {
|
||||
import { TFunction } from 'i18next';
|
||||
|
||||
export const getPaymentStatusText = (t: TFunction) => (status?: string): string => {
|
||||
if (!status) return '';
|
||||
|
||||
const statusMap: Record<string, string> = {
|
||||
// 숫자 문자열 매핑
|
||||
'0': '미완료/활성화',
|
||||
'1': '입금요청',
|
||||
'2': '결제완료',
|
||||
'3': '결제실패',
|
||||
'4': '결제중단',
|
||||
// 문자열 키 매핑 (하위 호환성)
|
||||
'ALL': '전체',
|
||||
'ACTIVE': '미완료/활성화',
|
||||
'DEPOSIT_REQUEST': '입금요청',
|
||||
'PAYMENT_COMPLETE': '결제완료',
|
||||
'PAYMENT_FAIL': '결제실패',
|
||||
'INACTIVE': '결제중단/비활성화'
|
||||
// Numeric string mapping
|
||||
'0': t('additionalService.linkPay.incompleteActive'),
|
||||
'1': t('additionalService.linkPay.depositRequest'),
|
||||
'2': t('additionalService.linkPay.paymentComplete'),
|
||||
'3': t('additionalService.linkPay.paymentFail'),
|
||||
'4': t('additionalService.linkPay.paymentStopped'),
|
||||
// String key mapping (backward compatibility)
|
||||
'ALL': t('transaction.constants.all'),
|
||||
'ACTIVE': t('additionalService.linkPay.incompleteActive'),
|
||||
'DEPOSIT_REQUEST': t('additionalService.linkPay.depositRequest'),
|
||||
'PAYMENT_COMPLETE': t('additionalService.linkPay.paymentComplete'),
|
||||
'PAYMENT_FAIL': t('additionalService.linkPay.paymentFail'),
|
||||
'INACTIVE': t('additionalService.linkPay.paymentStoppedInactive')
|
||||
};
|
||||
|
||||
return statusMap[status] || status;
|
||||
};
|
||||
|
||||
export const getProcessStatusText = (status?: string): string => {
|
||||
export const getProcessStatusText = (t: TFunction) => (status?: string): string => {
|
||||
if (!status) return '';
|
||||
|
||||
const processStatusMap: Record<string, string> = {
|
||||
'SEND_REQUEST': '발송요청',
|
||||
'SEND_CANCEL': '발송취소',
|
||||
'PENDING': '대기중'
|
||||
'SEND_REQUEST': t('additionalService.linkPay.sendRequest'),
|
||||
'SEND_CANCEL': t('additionalService.linkPay.sendCancel'),
|
||||
'PENDING': t('additionalService.linkPay.pending')
|
||||
};
|
||||
|
||||
return processStatusMap[status] || status;
|
||||
};
|
||||
|
||||
export const getSendMethodText = (method?: string): string => {
|
||||
export const getSendMethodText = (t: TFunction) => (method?: string): string => {
|
||||
if (!method) return '';
|
||||
|
||||
const sendMethodMap: Record<string, string> = {
|
||||
'SMS': 'SMS',
|
||||
'EMAIL': '이메일',
|
||||
'KAKAO': '알림톡'
|
||||
'EMAIL': t('additionalService.linkPay.email'),
|
||||
'KAKAO': t('additionalService.linkPay.alimtalk')
|
||||
};
|
||||
|
||||
return sendMethodMap[method] || method;
|
||||
};
|
||||
|
||||
export const getResultStatusText = (status?: string): string => {
|
||||
export const getResultStatusText = (t: TFunction) => (status?: string): string => {
|
||||
if (!status) return '';
|
||||
|
||||
const resultStatusMap: Record<string, string> = {
|
||||
'SUCCESS': '성공',
|
||||
'FAIL': '실패'
|
||||
'SUCCESS': t('additionalService.common.success'),
|
||||
'FAIL': t('additionalService.common.fail')
|
||||
};
|
||||
|
||||
return resultStatusMap[status] || status;
|
||||
|
||||
Reference in New Issue
Block a user