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

Update en strings

This commit is contained in:
Zhiyuan Zheng
2021-01-20 00:39:39 +01:00
parent 5a248716bf
commit 314bc31e32
57 changed files with 826 additions and 191 deletions

View File

@ -106,7 +106,7 @@ const GracefullyImage: React.FC<Props> = ({
}
return
} catch (error) {
if (__DEV__) console.warn('Image preview', error)
if (__DEV__) console.warn('Image', error)
}
}

View File

@ -96,7 +96,10 @@ const ComponentInstance: React.FC<Props> = ({
t('update.local.alert.title'),
t('update.local.alert.message'),
[
{ text: t('update.local.alert.buttons.cancel'), style: 'cancel' },
{
text: t('update.local.alert.buttons.cancel'),
style: 'cancel'
},
{
text: t('update.local.alert.buttons.continue'),
onPress: () => {
@ -232,23 +235,25 @@ const ComponentInstance: React.FC<Props> = ({
potentialWidth={4}
/>
</View>
<View style={styles.disclaimer}>
<Icon
name='Lock'
size={StyleConstants.Font.Size.S}
color={theme.secondary}
style={styles.disclaimerIcon}
/>
<Text
style={[styles.disclaimerText, { color: theme.secondary }]}
onPress={() => Linking.openURL('https://tooot.app/privacy')}
>
{t('server.disclaimer')}
<Text style={{ color: theme.blue }}>
https://tooot.app/privacy
{type === 'local' ? (
<View style={styles.disclaimer}>
<Icon
name='Lock'
size={StyleConstants.Font.Size.S}
color={theme.secondary}
style={styles.disclaimerIcon}
/>
<Text
style={[styles.disclaimerText, { color: theme.secondary }]}
onPress={() => Linking.openURL('https://tooot.app/privacy')}
>
{t('server.disclaimer')}
<Text style={{ color: theme.blue }}>
https://tooot.app/privacy
</Text>
</Text>
</Text>
</View>
</View>
) : null}
</View>
</View>

View File

@ -6,6 +6,7 @@ import {
useRelationshipMutation,
useRelationshipQuery
} from '@utils/queryHooks/relationship'
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { useQueryClient } from 'react-query'
@ -23,12 +24,16 @@ const RelationshipOutgoing = React.memo(
const queryKeyRelationship: QueryKeyRelationship = ['Relationship', { id }]
const queryClient = useQueryClient()
const mutation = useRelationshipMutation({
onSuccess: res => {
onSuccess: (res, { payload: { action } }) => {
haptics('Success')
queryClient.setQueryData<Mastodon.Relationship[]>(
queryKeyRelationship,
[res]
)
if (action === 'follow' || action === 'block') {
const queryKey: QueryKeyTimeline = ['Timeline', { page: 'Following' }]
queryClient.invalidateQueries(queryKey)
}
},
onError: (err: any, { payload: { action } }) => {
haptics('Error')

View File

@ -68,7 +68,7 @@ const Timeline: React.FC<Props> = ({
...queryKeyParams,
options: {
getPreviousPageParam: firstPage => {
return firstPage.length
return Array.isArray(firstPage) && firstPage.length
? {
direction: 'prev',
id: firstPage[0].last_status
@ -78,7 +78,7 @@ const Timeline: React.FC<Props> = ({
: undefined
},
getNextPageParam: lastPage => {
return lastPage.length
return Array.isArray(lastPage) && lastPage.length
? {
direction: 'next',
id: lastPage[lastPage.length - 1].last_status
@ -176,22 +176,22 @@ const Timeline: React.FC<Props> = ({
(isFetching && !isFetchingNextPage && !isLoading)
}
onRefresh={() => {
if (hasPreviousPage) {
fetchPreviousPage()
} else {
queryClient.setQueryData<InfiniteData<any> | undefined>(
queryKey,
data => {
if (data) {
return {
pages: data.pages.slice(1),
pageParams: data.pageParams.slice(1)
}
}
}
)
refetch()
}
// if (hasPreviousPage) {
// fetchPreviousPage()
// } else {
// queryClient.setQueryData<InfiniteData<any> | undefined>(
// queryKey,
// data => {
// if (data) {
// return {
// pages: data.pages.slice(1),
// pageParams: data.pageParams.slice(1)
// }
// }
// }
// )
refetch()
// }
}}
/>
),

View File

@ -169,27 +169,53 @@ const TimelineActions: React.FC<Props> = ({ queryKey, status, reblog }) => {
)
const childrenReblog = useMemo(
() => (
<Icon
name='Repeat'
color={
status.visibility === 'private' || status.visibility === 'direct'
? theme.disabled
: iconColorAction(status.reblogged)
}
size={StyleConstants.Font.Size.L}
/>
<>
<Icon
name='Repeat'
color={
status.visibility === 'private' || status.visibility === 'direct'
? theme.disabled
: iconColorAction(status.reblogged)
}
size={StyleConstants.Font.Size.L}
/>
{status.reblogs_count > 0 && (
<Text
style={{
color: theme.secondary,
...StyleConstants.FontStyle.M,
marginLeft: StyleConstants.Spacing.XS
}}
>
{status.reblogs_count}
</Text>
)}
</>
),
[status.reblogged]
[status.reblogged, status.reblogs_count]
)
const childrenFavourite = useMemo(
() => (
<Icon
name='Heart'
color={iconColorAction(status.favourited)}
size={StyleConstants.Font.Size.L}
/>
<>
<Icon
name='Heart'
color={iconColorAction(status.favourited)}
size={StyleConstants.Font.Size.L}
/>
{status.favourites_count > 0 && (
<Text
style={{
color: theme.secondary,
...StyleConstants.FontStyle.M,
marginLeft: StyleConstants.Spacing.XS
}}
>
{status.favourites_count}
</Text>
)}
</>
),
[status.favourited]
[status.favourited, status.favourites_count]
)
const childrenBookmark = useMemo(
() => (
@ -245,6 +271,7 @@ const styles = StyleSheet.create({
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
paddingVertical: StyleConstants.Spacing.S
}
})

View File

@ -41,10 +41,7 @@ const HeaderActionsAccount: React.FC<Props> = ({
toast({
type: 'error',
message: t('common:toastMessage.error.message', {
function: t(
`shared.header.actions.account.${property}.function`,
{ acct: account.acct }
)
function: t(`shared.header.actions.account.${property}.function`)
}),
...(err.status &&
typeof err.status === 'number' &&
@ -62,9 +59,7 @@ const HeaderActionsAccount: React.FC<Props> = ({
return (
<MenuContainer>
<MenuHeader
heading={t('shared.header.actions.account.heading')}
/>
<MenuHeader heading={t('shared.header.actions.account.heading')} />
<MenuRow
onPress={() => {
setBottomSheetVisible(false)
@ -91,12 +86,9 @@ const HeaderActionsAccount: React.FC<Props> = ({
})
}}
iconFront='XCircle'
title={t(
'shared.header.actions.account.block.button',
{
acct: account.acct
}
)}
title={t('shared.header.actions.account.block.button', {
acct: account.acct
})}
/>
<MenuRow
onPress={() => {
@ -109,12 +101,9 @@ const HeaderActionsAccount: React.FC<Props> = ({
})
}}
iconFront='Flag'
title={t(
'shared.header.actions.account.reports.button',
{
acct: account.acct
}
)}
title={t('shared.header.actions.account.reports.button', {
acct: account.acct
})}
/>
</MenuContainer>
)

View File

@ -128,7 +128,7 @@ const TimelinePoll: React.FC<Props> = ({
return (
<Text style={[styles.expiration, { color: theme.secondary }]}>
<Trans
i18nKey='timeline:shared.poll.meta.expiration.until'
i18nKey='componentTimeline:shared.poll.meta.expiration.until'
components={[<RelativeTime date={poll.expires_at} />]}
/>
</Text>