translate to primary language rather than just english (#814)
parent
1fc694d488
commit
88212eb065
|
@ -97,15 +97,17 @@ export const PostThreadItem = observer(function PostThreadItem({
|
|||
Toast.show('Copied to clipboard')
|
||||
}, [record])
|
||||
|
||||
const primaryLanguage = store.preferences.contentLanguages[0] || 'en'
|
||||
|
||||
const onOpenTranslate = React.useCallback(() => {
|
||||
Linking.openURL(
|
||||
encodeURI(
|
||||
`https://translate.google.com/?sl=auto&tl=en&text=${
|
||||
`https://translate.google.com/?sl=auto&tl=${primaryLanguage}&text=${
|
||||
record?.text || ''
|
||||
}`,
|
||||
),
|
||||
)
|
||||
}, [record])
|
||||
}, [record, primaryLanguage])
|
||||
|
||||
const onToggleThreadMute = React.useCallback(async () => {
|
||||
try {
|
||||
|
|
|
@ -167,15 +167,17 @@ const PostLoaded = observer(
|
|||
Toast.show('Copied to clipboard')
|
||||
}, [record])
|
||||
|
||||
const primaryLanguage = store.preferences.contentLanguages[0] || 'en'
|
||||
|
||||
const onOpenTranslate = React.useCallback(() => {
|
||||
Linking.openURL(
|
||||
encodeURI(
|
||||
`https://translate.google.com/?sl=auto&tl=en&text=${
|
||||
`https://translate.google.com/?sl=auto&tl=${primaryLanguage}&text=${
|
||||
record?.text || ''
|
||||
}`,
|
||||
),
|
||||
)
|
||||
}, [record])
|
||||
}, [record, primaryLanguage])
|
||||
|
||||
const onToggleThreadMute = React.useCallback(async () => {
|
||||
try {
|
||||
|
|
|
@ -97,15 +97,17 @@ export const FeedItem = observer(function ({
|
|||
Toast.show('Copied to clipboard')
|
||||
}, [record])
|
||||
|
||||
const primaryLanguage = store.preferences.contentLanguages[0] || 'en'
|
||||
|
||||
const onOpenTranslate = React.useCallback(() => {
|
||||
Linking.openURL(
|
||||
encodeURI(
|
||||
`https://translate.google.com/?sl=auto&tl=en&text=${
|
||||
`https://translate.google.com/?sl=auto&tl=${primaryLanguage}&text=${
|
||||
record?.text || ''
|
||||
}`,
|
||||
),
|
||||
)
|
||||
}, [record])
|
||||
}, [record, primaryLanguage])
|
||||
|
||||
const onToggleThreadMute = React.useCallback(async () => {
|
||||
track('FeedItem:ThreadMute')
|
||||
|
|
Loading…
Reference in New Issue