- 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>
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import { TFunction } from 'i18next';
|
|
import { FaceAuthResult, FaceAuthTransType } from "./types";
|
|
|
|
export const getAuthResultBtnGroup = (t: TFunction) => [
|
|
{ name: t('transaction.constants.all'), value: FaceAuthResult.ALL },
|
|
{ name: t('additionalService.common.success'), value: FaceAuthResult.SUCCESS },
|
|
{ name: t('additionalService.common.fail'), value: FaceAuthResult.FAIL },
|
|
];
|
|
|
|
export const getTransactionTypeBtnGroup = (t: TFunction) => [
|
|
{ name: t('transaction.constants.all'), value: FaceAuthTransType.ALL },
|
|
{ name: t('additionalService.faceAuth.authentication'), value: FaceAuthTransType.AUTH },
|
|
{ name: t('additionalService.faceAuth.registration'), value: FaceAuthTransType.REGISTER },
|
|
];
|
|
|
|
|
|
export const getAuthResultStatusText = (t: TFunction) => (status?: string): string => {
|
|
if (!status) return '';
|
|
|
|
const authResultMap: Record<string, string> = {
|
|
'SUCCESS': t('additionalService.common.success'),
|
|
'FAIL': t('additionalService.common.fail')
|
|
}
|
|
|
|
return authResultMap[status] || status;
|
|
}
|
|
|
|
export const getTransTypeText = (t: TFunction) => (transType?: string): string => {
|
|
if (!transType) return '';
|
|
|
|
const transTypeMap: Record<string, string> = {
|
|
'REGISTER': t('additionalService.faceAuth.registration'),
|
|
'AUTH': t('additionalService.faceAuth.authentication')
|
|
}
|
|
|
|
return transTypeMap[transType] || transType;
|
|
} |