diff --git a/src/shared/constants/local-storage.ts b/src/shared/constants/local-storage.ts index 0d2df6a..a36bd2d 100644 --- a/src/shared/constants/local-storage.ts +++ b/src/shared/constants/local-storage.ts @@ -14,4 +14,5 @@ export enum StorageKeys { DeviceId = 'DEVICE_ID', AppVersion = 'APP_VERSION', LogOut = 'LOGOUT', + i18nextLng = 'i18nextLng', }; diff --git a/src/widgets/show-alert/index.tsx b/src/widgets/show-alert/index.tsx index 2ab520f..15693f2 100644 --- a/src/widgets/show-alert/index.tsx +++ b/src/widgets/show-alert/index.tsx @@ -1,9 +1,12 @@ +import { StorageKeys } from '@/shared/constants/local-storage'; +import { getLocalStorage } from '@/shared/lib'; import { Dialog } from '@/shared/ui/dialogs/dialog'; import { overlay } from 'overlay-kit'; import { useTranslation } from 'react-i18next'; export const showAlert = (msg: string, callback?: () => void) => { - const { t } = useTranslation(); + let language = getLocalStorage(StorageKeys.i18nextLng); + let btnLable = (language === 'ko')? '확인': 'confirm'; const onConfirmClick = () => { if(!!callback && typeof(callback) === 'function'){ setTimeout(() => { @@ -22,7 +25,7 @@ export const showAlert = (msg: string, callback?: () => void) => { open={ isOpen } onClose={ close } message={ msg } - buttonLabel={ [t('common.confirm')] } + buttonLabel={ [btnLable] } onConfirmClick={ onConfirmClick } /> );