mirror of
https://github.com/tooot-app/app
synced 2025-06-05 22:19:13 +02:00
Fix default language not set
This commit is contained in:
@ -4,6 +4,7 @@ import { useTranslateQuery } from '@utils/queryHooks/translate'
|
||||
import { getSettingsLanguage } from '@utils/slices/settingsSlice'
|
||||
import { StyleConstants } from '@utils/styles/constants'
|
||||
import { useTheme } from '@utils/styles/ThemeManager'
|
||||
import * as Localization from 'expo-localization'
|
||||
import React, { useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Pressable, StyleSheet, Text } from 'react-native'
|
||||
@ -48,7 +49,7 @@ const TimelineTranslate = React.memo(
|
||||
const [enabled, setEnabled] = useState(false)
|
||||
const { refetch, data, isLoading, isSuccess, isError } = useTranslateQuery({
|
||||
source: status.language,
|
||||
target: settingsLanguage,
|
||||
target: Localization.locale || settingsLanguage || 'en',
|
||||
text,
|
||||
options: { enabled }
|
||||
})
|
||||
@ -92,7 +93,9 @@ const TimelineTranslate = React.memo(
|
||||
source: data?.sourceLanguage
|
||||
})
|
||||
: t('shared.translate.default')}
|
||||
{__DEV__ ? ` Source: ${status.language}` : undefined}
|
||||
{__DEV__
|
||||
? ` Source: ${status.language}; Target: ${settingsLanguage}`
|
||||
: undefined}
|
||||
</Text>
|
||||
{isLoading ? (
|
||||
<Circle
|
||||
|
Reference in New Issue
Block a user