Language settings updates, new primary language setting (#1471)

* move content languages to screen

* add dropdown library, style primary lang select

* update settings button

* show selected langauges in button

* use primary language in translator link

* update copy

* lint
This commit is contained in:
Eric Bailey 2023-09-21 13:33:19 -05:00 committed by GitHub
parent 335061f763
commit 8a5f9cd43d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 272 additions and 14 deletions

View file

@ -75,7 +75,10 @@ export const PostThreadItem = observer(function PostThreadItem({
}, [item.post.uri, item.post.author])
const repostsTitle = 'Reposts of this post'
const translatorUrl = getTranslatorLink(record?.text || '')
const translatorUrl = getTranslatorLink(
record?.text || '',
store.preferences.primaryLanguage,
)
const needsTranslation = useMemo(
() =>
store.preferences.contentLanguages.length > 0 &&

View file

@ -115,7 +115,10 @@ const PostLoaded = observer(function PostLoadedImpl({
replyAuthorDid = urip.hostname
}
const translatorUrl = getTranslatorLink(record?.text || '')
const translatorUrl = getTranslatorLink(
record?.text || '',
store.preferences.primaryLanguage,
)
const onPressReply = React.useCallback(() => {
store.shell.openComposer({

View file

@ -64,7 +64,10 @@ export const FeedItem = observer(function FeedItemImpl({
const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri)
return urip.hostname
}, [record?.reply])
const translatorUrl = getTranslatorLink(record?.text || '')
const translatorUrl = getTranslatorLink(
record?.text || '',
store.preferences.primaryLanguage,
)
const onPressReply = React.useCallback(() => {
track('FeedItem:PostReply')