about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-10-14 18:19:30 +0300
committerGitHub <noreply@github.com>2024-10-14 18:19:30 +0300
commita445489b53725f3c87f6fa43b904015e910dbfea (patch)
treec0ad930f53c7136ad0561c4b3b6398d78661caa5 /src
parentdb7b875c52b31a8c64859ca8e3e4c9e08c18f13e (diff)
downloadvoidsky-a445489b53725f3c87f6fa43b904015e910dbfea.tar.zst
Translate some missing strings via global i18n instance (#5740)
Diffstat (limited to 'src')
-rw-r--r--src/lib/media/picker.shared.ts8
-rw-r--r--src/lib/sharing.ts6
-rw-r--r--src/view/com/util/forms/PostDropdownBtn.tsx8
3 files changed, 13 insertions, 9 deletions
diff --git a/src/lib/media/picker.shared.ts b/src/lib/media/picker.shared.ts
index b959ce8be..a45bf5c0f 100644
--- a/src/lib/media/picker.shared.ts
+++ b/src/lib/media/picker.shared.ts
@@ -3,8 +3,10 @@ import {
   launchImageLibraryAsync,
   MediaTypeOptions,
 } from 'expo-image-picker'
+// TODO: replace global i18n instance with one returned from useLingui -sfn
+import {t} from '@lingui/macro'
 
-import * as Toast from 'view/com/util/Toast'
+import * as Toast from '#/view/com/util/Toast'
 import {getDataUriSize} from './util'
 
 export async function openPicker(opts?: ImagePickerOptions) {
@@ -17,14 +19,14 @@ export async function openPicker(opts?: ImagePickerOptions) {
   })
 
   if (response.assets && response.assets.length > 4) {
-    Toast.show('You may only select up to 4 images', 'exclamation-circle')
+    Toast.show(t`You may only select up to 4 images`, 'exclamation-circle')
   }
 
   return (response.assets ?? [])
     .slice(0, 4)
     .filter(asset => {
       if (asset.mimeType?.startsWith('image/')) return true
-      Toast.show('Only image files are supported', 'exclamation-circle')
+      Toast.show(t`Only image files are supported`, 'exclamation-circle')
       return false
     })
     .map(image => ({
diff --git a/src/lib/sharing.ts b/src/lib/sharing.ts
index a77b5ccca..c89d2d7a6 100644
--- a/src/lib/sharing.ts
+++ b/src/lib/sharing.ts
@@ -1,8 +1,10 @@
 import {Share} from 'react-native'
 // import * as Sharing from 'expo-sharing'
 import {setStringAsync} from 'expo-clipboard'
+// TODO: replace global i18n instance with one returned from useLingui -sfn
+import {t} from '@lingui/macro'
 
-import {isAndroid, isIOS} from 'platform/detection'
+import {isAndroid, isIOS} from '#/platform/detection'
 import * as Toast from '#/view/com/util/Toast'
 
 /**
@@ -20,6 +22,6 @@ export async function shareUrl(url: string) {
     // React Native Share is not supported by web. Web Share API
     // has increasing but not full support, so default to clipboard
     setStringAsync(url)
-    Toast.show('Copied to clipboard', 'clipboard-check')
+    Toast.show(t`Copied to clipboard`, 'clipboard-check')
   }
 }
diff --git a/src/view/com/util/forms/PostDropdownBtn.tsx b/src/view/com/util/forms/PostDropdownBtn.tsx
index dc66746fd..22751d8bf 100644
--- a/src/view/com/util/forms/PostDropdownBtn.tsx
+++ b/src/view/com/util/forms/PostDropdownBtn.tsx
@@ -268,8 +268,8 @@ let PostDropdownBtn = ({
       item: postUri,
       feedContext: postFeedContext,
     })
-    Toast.show('Feedback sent!')
-  }, [feedFeedback, postUri, postFeedContext])
+    Toast.show(_(msg`Feedback sent!`))
+  }, [feedFeedback, postUri, postFeedContext, _])
 
   const onPressShowLess = React.useCallback(() => {
     feedFeedback.sendInteraction({
@@ -277,8 +277,8 @@ let PostDropdownBtn = ({
       item: postUri,
       feedContext: postFeedContext,
     })
-    Toast.show('Feedback sent!')
-  }, [feedFeedback, postUri, postFeedContext])
+    Toast.show(_(msg`Feedback sent!`))
+  }, [feedFeedback, postUri, postFeedContext, _])
 
   const onSelectChatToShareTo = React.useCallback(
     (conversation: string) => {