1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Update i18next type

This commit is contained in:
xmflsct
2022-12-23 15:53:40 +01:00
parent b388853429
commit e32125ad17
49 changed files with 1054 additions and 896 deletions

View File

@@ -16,7 +16,7 @@ const TimelineTranslate = () => {
const { status, highlighted, rawContent, detectedLanguage } = useContext(StatusContext)
if (!status || !highlighted || !rawContent?.current.length) return null
const { t } = useTranslation('componentTimeline')
const { t } = useTranslation(['componentTimeline'])
const { colors } = useTheme()
const [detected, setDetected] = useState<{
@@ -101,15 +101,15 @@ const TimelineTranslate = () => {
}}
>
{isError
? t('shared.translate.failed')
? t('componentTimeline:shared.translate.failed')
: isSuccess
? typeof data?.error === 'string'
? t(`shared.translate.${data.error}`)
: t('shared.translate.succeed', {
? t(`componentTimeline:shared.translate.${data.error}` as any)
: t('componentTimeline:shared.translate.succeed', {
provider: data?.provider,
source: data?.sourceLanguage
})
: t('shared.translate.default')}
: t('componentTimeline:shared.translate.default')}
</CustomText>
{isFetching ? (
<Circle