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

Using Crowdin now

This commit is contained in:
Zhiyuan Zheng
2021-03-29 00:22:30 +02:00
parent 9229a0256f
commit c4ec88609e
4 changed files with 39 additions and 41 deletions

View File

@ -7,11 +7,11 @@
"notificationsFilter": { "notificationsFilter": {
"heading": "Show notification types", "heading": "Show notification types",
"content": { "content": {
"follow": "$t(me.push.follow.heading)", "follow": "$t(screenTabs:me.push.follow.heading)",
"favourite": "$t(me.push.favourite.heading)", "favourite": "$t(screenTabs:me.push.favourite.heading)",
"reblog": "$t(me.push.reblog.heading)", "reblog": "$t(screenTabs:me.push.reblog.heading)",
"mention": "$t(me.push.mention.heading)", "mention": "$t(screenTabs:me.push.mention.heading)",
"poll": "$t(me.push.poll.heading)", "poll": "$t(screenTabs:me.push.poll.heading)",
"follow_request": "Follow request" "follow_request": "Follow request"
} }
} }

View File

@ -7,11 +7,11 @@
"notificationsFilter": { "notificationsFilter": {
"heading": "显示通知", "heading": "显示通知",
"content": { "content": {
"follow": "$t(me.push.follow.heading)", "follow": "$t(screenTabs:me.push.follow.heading)",
"favourite": "$t(me.push.favourite.heading)", "favourite": "$t(screenTabs:me.push.favourite.heading)",
"reblog": "$t(me.push.reblog.heading)", "reblog": "$t(screenTabs:me.push.reblog.heading)",
"mention": "$t(me.push.mention.heading)", "mention": "$t(screenTabs:me.push.mention.heading)",
"poll": "$t(me.push.poll.heading)", "poll": "$t(screenTabs:me.push.poll.heading)",
"follow_request": "关注请求" "follow_request": "关注请求"
} }
} }

View File

@ -5,12 +5,12 @@ import { useTranslation } from 'react-i18next'
const AccountInformationSwitch: React.FC = () => { const AccountInformationSwitch: React.FC = () => {
const navigation = useNavigation() const navigation = useNavigation()
const { t } = useTranslation() const { t } = useTranslation('screenTabs')
return ( return (
<Button <Button
type='text' type='text'
content={t('meSwitch:heading')} content={t('me.stacks.switch.name')}
onPress={() => navigation.navigate('Tab-Me-Switch')} onPress={() => navigation.navigate('Tab-Me-Switch')}
/> />
) )

View File

@ -25,7 +25,7 @@ export type QueryKeyTimeline = [
} }
] ]
const queryFunction = ({ const queryFunction = async ({
queryKey, queryKey,
pageParam pageParam
}: { }: {
@ -87,29 +87,28 @@ const queryFunction = ({
} }
}) })
} else { } else {
return apiInstance<(Mastodon.Status & { _pinned: boolean })[]>({ const res1 = await apiInstance<(Mastodon.Status & { _pinned: boolean} )[]>({
method: 'get', method: 'get',
url: `accounts/${account}/statuses`, url: `accounts/${account}/statuses`,
params: { params: {
pinned: 'true' pinned: 'true'
} }
}).then(async res1 => { })
res1.body = res1.body.map(status => { res1.body = res1.body.map(status => {
status._pinned = true status._pinned = true
return status return status
}) })
const res2 = await apiInstance<Mastodon.Status[]>({ const res2 = await apiInstance<Mastodon.Status[]>({
method: 'get', method: 'get',
url: `accounts/${account}/statuses`, url: `accounts/${account}/statuses`,
params: { params: {
exclude_replies: 'true' exclude_replies: 'true'
}
})
return {
body: uniqBy([...res1.body, ...res2.body], 'id'),
...(res2.links.next && { links: { next: res2.links.next } })
} }
}) })
return await {
body: uniqBy([...res1.body, ...res2.body], 'id'),
...(res2.links.next && { links: { next: res2.links.next } })
}
} }
case 'Account_All': case 'Account_All':
@ -165,21 +164,20 @@ const queryFunction = ({
}) })
case 'Toot': case 'Toot':
return apiInstance<Mastodon.Status>({ const res1_1 = await apiInstance<Mastodon.Status>({
method: 'get', method: 'get',
url: `statuses/${toot}` url: `statuses/${toot}`
}).then(async res1 => {
const res2 = await apiInstance<{
ancestors: Mastodon.Status[]
descendants: Mastodon.Status[]
}>({
method: 'get',
url: `statuses/${toot}/context`
})
return {
body: [...res2.body.ancestors, res1.body, ...res2.body.descendants]
}
}) })
const res2_1 = await apiInstance<{
ancestors: Mastodon.Status[]
descendants: Mastodon.Status[]
}>({
method: 'get',
url: `statuses/${toot}/context`
})
return await {
body: [...res2_1.body.ancestors, res1_1.body, ...res2_1.body.descendants]
}
default: default:
return Promise.reject() return Promise.reject()
} }