fix i18next.d.ts (#2064)

* fix i18next.d.ts

* feat: packages web i18n

* delete file
This commit is contained in:
jingyang
2024-07-17 15:27:51 +08:00
committed by GitHub
parent 36f8755d09
commit 982325d066
75 changed files with 216 additions and 204 deletions

View File

@@ -4,7 +4,7 @@ import { useEffect } from 'react';
export const useBeforeunload = (props?: { callback?: () => any; tip?: string }) => {
const { t } = useTranslation();
const { tip = t('common.Confirm to leave the page'), callback } = props || {};
const { tip = t('common:common.Confirm to leave the page'), callback } = props || {};
useEffect(() => {
const listen =

View File

@@ -16,12 +16,12 @@ export const useConfirm = (props?: {
const map = useMemo(() => {
const map = {
common: {
title: t('common.confirm.Common Tip'),
title: t('common:common.confirm.Common Tip'),
variant: 'primary',
iconSrc: 'common/confirm/commonTip'
},
delete: {
title: t('common.Delete Warning'),
title: t('common:common.Delete Warning'),
variant: 'dangerFill',
iconSrc: 'common/confirm/deleteTip'
}
@@ -31,7 +31,7 @@ export const useConfirm = (props?: {
}, [props?.type, t]);
const {
title = map?.title || t('Warning'),
title = map?.title || t('common:Warning'),
iconSrc = map?.iconSrc,
content,
showCancel = true,
@@ -58,8 +58,8 @@ export const useConfirm = (props?: {
const ConfirmModal = useCallback(
({
closeText = t('common.Cancel'),
confirmText = t('common.Confirm'),
closeText = t('common:common.Cancel'),
confirmText = t('common:common.Confirm'),
isLoading,
bg,
countDown = 0

View File

@@ -85,7 +85,7 @@ export const useEditTextarea = ({
({
maxLength = 30,
iconSrc = 'modal/edit',
closeBtnText = t('common.Close')
closeBtnText = t('common:common.Close')
}: {
maxLength?: number;
iconSrc?: string;
@@ -116,7 +116,7 @@ export const useEditTextarea = ({
</Button>
)}
<Button onClick={onclickConfirm} px={6}>
{t('common.Confirm')}
{t('common:common.Confirm')}
</Button>
</ModalFooter>
</MyModal>

View File

@@ -27,7 +27,7 @@ export const useRequest = ({ successToast, errorToast, onSuccess, onError, ...pr
onError?.(err, variables, context);
if (errorToast !== undefined) {
const errText = t(getErrText(err, errorToast || ''));
const errText = t(getErrText(err, errorToast || '') as any);
if (errText) {
toast({
title: errText,
@@ -64,7 +64,7 @@ export const useRequest2 = <TData, TParams extends any[]>(
onError: (err, params) => {
rest?.onError?.(err, params);
if (errorToast !== undefined) {
const errText = t(getErrText(err, errorToast || ''));
const errText = t(getErrText(err, errorToast || '') as any);
if (errText) {
toast({
title: errText,

View File

@@ -116,7 +116,7 @@ export function useScrollPagination<
<Box ref={wrapperRef}>{children}</Box>
{noMore.current && list.length > 0 && (
<Box py={4} textAlign={'center'} color={'myGray.600'} fontSize={'xs'}>
{t('common.No more data')}
{t('common:common.No more data')}
</Box>
)}
{list.length === 0 && !isLoading && EmptyChildren && <>{EmptyChildren}</>}