···1111 ComAtprotoRepoStrongRef,
1212 RichText,
1313} from '@atproto/api'
1414+import {t} from '@lingui/macro'
1415import {QueryClient} from '@tanstack/react-query'
15161617import {isNetworkError} from '#/lib/strings/errors'
···5253 {cleanNewlines: true},
5354 )
54555555- opts.onStateChange?.('Processing...')
5656+ opts.onStateChange?.(t`Processing...`)
56575758 await rt.detectFacets(agent)
5859···102103103104 let res
104105 try {
105105- opts.onStateChange?.('Posting...')
106106+ opts.onStateChange?.(t`Posting...`)
106107 res = await agent.post({
107108 text: rt.text,
108109 facets: rt.facets,
···117118 })
118119 if (isNetworkError(e)) {
119120 throw new Error(
120120- 'Post failed to upload. Please check your Internet connection and try again.',
121121+ t`Post failed to upload. Please check your Internet connection and try again.`,
121122 )
122123 } else {
123124 throw e
···141142 safeMessage: e.message,
142143 })
143144 throw new Error(
144144- 'Failed to save post interaction settings. Your post was created but users may be able to interact with it.',
145145+ t`Failed to save post interaction settings. Your post was created but users may be able to interact with it.`,
145146 )
146147 }
147148 }
···166167 safeMessage: e.message,
167168 })
168169 throw new Error(
169169- 'Failed to save post interaction settings. Your post was created but users may be able to interact with it.',
170170+ t`Failed to save post interaction settings. Your post was created but users may be able to interact with it.`,
170171 )
171172 }
172173 }
···248249 logger.debug(`Uploading images`, {
249250 count: imagesDraft.length,
250251 })
251251- onStateChange?.(`Uploading images...`)
252252+ onStateChange?.(t`Uploading images...`)
252253 const images: AppBskyEmbedImages.Image[] = await Promise.all(
253254 imagesDraft.map(async (image, i) => {
254255 logger.debug(`Compressing image #${i}`)
···302303 )
303304 let blob: BlobRef | undefined
304305 if (resolvedGif.thumb) {
305305- onStateChange?.('Uploading link thumbnail...')
306306+ onStateChange?.(t`Uploading link thumbnail...`)
306307 const {path, mime} = resolvedGif.thumb.source
307308 const response = await uploadBlob(agent, path, mime)
308309 blob = response.data.blob
···326327 if (resolvedLink.type === 'external') {
327328 let blob: BlobRef | undefined
328329 if (resolvedLink.thumb) {
329329- onStateChange?.('Uploading link thumbnail...')
330330+ onStateChange?.(t`Uploading link thumbnail...`)
330331 const {path, mime} = resolvedLink.thumb.source
331332 const response = await uploadBlob(agent, path, mime)
332333 blob = response.data.blob
···352353): Promise<ComAtprotoRepoStrongRef.Main> {
353354 const resolvedLink = await fetchResolveLinkQuery(queryClient, agent, uri)
354355 if (resolvedLink.type !== 'record') {
355355- throw Error('Expected uri to resolve to a record')
356356+ throw Error(t`Expected uri to resolve to a record`)
356357 }
357358 return resolvedLink.record
358359}