my fork of the bluesky client

Translate some missing strings via global i18n instance (#5740)

authored by samuel.fm and committed by

GitHub a445489b db7b875c

+13 -9
+5 -3
src/lib/media/picker.shared.ts
··· 3 3 launchImageLibraryAsync, 4 4 MediaTypeOptions, 5 5 } from 'expo-image-picker' 6 + // TODO: replace global i18n instance with one returned from useLingui -sfn 7 + import {t} from '@lingui/macro' 6 8 7 - import * as Toast from 'view/com/util/Toast' 9 + import * as Toast from '#/view/com/util/Toast' 8 10 import {getDataUriSize} from './util' 9 11 10 12 export async function openPicker(opts?: ImagePickerOptions) { ··· 17 19 }) 18 20 19 21 if (response.assets && response.assets.length > 4) { 20 - Toast.show('You may only select up to 4 images', 'exclamation-circle') 22 + Toast.show(t`You may only select up to 4 images`, 'exclamation-circle') 21 23 } 22 24 23 25 return (response.assets ?? []) 24 26 .slice(0, 4) 25 27 .filter(asset => { 26 28 if (asset.mimeType?.startsWith('image/')) return true 27 - Toast.show('Only image files are supported', 'exclamation-circle') 29 + Toast.show(t`Only image files are supported`, 'exclamation-circle') 28 30 return false 29 31 }) 30 32 .map(image => ({
+4 -2
src/lib/sharing.ts
··· 1 1 import {Share} from 'react-native' 2 2 // import * as Sharing from 'expo-sharing' 3 3 import {setStringAsync} from 'expo-clipboard' 4 + // TODO: replace global i18n instance with one returned from useLingui -sfn 5 + import {t} from '@lingui/macro' 4 6 5 - import {isAndroid, isIOS} from 'platform/detection' 7 + import {isAndroid, isIOS} from '#/platform/detection' 6 8 import * as Toast from '#/view/com/util/Toast' 7 9 8 10 /** ··· 20 22 // React Native Share is not supported by web. Web Share API 21 23 // has increasing but not full support, so default to clipboard 22 24 setStringAsync(url) 23 - Toast.show('Copied to clipboard', 'clipboard-check') 25 + Toast.show(t`Copied to clipboard`, 'clipboard-check') 24 26 } 25 27 }
+4 -4
src/view/com/util/forms/PostDropdownBtn.tsx
··· 268 268 item: postUri, 269 269 feedContext: postFeedContext, 270 270 }) 271 - Toast.show('Feedback sent!') 272 - }, [feedFeedback, postUri, postFeedContext]) 271 + Toast.show(_(msg`Feedback sent!`)) 272 + }, [feedFeedback, postUri, postFeedContext, _]) 273 273 274 274 const onPressShowLess = React.useCallback(() => { 275 275 feedFeedback.sendInteraction({ ··· 277 277 item: postUri, 278 278 feedContext: postFeedContext, 279 279 }) 280 - Toast.show('Feedback sent!') 281 - }, [feedFeedback, postUri, postFeedContext]) 280 + Toast.show(_(msg`Feedback sent!`)) 281 + }, [feedFeedback, postUri, postFeedContext, _]) 282 282 283 283 const onSelectChatToShareTo = React.useCallback( 284 284 (conversation: string) => {