From 314bc31e3275f4489bf8355f122f114626047021 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Wed, 20 Jan 2021 00:39:39 +0100 Subject: [PATCH] Update en strings --- .github/workflows/production.yml | 28 ++++ .github/workflows/staging.yml | 28 ++++ .github/workflows/testing.yml | 4 +- app.config.ts | 30 ++-- package.json | 1 + src/components/GracefullyImage.tsx | 2 +- src/components/Instance.tsx | 39 +++-- src/components/Relationship/Outgoing.tsx | 7 +- src/components/Timelines/Timeline.tsx | 36 ++-- .../Timelines/Timeline/Shared/Actions.tsx | 59 +++++-- .../Timeline/Shared/HeaderActions/Account.tsx | 27 +-- .../Timelines/Timeline/Shared/Poll.tsx | 2 +- src/i18n/en/_all.ts | 27 +++ src/i18n/en/common.ts | 35 ++-- src/i18n/en/components/instance.ts | 34 ++++ src/i18n/en/components/parse.ts | 8 + src/i18n/en/components/relationship.ts | 16 ++ src/i18n/en/components/timeline.ts | 155 ++++++++++++++++++ src/i18n/en/screens/local.ts | 8 + src/i18n/en/screens/meBookmarks.ts | 4 + src/i18n/en/screens/meConversations.ts | 4 + src/i18n/en/screens/meFavourites.ts | 4 + src/i18n/en/screens/meLists.ts | 4 + src/i18n/en/screens/meListsList.ts | 4 + src/i18n/en/screens/meRoot.ts | 29 ++++ src/i18n/en/screens/meSettings.ts | 49 ++++++ src/i18n/en/screens/meSettingsUpdateRemote.ts | 3 + src/i18n/en/screens/meSwitch.ts | 7 + src/i18n/en/screens/notifications.ts | 3 + src/i18n/en/screens/public.ts | 8 + src/i18n/en/screens/sharedAccount.ts | 10 ++ src/i18n/en/screens/sharedAnnouncements.ts | 10 ++ src/i18n/en/screens/sharedCompose.ts | 144 ++++++++++++++++ src/i18n/en/screens/sharedRelationships.ts | 8 + src/i18n/en/screens/sharedSearch.ts | 31 ++++ src/i18n/en/screens/sharedToot.ts | 3 + src/i18n/i18n.ts | 5 +- src/i18n/zh-Hans/components/instance.ts | 4 +- src/i18n/zh-Hans/components/relativeTime.ts | 5 +- src/i18n/zh-Hans/components/timeline.ts | 8 +- src/i18n/zh-Hans/screens/meListsList.ts | 2 +- src/i18n/zh-Hans/screens/meRoot.ts | 1 - .../zh-Hans/screens/meSettingsUpdateRemote.ts | 2 +- src/i18n/zh-Hans/screens/meSwitch.ts | 2 +- src/i18n/zh-Hans/screens/public.ts | 2 +- src/i18n/zh-Hans/screens/sharedAccount.ts | 2 +- src/i18n/zh-Hans/screens/sharedCompose.ts | 14 +- src/i18n/zh-Hans/screens/sharedSearch.ts | 3 +- src/i18n/zh-Hans/system.json | 4 + src/screens/Me/Settings.tsx | 12 ++ src/screens/Shared/Account/Information.tsx | 6 +- .../Shared/Account/Information/Account.tsx | 7 +- src/startup/checkSecureStorageVersion.ts | 41 ----- src/startup/sentry.ts | 8 +- src/utils/slices/instancesSlice.ts | 10 +- tsconfig.json | 3 +- yarn.lock | 5 + 57 files changed, 826 insertions(+), 191 deletions(-) create mode 100644 .github/workflows/production.yml create mode 100644 .github/workflows/staging.yml create mode 100644 src/i18n/en/components/instance.ts create mode 100644 src/i18n/en/components/parse.ts create mode 100644 src/i18n/en/components/relationship.ts create mode 100644 src/i18n/en/components/timeline.ts create mode 100644 src/i18n/en/screens/local.ts create mode 100644 src/i18n/en/screens/meBookmarks.ts create mode 100644 src/i18n/en/screens/meConversations.ts create mode 100644 src/i18n/en/screens/meFavourites.ts create mode 100644 src/i18n/en/screens/meLists.ts create mode 100644 src/i18n/en/screens/meListsList.ts create mode 100644 src/i18n/en/screens/meRoot.ts create mode 100644 src/i18n/en/screens/meSettings.ts create mode 100644 src/i18n/en/screens/meSettingsUpdateRemote.ts create mode 100644 src/i18n/en/screens/meSwitch.ts create mode 100644 src/i18n/en/screens/notifications.ts create mode 100644 src/i18n/en/screens/public.ts create mode 100644 src/i18n/en/screens/sharedAccount.ts create mode 100644 src/i18n/en/screens/sharedAnnouncements.ts create mode 100644 src/i18n/en/screens/sharedCompose.ts create mode 100644 src/i18n/en/screens/sharedRelationships.ts create mode 100644 src/i18n/en/screens/sharedSearch.ts create mode 100644 src/i18n/en/screens/sharedToot.ts create mode 100644 src/i18n/zh-Hans/system.json delete mode 100644 src/startup/checkSecureStorageVersion.ts diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml new file mode 100644 index 00000000..dc21be1c --- /dev/null +++ b/.github/workflows/production.yml @@ -0,0 +1,28 @@ +name: Publish production +on: + push: + branches: + - main +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: -- Step 1 -- Checkout code + uses: actions/checkout@v2 + - name: -- Step 2 -- Setup node + uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: -- Step 3 -- Use Expo action + uses: expo/expo-github-action@v5 + with: + expo-version: 4.x + expo-username: ${{ secrets.EXPO_USERNAME }} + expo-token: ${{ secrets.EXPO_TOKEN }} + expo-cache: true + - name: -- Step 4 -- Install dependencies + run: yarn install + - name: -- Step 5 -- Publish + env: + SENTRY_DEPLOY_ENV: production + run: expo publish --release-channel=production diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 00000000..6ac384a2 --- /dev/null +++ b/.github/workflows/staging.yml @@ -0,0 +1,28 @@ +name: Publish staging +on: + push: + branches: + - staging +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: -- Step 1 -- Checkout code + uses: actions/checkout@v2 + - name: -- Step 2 -- Setup node + uses: actions/setup-node@v2 + with: + node-version: 14.x + - name: -- Step 3 -- Use Expo action + uses: expo/expo-github-action@v5 + with: + expo-version: 4.x + expo-username: ${{ secrets.EXPO_USERNAME }} + expo-token: ${{ secrets.EXPO_TOKEN }} + expo-cache: true + - name: -- Step 4 -- Install dependencies + run: yarn install + - name: -- Step 5 -- Publish + env: + SENTRY_DEPLOY_ENV: staging + run: expo publish --release-channel=staging diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8c96acfb..6572cb50 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -24,7 +24,5 @@ jobs: run: yarn install - name: -- Step 5 -- Publish env: - SENTRY_ORG: ${{ secrets.SENTRY_ORG }} - SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} - SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + SENTRY_DEPLOY_ENV: testing run: expo publish --release-channel=testing diff --git a/app.config.ts b/app.config.ts index 457dda2f..082a9130 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,4 +1,5 @@ import { ExpoConfig } from '@expo/config' +import 'dotenv/config' export default (): ExpoConfig => ({ name: 'tooot', @@ -30,24 +31,31 @@ export default (): ExpoConfig => ({ googleServicesFile: './configs/google-services.json', permissions: ['CAMERA', 'VIBRATE'] }, - // locales: { - // zh: { - // CFBundleDisplayName: '嘟嘟嘟', - // NSCameraUsageDescription: '允许嘟嘟嘟用相机上传照片', - // NSPhotoLibraryUsageDescription: '允许嘟嘟嘟用相册上传照片' - // }, - // en: { - // CFBundleDisplayName: 'tooot' - // } - // }, + locales: { + zh: './src/i18n/zh-Hans/system.json' + // en: { + // NSCameraUsageDescription: '允许嘟嘟嘟用相机上传照片', + // NSPhotoLibraryUsageDescription: '允许嘟嘟嘟用相册上传照片' + // } + }, assetBundlePatterns: ['assets/*'], hooks: { postPublish: [ { - file: 'sentry-expo/upload-sourcemaps' + file: 'sentry-expo/upload-sourcemaps', + config: { + organization: process.env.SENTRY_ORGANIZATION, + project: process.env.SENTRY_PROJECT, + authToken: process.env.SENTRY_AUTH_TOKEN, + setCommits: process.env.GITHUB_SHA || undefined, + deployEnv: process.env.SENTRY_DEPLOY_ENV + } } ] }, + extra: { + sentryDSN: process.env.SENTRY_DSN + }, web: { config: { firebase: { diff --git a/package.json b/package.json index 4c3ae5b6..5886b0de 100644 --- a/package.json +++ b/package.json @@ -99,6 +99,7 @@ "@welldone-software/why-did-you-render": "^6.0.4", "babel-plugin-module-resolver": "^4.1.0", "chalk": "^4.1.0", + "dotenv": "^8.2.0", "jest": "^26.6.3", "jest-expo": "^40.0.1", "nock": "^13.0.5", diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index bf4ab449..4969ac76 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -106,7 +106,7 @@ const GracefullyImage: React.FC = ({ } return } catch (error) { - if (__DEV__) console.warn('Image preview', error) + if (__DEV__) console.warn('Image', error) } } diff --git a/src/components/Instance.tsx b/src/components/Instance.tsx index 0320a2f8..4e827452 100644 --- a/src/components/Instance.tsx +++ b/src/components/Instance.tsx @@ -96,7 +96,10 @@ const ComponentInstance: React.FC = ({ 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 = ({ potentialWidth={4} /> - - - Linking.openURL('https://tooot.app/privacy')} - > - {t('server.disclaimer')} - - https://tooot.app/privacy + {type === 'local' ? ( + + + Linking.openURL('https://tooot.app/privacy')} + > + {t('server.disclaimer')} + + https://tooot.app/privacy + - - + + ) : null} diff --git a/src/components/Relationship/Outgoing.tsx b/src/components/Relationship/Outgoing.tsx index 31bd92ee..f7aae76a 100644 --- a/src/components/Relationship/Outgoing.tsx +++ b/src/components/Relationship/Outgoing.tsx @@ -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( queryKeyRelationship, [res] ) + if (action === 'follow' || action === 'block') { + const queryKey: QueryKeyTimeline = ['Timeline', { page: 'Following' }] + queryClient.invalidateQueries(queryKey) + } }, onError: (err: any, { payload: { action } }) => { haptics('Error') diff --git a/src/components/Timelines/Timeline.tsx b/src/components/Timelines/Timeline.tsx index 3ab93007..36783101 100644 --- a/src/components/Timelines/Timeline.tsx +++ b/src/components/Timelines/Timeline.tsx @@ -68,7 +68,7 @@ const Timeline: React.FC = ({ ...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 = ({ : 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 = ({ (isFetching && !isFetchingNextPage && !isLoading) } onRefresh={() => { - if (hasPreviousPage) { - fetchPreviousPage() - } else { - queryClient.setQueryData | undefined>( - queryKey, - data => { - if (data) { - return { - pages: data.pages.slice(1), - pageParams: data.pageParams.slice(1) - } - } - } - ) - refetch() - } + // if (hasPreviousPage) { + // fetchPreviousPage() + // } else { + // queryClient.setQueryData | undefined>( + // queryKey, + // data => { + // if (data) { + // return { + // pages: data.pages.slice(1), + // pageParams: data.pageParams.slice(1) + // } + // } + // } + // ) + refetch() + // } }} /> ), diff --git a/src/components/Timelines/Timeline/Shared/Actions.tsx b/src/components/Timelines/Timeline/Shared/Actions.tsx index cb3f2bec..dd5e9f2e 100644 --- a/src/components/Timelines/Timeline/Shared/Actions.tsx +++ b/src/components/Timelines/Timeline/Shared/Actions.tsx @@ -169,27 +169,53 @@ const TimelineActions: React.FC = ({ queryKey, status, reblog }) => { ) const childrenReblog = useMemo( () => ( - + <> + + {status.reblogs_count > 0 && ( + + {status.reblogs_count} + + )} + ), - [status.reblogged] + [status.reblogged, status.reblogs_count] ) const childrenFavourite = useMemo( () => ( - + <> + + {status.favourites_count > 0 && ( + + {status.favourites_count} + + )} + ), - [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 } }) diff --git a/src/components/Timelines/Timeline/Shared/HeaderActions/Account.tsx b/src/components/Timelines/Timeline/Shared/HeaderActions/Account.tsx index e4f2c3a8..5fe9af9d 100644 --- a/src/components/Timelines/Timeline/Shared/HeaderActions/Account.tsx +++ b/src/components/Timelines/Timeline/Shared/HeaderActions/Account.tsx @@ -41,10 +41,7 @@ const HeaderActionsAccount: React.FC = ({ 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 = ({ return ( - + { setBottomSheetVisible(false) @@ -91,12 +86,9 @@ const HeaderActionsAccount: React.FC = ({ }) }} iconFront='XCircle' - title={t( - 'shared.header.actions.account.block.button', - { - acct: account.acct - } - )} + title={t('shared.header.actions.account.block.button', { + acct: account.acct + })} /> { @@ -109,12 +101,9 @@ const HeaderActionsAccount: React.FC = ({ }) }} iconFront='Flag' - title={t( - 'shared.header.actions.account.reports.button', - { - acct: account.acct - } - )} + title={t('shared.header.actions.account.reports.button', { + acct: account.acct + })} /> ) diff --git a/src/components/Timelines/Timeline/Shared/Poll.tsx b/src/components/Timelines/Timeline/Shared/Poll.tsx index 5163871b..009d5bde 100644 --- a/src/components/Timelines/Timeline/Shared/Poll.tsx +++ b/src/components/Timelines/Timeline/Shared/Poll.tsx @@ -128,7 +128,7 @@ const TimelinePoll: React.FC = ({ return ( ]} /> diff --git a/src/i18n/en/_all.ts b/src/i18n/en/_all.ts index aa492a0c..361f022b 100644 --- a/src/i18n/en/_all.ts +++ b/src/i18n/en/_all.ts @@ -1,5 +1,32 @@ export default { common: require('./common').default, + local: require('./screens/local').default, + + public: require('./screens/public').default, + + notifications: require('./screens/notifications').default, + + meRoot: require('./screens/meRoot').default, + meConversations: require('./screens/meConversations').default, + meBookmarks: require('./screens/meBookmarks').default, + meFavourites: require('./screens/meFavourites').default, + meLists: require('./screens/meLists').default, + meListsList: require('./screens/meListsList').default, + meSettings: require('./screens/meSettings').default, + meSettingsUpdateRemote: require('./screens/meSettingsUpdateRemote').default, + meSwitch: require('./screens/meSwitch').default, + + sharedAccount: require('./screens/sharedAccount').default, + sharedAnnouncements: require('./screens/sharedAnnouncements').default, + sharedCompose: require('./screens/sharedCompose').default, + sharedRelationships: require('./screens/sharedRelationships').default, + sharedSearch: require('./screens/sharedSearch').default, + sharedToot: require('./screens/sharedToot').default, + + componentInstance: require('./components/instance').default, + componentParse: require('./components/parse').default, + componentRelationship: require('./components/relationship').default, componentRelativeTime: require('./components/relativeTime').default, + componentTimeline: require('./components/timeline').default } diff --git a/src/i18n/en/common.ts b/src/i18n/en/common.ts index 43602fbe..0da0ea0a 100644 --- a/src/i18n/en/common.ts +++ b/src/i18n/en/common.ts @@ -1,31 +1,16 @@ export default { - headers: { - local: { - segments: { - left: 'Following', - right: 'Local' - } + buttons: { + cancel: 'Cancel' + }, + toastMessage: { + success: { + message: '{{function}} succeed' }, - public: { - segments: { - left: 'Federated', - right: 'Others' - } + warning: { + message: '' }, - notifications: 'Notifications', - me: { - root: 'My Mastodon', - conversations: 'Messages', - bookmarks: 'Booksmarks', - favourites: 'Favourites', - lists: { - root: 'Lists', - list: 'List {{list}}' - }, - settings: { - root: 'Settings', - language: 'Language' - } + error: { + message: '{{function}} failed, please retry' } } } diff --git a/src/i18n/en/components/instance.ts b/src/i18n/en/components/instance.ts new file mode 100644 index 00000000..a64ec33d --- /dev/null +++ b/src/i18n/en/components/instance.ts @@ -0,0 +1,34 @@ +export default { + server: { + textInput: { placeholder: "Instance' domain" }, + button: { + local: 'Login', + remote: 'Peep' + }, + information: { + name: 'Name', + description: { heading: 'Description', expandHint: 'description' }, + accounts: 'Users', + statuses: 'Toots', + domains: 'Universes' + }, + disclaimer: + "Logging in process uses system broswer that, your account informationo won't be visible to tooot app. Read more at: " + }, + update: { + local: { + alert: { + title: 'Logged in to this instance', + message: + 'You can login to another account, keeping existing logged in account', + buttons: { + cancel: '$t(common:buttons.cancel)', + continue: 'Continue' + } + } + }, + remote: { + succeed: 'Register peeping succeed' + } + } +} diff --git a/src/i18n/en/components/parse.ts b/src/i18n/en/components/parse.ts new file mode 100644 index 00000000..5a56b039 --- /dev/null +++ b/src/i18n/en/components/parse.ts @@ -0,0 +1,8 @@ +export default { + HTML: { + expanded: { + true: 'Fold {{hint}}', + false: 'Expand {{hint}}' + } + } +} diff --git a/src/i18n/en/components/relationship.ts b/src/i18n/en/components/relationship.ts new file mode 100644 index 00000000..d9b34721 --- /dev/null +++ b/src/i18n/en/components/relationship.ts @@ -0,0 +1,16 @@ +export default { + follow: { + function: 'Follow user' + }, + block: { + function: 'Block user' + }, + button: { + error: 'Loading error', + blocked_by: 'Blocked by user', + blocking: 'Unblock', + following: 'Unfollow', + requested: 'Withdraw request', + default: 'Follow' + } +} diff --git a/src/i18n/en/components/timeline.ts b/src/i18n/en/components/timeline.ts new file mode 100644 index 00000000..73ffae24 --- /dev/null +++ b/src/i18n/en/components/timeline.ts @@ -0,0 +1,155 @@ +export default { + empty: { + error: { + message: 'Loading error', + button: 'Retry' + }, + success: { + message: 'Timeline empty' + } + }, + end: { + message: 'The end, what about a cup of <0 />' + }, + header: { + explanation: + 'External instance might not be known to logged in instance, thus actions are not allowed but only for reading. You can switch to any instance in the settings.', + button: 'Go to settings' + }, + shared: { + actioned: { + pinned: 'Pinned', + favourite: '{{name}} favourited your toot', + status: '{{name}} just posted', + follow: '{{name}} followed you', + follow_request: '{{name}} requested following you', + poll: 'A poll you have voted in has ended', + reblog: { + default: '{{name}} boosted', + notification: '{{name}} boosted your toot' + } + }, + actions: { + favourited: { + function: 'Favourite toot' + }, + reblogged: { + function: 'Boost toot' + }, + bookmarked: { + function: 'Bookmark toot' + } + }, + attachment: { + sensitive: { + button: 'Show sensitive media' + }, + unsupported: { + text: 'Loading error', + button: 'Try remote link' + } + }, + content: { + expandHint: 'hidden content' + }, + header: { + shared: { + application: 'Tooted with {{application}}' + }, + conversation: { + delete: { + function: 'Delete direct message' + } + }, + actions: { + account: { + heading: 'About user', + mute: { + function: 'Mute user', + button: 'Mute @{{acct}}' + }, + block: { + function: 'Block user', + button: 'Block @{{acct}}' + }, + reports: { + function: 'Report user', + button: 'Report @{{acct}}' + } + }, + domain: { + heading: 'About instance', + block: { + function: 'Block instance', + button: 'Block instance {{domain}}' + }, + alert: { + title: 'Confirm blocking {{domain}} ?', + message: + 'Mostly you can mute or block certain user.\n\nAfter blocking instance, all its content including followers from this instance will be removed!', + buttons: { + confirm: 'Confirm blocking', + cancel: '$t(common:buttons.cancel)' + } + } + }, + share: { + status: { heading: 'Share toot', button: 'Share link to this toot' }, + account: { heading: 'Share user', button: 'Share link to this user' } + }, + status: { + heading: 'About toot', + delete: { + function: 'Delete toot', + button: 'Delete this toot' + }, + edit: { + function: 'Delete toot', + button: 'Delete and re-draft', + alert: { + title: 'Confirm deleting toot?', + message: + 'Are you sure to delete and re-draft this toot? All boosts and favourites will be cleared, including all replies.', + buttons: { + confirm: 'Confirm deleting', + cancel: '$t(common:buttons.cancel)' + } + } + }, + mute: { + function: 'Mute toot', + button: { + positive: 'Mute this toot and replies', + negative: 'Unmute this toot and replies' + } + }, + pin: { + function: 'Pin', + button: { + positive: 'Pin this toot', + negative: 'Unpin this toot' + } + } + } + } + }, + poll: { + meta: { + button: { + vote: 'Vote', + refresh: 'Refresh' + }, + count: { + voters: '{{count}} user voted • ', + voters_plural: '{{count}} users voted • ', + votes: '{{count}} vote • ', + votes_plural: '{{count}} votes • ' + }, + expiration: { + expired: 'Vote expired', + until: 'Open until <0 />' + } + } + } + } +} diff --git a/src/i18n/en/screens/local.ts b/src/i18n/en/screens/local.ts new file mode 100644 index 00000000..e45b4306 --- /dev/null +++ b/src/i18n/en/screens/local.ts @@ -0,0 +1,8 @@ +export default { + heading: { + segments: { + left: 'Following', + right: 'Local' + } + } +} diff --git a/src/i18n/en/screens/meBookmarks.ts b/src/i18n/en/screens/meBookmarks.ts new file mode 100644 index 00000000..6320935a --- /dev/null +++ b/src/i18n/en/screens/meBookmarks.ts @@ -0,0 +1,4 @@ +export default { + heading: 'Bookmarks', + content: {} +} diff --git a/src/i18n/en/screens/meConversations.ts b/src/i18n/en/screens/meConversations.ts new file mode 100644 index 00000000..d05bb3cd --- /dev/null +++ b/src/i18n/en/screens/meConversations.ts @@ -0,0 +1,4 @@ +export default { + heading: 'Direct messages', + content: {} +} diff --git a/src/i18n/en/screens/meFavourites.ts b/src/i18n/en/screens/meFavourites.ts new file mode 100644 index 00000000..66cb2953 --- /dev/null +++ b/src/i18n/en/screens/meFavourites.ts @@ -0,0 +1,4 @@ +export default { + heading: 'Favourites', + content: {} +} diff --git a/src/i18n/en/screens/meLists.ts b/src/i18n/en/screens/meLists.ts new file mode 100644 index 00000000..f95beb75 --- /dev/null +++ b/src/i18n/en/screens/meLists.ts @@ -0,0 +1,4 @@ +export default { + heading: 'Lists', + content: {} +} diff --git a/src/i18n/en/screens/meListsList.ts b/src/i18n/en/screens/meListsList.ts new file mode 100644 index 00000000..c27c6629 --- /dev/null +++ b/src/i18n/en/screens/meListsList.ts @@ -0,0 +1,4 @@ +export default { + heading: 'List: {{list}}', + content: {} +} diff --git a/src/i18n/en/screens/meRoot.ts b/src/i18n/en/screens/meRoot.ts new file mode 100644 index 00000000..a2dadbe2 --- /dev/null +++ b/src/i18n/en/screens/meRoot.ts @@ -0,0 +1,29 @@ +export default { + content: { + collections: { + conversations: '$t(meConversations:heading)', + bookmarks: '$t(meBookmarks:heading)', + favourites: '$t(meFavourites:heading)', + lists: '$t(meLists:heading)', + announcements: { + heading: '$t(sharedAnnouncements:heading)', + content: { + unread: '{{amount}} unread', + read: 'all read' + } + } + }, + settings: '$t(meSettings:heading)', + logout: { + button: 'Log out', + alert: { + title: 'Logging out?', + message: 'After logging out, you need to log in again', + buttons: { + logout: 'Logout', + cancel: '$t(common:buttons.cancel)' + } + } + } + } +} diff --git a/src/i18n/en/screens/meSettings.ts b/src/i18n/en/screens/meSettings.ts new file mode 100644 index 00000000..130b121f --- /dev/null +++ b/src/i18n/en/screens/meSettings.ts @@ -0,0 +1,49 @@ +export default { + heading: 'Settings', + content: { + language: { + heading: 'Language', + options: { + en: 'English', + 'zh-Hans': '简体中文', + cancel: '$t(common:buttons.cancel)' + } + }, + theme: { + heading: 'Appearance', + options: { + auto: 'As system', + light: 'Light mode', + dark: 'Dark mode', + cancel: '$t(common:buttons.cancel)' + } + }, + browser: { + heading: 'Opening link', + options: { + internal: 'Inside app', + external: 'Use system browser', + cancel: '$t(common:buttons.cancel)' + } + }, + remote: { + heading: '$t(meSettingsUpdateRemote:heading)', + description: 'External instance can only be read' + }, + cache: { + heading: 'Clear cache', + empty: 'Cache empty' + }, + support: { + heading: 'Support tooot' + }, + review: { + heading: 'Review tooot' + }, + analytics: { + heading: 'Help us improve', + description: 'Collecting only non-user relative usage' + }, + version: 'Version v{{version}}' + } +} diff --git a/src/i18n/en/screens/meSettingsUpdateRemote.ts b/src/i18n/en/screens/meSettingsUpdateRemote.ts new file mode 100644 index 00000000..d21747d0 --- /dev/null +++ b/src/i18n/en/screens/meSettingsUpdateRemote.ts @@ -0,0 +1,3 @@ +export default { + heading: 'Register external instance' +} diff --git a/src/i18n/en/screens/meSwitch.ts b/src/i18n/en/screens/meSwitch.ts new file mode 100644 index 00000000..39abf287 --- /dev/null +++ b/src/i18n/en/screens/meSwitch.ts @@ -0,0 +1,7 @@ +export default { + heading: 'Switch account', + content: { + existing: 'Choose from logged in', + new: 'Log in to instance' + } +} diff --git a/src/i18n/en/screens/notifications.ts b/src/i18n/en/screens/notifications.ts new file mode 100644 index 00000000..b30e6022 --- /dev/null +++ b/src/i18n/en/screens/notifications.ts @@ -0,0 +1,3 @@ +export default { + heading: 'Notifications' +} diff --git a/src/i18n/en/screens/public.ts b/src/i18n/en/screens/public.ts new file mode 100644 index 00000000..1533b6c7 --- /dev/null +++ b/src/i18n/en/screens/public.ts @@ -0,0 +1,8 @@ +export default { + heading: { + segments: { + left: 'Federated', + right: 'External' + } + } +} diff --git a/src/i18n/en/screens/sharedAccount.ts b/src/i18n/en/screens/sharedAccount.ts new file mode 100644 index 00000000..e195638c --- /dev/null +++ b/src/i18n/en/screens/sharedAccount.ts @@ -0,0 +1,10 @@ +export default { + content: { + created_at: 'Registered: {{date}}', + summary: { + statuses_count: '{{count}} toots', + following_count: 'Following {{count}}', + followers_count: '{{count}} followers' + } + } +} diff --git a/src/i18n/en/screens/sharedAnnouncements.ts b/src/i18n/en/screens/sharedAnnouncements.ts new file mode 100644 index 00000000..2653d902 --- /dev/null +++ b/src/i18n/en/screens/sharedAnnouncements.ts @@ -0,0 +1,10 @@ +export default { + heading: 'Announcements', + content: { + published: 'Published <0 />', + button: { + read: 'Read', + unread: 'Mark read' + } + } +} diff --git a/src/i18n/en/screens/sharedCompose.ts b/src/i18n/en/screens/sharedCompose.ts new file mode 100644 index 00000000..8cf5c0f1 --- /dev/null +++ b/src/i18n/en/screens/sharedCompose.ts @@ -0,0 +1,144 @@ +export default { + heading: { + left: { + button: 'Cancel', + alert: { + title: 'Cancel editing?', + buttons: { + exit: 'Confirm', + continue: 'Continue' + } + } + }, + right: { + button: { + default: 'Toot', + conversation: 'Toot DM', + reply: 'Toot reply', + edit: 'Toot' + }, + alert: { + title: 'Tooting failed', + button: 'Try again' + } + } + }, + content: { + root: { + header: { + postingAs: 'Tooting as @{{acct}}@{{domain}}', + spoilerInput: { + placeholder: 'Spoiler warning message' + }, + textInput: { + placeholder: "What's on your mind" + } + }, + footer: { + attachments: { + sensitive: 'Mark attachments as sensitive' + }, + poll: { + option: { + placeholder: { + single: 'Single choice', + multiple: 'Multiple choice' + } + }, + multiple: { + heading: 'Choice type', + options: { + single: 'Single choice', + multiple: 'Multiple choice', + cancel: '$t(common:buttons.cancel)' + } + }, + expiration: { + heading: 'Validity', + options: { + '300': '5 minutes', + '1800': '30 minutes', + '3600': '1 hour', + '21600': '6 hours', + '86400': '1 day', + '259200': '3 days', + '604800': '7 days', + cancel: '$t(common:buttons.cancel)' + } + } + } + }, + actions: { + attachment: { + actions: { + options: { + library: 'Upload from photo library', + photo: 'Upload with camera', + cancel: '$t(common:buttons.cancel)' + }, + library: { + alert: { + title: 'No permission', + message: 'Require photo library read permission to upload', + buttons: { + settings: 'Update setting', + cancel: 'Cancel' + } + } + }, + photo: { + alert: { + title: 'No permission', + message: 'Require camera usage permission to upload', + buttons: { + settings: 'Update setting', + cancel: 'Cancel' + } + } + } + }, + failed: { + alert: { + title: 'Upload failed', + button: 'Try again' + } + } + }, + visibility: { + title: 'Toot visibility', + options: { + public: 'Public', + unlisted: 'Unlisted', + private: 'Followers only', + direct: 'Direct message', + cancel: '$t(common:buttons.cancel)' + } + } + } + }, + editAttachment: { + header: { + left: 'Cancel', + right: { + button: 'Apply', + succeed: { + title: 'Apply update succeed', + button: 'Ok' + }, + failed: { + title: 'Apply update failed', + button: 'Try again' + } + } + }, + content: { + altText: { + heading: 'Describe media for the visually impaired', + placeholder: + 'You can add a description, sometimes called alt-text, to your media so they are accessible to even more people, including those who are blind or visually impaired.\n\nGood descriptions are concise, but present what is in your media accurately enough to understand their context.' + }, + imageFocus: 'Drag the focus circle to update focus point' + } + } + } +} diff --git a/src/i18n/en/screens/sharedRelationships.ts b/src/i18n/en/screens/sharedRelationships.ts new file mode 100644 index 00000000..24a7b3e3 --- /dev/null +++ b/src/i18n/en/screens/sharedRelationships.ts @@ -0,0 +1,8 @@ +export default { + heading: { + segments: { + left: 'Following', + right: 'Followers' + } + } +} diff --git a/src/i18n/en/screens/sharedSearch.ts b/src/i18n/en/screens/sharedSearch.ts new file mode 100644 index 00000000..425182cb --- /dev/null +++ b/src/i18n/en/screens/sharedSearch.ts @@ -0,0 +1,31 @@ +export default { + content: { + header: { + prefix: 'Search', + placeholder: 'for...' + }, + empty: { + general: + 'Enter keyword to search for $t(sharedSearch:content.sections.accounts)$t(sharedSearch:content.sections.hashtags) or $t(sharedSearch:content.sections.statuses)', + advanced: { + header: 'Advanced search', + example: { + account: + '$t(sharedSearch:content.header.prefix)$t(sharedSearch:content.sections.accounts)', + hashtag: + '$t(sharedSearch:content.header.prefix)$t(sharedSearch:content.sections.hashtags)', + statusLink: + '$t(sharedSearch:content.header.prefix)$t(sharedSearch:content.sections.statuses)', + accountLink: + '$t(sharedSearch:content.header.prefix)$t(sharedSearch:content.sections.accounts)' + } + } + }, + sections: { + accounts: 'User', + hashtags: 'Hashtag', + statuses: 'Toot' + }, + notFound: 'Cannot find {{searchTerm}} related {{type}}' + } +} diff --git a/src/i18n/en/screens/sharedToot.ts b/src/i18n/en/screens/sharedToot.ts new file mode 100644 index 00000000..7b3f89bb --- /dev/null +++ b/src/i18n/en/screens/sharedToot.ts @@ -0,0 +1,3 @@ +export default { + heading: 'Direct messages' +} diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index b9af5002..eaac9437 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -17,11 +17,10 @@ i18next.use(initReactI18next).init({ resources: { 'zh-Hans': zh_Hans, en }, saveMissing: true, - missingKeyHandler: (lng, ns, key, fallbackValue) => { - console.log('i18n missing: ' + lng + ' - ' + ns + ' : ' + key) + missingKeyHandler: (ns, key) => { + console.log('i18n missing: ' + ns + ' : ' + key) }, - // react options interpolation: { escapeValue: false } diff --git a/src/i18n/zh-Hans/components/instance.ts b/src/i18n/zh-Hans/components/instance.ts index b7387206..6ad3c05a 100644 --- a/src/i18n/zh-Hans/components/instance.ts +++ b/src/i18n/zh-Hans/components/instance.ts @@ -13,13 +13,13 @@ export default { domains: '连结总数' }, disclaimer: - '登录过程将使用系统浏览器,您的账户登录信息tooot应用无法读取。详见:' + '登录过程将使用系统浏览器,你的账号登录信息tooot应用无法读取。详见:' }, update: { local: { alert: { title: '此社区已登录', - message: '您可以登录同个社区的另一个账户,不影响现有账户', + message: '你可以登录同个社区的另一个账号,不影响已登录的账号', buttons: { cancel: '$t(common:buttons.cancel)', continue: '继续' diff --git a/src/i18n/zh-Hans/components/relativeTime.ts b/src/i18n/zh-Hans/components/relativeTime.ts index 2cb6d180..71c00f36 100644 --- a/src/i18n/zh-Hans/components/relativeTime.ts +++ b/src/i18n/zh-Hans/components/relativeTime.ts @@ -2,8 +2,8 @@ export default { strings: { prefixAgo: null, prefixFromNow: null, - suffixAgo: '之前', - suffixFromNow: '之后', + suffixAgo: '前', + suffixFromNow: '后', seconds: '%d秒', minute: '1分钟', minutes: '%d分钟', @@ -15,7 +15,6 @@ export default { months: '%d月', year: '大约1年', years: '%d年', - wordSeparator: '' } } diff --git a/src/i18n/zh-Hans/components/timeline.ts b/src/i18n/zh-Hans/components/timeline.ts index 8782d2e3..d8c9e4f8 100644 --- a/src/i18n/zh-Hans/components/timeline.ts +++ b/src/i18n/zh-Hans/components/timeline.ts @@ -19,14 +19,14 @@ export default { shared: { actioned: { pinned: '置顶', - favourite: '{{name}} 喜欢了你的嘟嘟', + favourite: '{{name}} 喜欢了你的嘟文', status: '{{name}} 刚刚发嘟', follow: '{{name}} 开始关注你', - follow_request: '{{name}} 请求关注', - poll: '您参与的投票已结束', + follow_request: '{{name}} 请求关注你', + poll: '你参与的投票已结束', reblog: { default: '{{name}} 转嘟了', - notification: '{{name}} 转嘟了您的嘟文' + notification: '{{name}} 转嘟了你的嘟文' } }, actions: { diff --git a/src/i18n/zh-Hans/screens/meListsList.ts b/src/i18n/zh-Hans/screens/meListsList.ts index c7e9c903..aaa55a97 100644 --- a/src/i18n/zh-Hans/screens/meListsList.ts +++ b/src/i18n/zh-Hans/screens/meListsList.ts @@ -1,4 +1,4 @@ export default { - heading: '列表 {{list}}', + heading: '列表:{{list}}', content: {} } diff --git a/src/i18n/zh-Hans/screens/meRoot.ts b/src/i18n/zh-Hans/screens/meRoot.ts index 4f23fc83..5a7ebdcc 100644 --- a/src/i18n/zh-Hans/screens/meRoot.ts +++ b/src/i18n/zh-Hans/screens/meRoot.ts @@ -1,5 +1,4 @@ export default { - heading: '我的长毛象', content: { collections: { conversations: '$t(meConversations:heading)', diff --git a/src/i18n/zh-Hans/screens/meSettingsUpdateRemote.ts b/src/i18n/zh-Hans/screens/meSettingsUpdateRemote.ts index abc0beba..7b514be9 100644 --- a/src/i18n/zh-Hans/screens/meSettingsUpdateRemote.ts +++ b/src/i18n/zh-Hans/screens/meSettingsUpdateRemote.ts @@ -1,3 +1,3 @@ export default { - heading: '外站社区' + heading: '围观社区' } diff --git a/src/i18n/zh-Hans/screens/meSwitch.ts b/src/i18n/zh-Hans/screens/meSwitch.ts index 125c7ef8..7f21a1cf 100644 --- a/src/i18n/zh-Hans/screens/meSwitch.ts +++ b/src/i18n/zh-Hans/screens/meSwitch.ts @@ -1,7 +1,7 @@ export default { heading: '切换账号', content: { - existing: '选择已有账号', + existing: '选择已登录的账号', new: '登录新社区' } } diff --git a/src/i18n/zh-Hans/screens/public.ts b/src/i18n/zh-Hans/screens/public.ts index 3ee9f781..8866683b 100644 --- a/src/i18n/zh-Hans/screens/public.ts +++ b/src/i18n/zh-Hans/screens/public.ts @@ -1,7 +1,7 @@ export default { heading: { segments: { - left: '跨站关注', + left: '跨站嘟嘟', right: '外站嘟嘟' } } diff --git a/src/i18n/zh-Hans/screens/sharedAccount.ts b/src/i18n/zh-Hans/screens/sharedAccount.ts index 86593968..95f3c2b2 100644 --- a/src/i18n/zh-Hans/screens/sharedAccount.ts +++ b/src/i18n/zh-Hans/screens/sharedAccount.ts @@ -1,6 +1,6 @@ export default { content: { - created_at: '加入时间:{{date}}', + created_at: '注册时间:{{date}}', summary: { statuses_count: '{{count}} 条嘟文', following_count: '关注 {{count}} 人', diff --git a/src/i18n/zh-Hans/screens/sharedCompose.ts b/src/i18n/zh-Hans/screens/sharedCompose.ts index 4e1945a1..02320331 100644 --- a/src/i18n/zh-Hans/screens/sharedCompose.ts +++ b/src/i18n/zh-Hans/screens/sharedCompose.ts @@ -26,17 +26,17 @@ export default { content: { root: { header: { - postingAs: '用 @{{acct}}@{{domain}} 发布', + postingAs: '以 @{{acct}}@{{domain}} 发嘟', spoilerInput: { placeholder: '折叠部分的警告信息' }, textInput: { - placeholder: '想说点什么' + placeholder: '想说点什么呢' } }, footer: { attachments: { - sensitive: '标记媒体为敏感内容' + sensitive: '标记附件为敏感内容' }, poll: { option: { @@ -79,9 +79,9 @@ export default { library: { alert: { title: '无读取权限', - message: '需要相片权限才能上传附件', + message: '需要读取相册权限才能上传附件', buttons: { - settings: '去系统设置', + settings: '去更新设置', cancel: '取消上传' } } @@ -89,9 +89,9 @@ export default { photo: { alert: { title: '无拍照权限', - message: '需要相机权限才能上传附件', + message: '需要使用相机权限才能上传附件', buttons: { - settings: '去系统设置', + settings: '去更新设置', cancel: '取消上传' } } diff --git a/src/i18n/zh-Hans/screens/sharedSearch.ts b/src/i18n/zh-Hans/screens/sharedSearch.ts index 39b616cc..1f669fd9 100644 --- a/src/i18n/zh-Hans/screens/sharedSearch.ts +++ b/src/i18n/zh-Hans/screens/sharedSearch.ts @@ -1,9 +1,8 @@ export default { - heading: '对话', content: { header: { prefix: '搜索', - placeholder: '些什么' + placeholder: '什么呢' }, empty: { general: diff --git a/src/i18n/zh-Hans/system.json b/src/i18n/zh-Hans/system.json new file mode 100644 index 00000000..637191f4 --- /dev/null +++ b/src/i18n/zh-Hans/system.json @@ -0,0 +1,4 @@ +{ + "NSCameraUsageDescription": "允许tooot使用相机拍摄上传附件", + "NSPhotoLibraryUsageDescription": "允许tooot读取相册上传附件" +} \ No newline at end of file diff --git a/src/screens/Me/Settings.tsx b/src/screens/Me/Settings.tsx index 1d5f6c25..85353d02 100644 --- a/src/screens/Me/Settings.tsx +++ b/src/screens/Me/Settings.tsx @@ -73,6 +73,18 @@ const DevDebug: React.FC = () => { destructive onPress={() => persistor.purge()} /> +