Pre-fill alt text with 10-million card post (#5389)

* Pre-fill alt text with 10-million card post (#5377)

* Clean up type

* Tweak alt copy

* Add pt translation, fix typo

---------

Co-authored-by: Calvin <clavin@users.noreply.github.com>
zio/dev^2
Eric Bailey 2024-09-17 13:55:19 -05:00 committed by GitHub
parent 8f98d6b12f
commit 2745cba3ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 169 additions and 89 deletions

View File

@ -197,6 +197,27 @@ export function TenMillionInner({
const isLoadingData = isProfileLoading || !moderation || !profile const isLoadingData = isProfileLoading || !moderation || !profile
const isLoadingImage = !uri const isLoadingImage = !uri
const displayName = React.useMemo(() => {
if (!profile || !moderation) return ''
return sanitizeDisplayName(
profile.displayName || sanitizeHandle(profile.handle),
moderation.ui('displayName'),
)
}, [profile, moderation])
const handle = React.useMemo(() => {
if (!profile) return ''
return sanitizeHandle(profile.handle, '@')
}, [profile])
const joinedDate = React.useMemo(() => {
if (!profile || !profile.createdAt) return ''
const date = i18n.date(profile.createdAt, {
month: 'short',
day: 'numeric',
year: 'numeric',
})
return date
}, [i18n, profile])
const error: string = React.useMemo(() => { const error: string = React.useMemo(() => {
if (profileError) { if (profileError) {
return _( return _(
@ -235,19 +256,34 @@ export function TenMillionInner({
msg`Bluesky now has over 10 million users, and I was #${i18n.number( msg`Bluesky now has over 10 million users, and I was #${i18n.number(
userNumber, userNumber,
)}!`, )}!`,
), // TODO ),
imageUris: [ imageUris: [
{ {
uri, uri,
width: WIDTH, width: WIDTH,
height: HEIGHT, height: HEIGHT,
altText: _(
msg`A virtual certificate with text "Celebrating 10M users on Bluesky, #${i18n.number(
userNumber,
)}, ${displayName} ${handle}, joined on ${joinedDate}"`,
),
}, },
], ],
}) })
}, 1e3) }, 1e3)
}) })
} }
}, [_, i18n, control, openComposer, uri, userNumber]) }, [
_,
i18n,
control,
openComposer,
uri,
userNumber,
displayName,
handle,
joinedDate,
])
const onNativeShare = React.useCallback(() => { const onNativeShare = React.useCallback(() => {
if (uri) { if (uri) {
control.close(() => { control.close(() => {
@ -490,11 +526,7 @@ export function TenMillionInner({
a.leading_tight, a.leading_tight,
{maxWidth: '60%'}, {maxWidth: '60%'},
]}> ]}>
{sanitizeDisplayName( {displayName}
profile.displayName ||
sanitizeHandle(profile.handle),
moderation.ui('displayName'),
)}
</Text> </Text>
<View <View
style={[a.flex_row, a.justify_between, a.gap_4xl]}> style={[a.flex_row, a.justify_between, a.gap_4xl]}>
@ -508,7 +540,7 @@ export function TenMillionInner({
a.leading_snug, a.leading_snug,
lightTheme.atoms.text_contrast_medium, lightTheme.atoms.text_contrast_medium,
]}> ]}>
{sanitizeHandle(profile.handle, '@')} {handle}
</Text> </Text>
{profile.createdAt && ( {profile.createdAt && (
@ -524,14 +556,7 @@ export function TenMillionInner({
a.text_right, a.text_right,
lightTheme.atoms.text_contrast_low, lightTheme.atoms.text_contrast_low,
]}> ]}>
<Trans> <Trans>Joined on {joinedDate}</Trans>
Joined{' '}
{i18n.date(profile.createdAt, {
month: 'short',
day: 'numeric',
year: 'numeric',
})}
</Trans>
</Text> </Text>
)} )}
</View> </View>

View File

@ -75,7 +75,7 @@ msgstr "{0, plural, one {# segon} other {# segons}}"
#: src/components/KnownFollowers.tsx:179 #: src/components/KnownFollowers.tsx:179
#~ msgid "{0, plural, one {and # other} other {and # others}}" #~ msgid "{0, plural, one {and # other} other {and # others}}"
#~ msgstr "{0, plural, one {i # altre} other {i # altres}" #~ msgstr "{0, plural, one {i # altre} other {i # altres}}"
#: src/components/ProfileHoverCard/index.web.tsx:398 #: src/components/ProfileHoverCard/index.web.tsx:398
#: src/screens/Profile/Header/Metrics.tsx:23 #: src/screens/Profile/Header/Metrics.tsx:23

View File

@ -127,7 +127,7 @@ msgstr "{0} <0>em <1>texto e tags</1></0>"
msgid "{0} joined this week" msgid "{0} joined this week"
msgstr "{0} entrou esta semana" msgstr "{0} entrou esta semana"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:637 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/Scrubber.tsx:195
msgid "{0} of {1}" msgid "{0} of {1}"
msgstr "{0} de {1}" msgstr "{0} de {1}"
@ -343,12 +343,16 @@ msgstr "7 dias"
#~ msgid "A help tooltip" #~ msgid "A help tooltip"
#~ msgstr "Uma sugestão de ajuda" #~ msgstr "Uma sugestão de ajuda"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:266
msgid "A virtual certificate with text \"Celebrating 10M users on Bluesky, #{0}, {displayName} {handle}, joined on {joinedDate}\""
msgstr "Um certificado virtual com o texto \"Comemorando 10 milhões de usuários no Bluesky, #{0}, {displayName} {handle}, ingressou em {joinedDate}\""
#: src/view/com/util/ViewHeader.tsx:92 #: src/view/com/util/ViewHeader.tsx:92
#: src/view/screens/Search/Search.tsx:684 #: src/view/screens/Search/Search.tsx:684
msgid "Access navigation links and settings" msgid "Access navigation links and settings"
msgstr "Acessar links de navegação e configurações" msgstr "Acessar links de navegação e configurações"
#: src/view/com/home/HomeHeaderLayoutMobile.tsx:56 #: src/view/com/home/HomeHeaderLayoutMobile.tsx:103
msgid "Access profile and other navigation links" msgid "Access profile and other navigation links"
msgstr "Acessar perfil e outros links de navegação" msgstr "Acessar perfil e outros links de navegação"
@ -640,7 +644,7 @@ msgstr "Ocorreu um erro"
#~ msgid "An error occured" #~ msgid "An error occured"
#~ msgstr "Tivemos um problema" #~ msgstr "Tivemos um problema"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:413 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:416
msgid "An error occurred" msgid "An error occurred"
msgstr "Ocorreu um erro" msgstr "Ocorreu um erro"
@ -660,7 +664,7 @@ msgstr "Ocorreu um erro ao carregar o vídeo. Tente novamente mais tarde."
msgid "An error occurred while loading the video. Please try again." msgid "An error occurred while loading the video. Please try again."
msgstr "Ocorreu um erro ao carregar o vídeo. Tente novamente." msgstr "Ocorreu um erro ao carregar o vídeo. Tente novamente."
#: src/components/dialogs/nuxs/TenMillion/index.tsx:250 #: src/components/dialogs/nuxs/TenMillion/index.tsx:315
msgid "An error occurred while saving the image!" msgid "An error occurred while saving the image!"
msgstr "Ocorreu um erro ao salvar a imagem!" msgstr "Ocorreu um erro ao salvar a imagem!"
@ -990,6 +994,11 @@ msgstr "Bluesky é uma rede aberta que permite a escolha do seu provedor de hosp
msgid "Bluesky is better with friends!" msgid "Bluesky is better with friends!"
msgstr "Bluesky é melhor com amigos!" msgstr "Bluesky é melhor com amigos!"
#: src/components/dialogs/nuxs/TenMillion/Trigger.tsx:43
#: src/components/dialogs/nuxs/TenMillion/Trigger.tsx:59
msgid "Bluesky is celebrating 10 million users!"
msgstr ""
#: src/view/com/auth/onboarding/WelcomeDesktop.tsx:80 #: src/view/com/auth/onboarding/WelcomeDesktop.tsx:80
#: src/view/com/auth/onboarding/WelcomeMobile.tsx:82 #: src/view/com/auth/onboarding/WelcomeMobile.tsx:82
#~ msgid "Bluesky is flexible." #~ msgid "Bluesky is flexible."
@ -1005,7 +1014,7 @@ msgstr "Bluesky é melhor com amigos!"
#~ msgid "Bluesky is public." #~ msgid "Bluesky is public."
#~ msgstr "Bluesky é público." #~ msgstr "Bluesky é público."
#: src/components/dialogs/nuxs/TenMillion/index.tsx:206 #: src/components/dialogs/nuxs/TenMillion/index.tsx:256
msgid "Bluesky now has over 10 million users, and I was #{0}!" msgid "Bluesky now has over 10 million users, and I was #{0}!"
msgstr "O Bluesky agora tem mais de 10 milhões de usuários, e eu fui o #{0}!" msgstr "O Bluesky agora tem mais de 10 milhões de usuários, e eu fui o #{0}!"
@ -1030,7 +1039,7 @@ msgstr "Desfocar imagens e filtrar dos feeds"
msgid "Books" msgid "Books"
msgstr "Livros" msgstr "Livros"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:614 #: src/components/dialogs/nuxs/TenMillion/index.tsx:677
msgid "Brag a little!" msgid "Brag a little!"
msgstr "Gabe-se um pouco!" msgstr "Gabe-se um pouco!"
@ -1100,8 +1109,8 @@ msgid "Can only contain letters, numbers, spaces, dashes, and underscores. Must
msgstr "Só pode conter letras, números, espaços, riscas e subtraços. Deve ter pelo menos 4 caracteres, mas não mais de 32 caracteres." msgstr "Só pode conter letras, números, espaços, riscas e subtraços. Deve ter pelo menos 4 caracteres, mas não mais de 32 caracteres."
#: src/components/Menu/index.tsx:235 #: src/components/Menu/index.tsx:235
#: src/components/Prompt.tsx:122
#: src/components/Prompt.tsx:124 #: src/components/Prompt.tsx:124
#: src/components/Prompt.tsx:126
#: src/components/TagMenu/index.tsx:282 #: src/components/TagMenu/index.tsx:282
#: src/screens/Deactivated.tsx:161 #: src/screens/Deactivated.tsx:161
#: src/view/com/composer/Composer.tsx:594 #: src/view/com/composer/Composer.tsx:594
@ -1181,7 +1190,7 @@ msgstr "Legendas (.vtt)"
msgid "Captions & alt text" msgid "Captions & alt text"
msgstr "Legendas e texto alt" msgstr "Legendas e texto alt"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:368 #: src/components/dialogs/nuxs/TenMillion/index.tsx:434
msgid "Celebrating {0} users" msgid "Celebrating {0} users"
msgstr "Comemorando {0} usuários" msgstr "Comemorando {0} usuários"
@ -1532,8 +1541,8 @@ msgstr "Configure o filtro de conteúdo por categoria: {name}"
msgid "Configured in <0>moderation settings</0>." msgid "Configured in <0>moderation settings</0>."
msgstr "Configure no <0>painel de moderação</0>." msgstr "Configure no <0>painel de moderação</0>."
#: src/components/Prompt.tsx:165 #: src/components/Prompt.tsx:167
#: src/components/Prompt.tsx:168 #: src/components/Prompt.tsx:170
#: src/view/com/modals/SelfLabel.tsx:155 #: src/view/com/modals/SelfLabel.tsx:155
#: src/view/com/modals/VerifyEmail.tsx:239 #: src/view/com/modals/VerifyEmail.tsx:239
#: src/view/com/modals/VerifyEmail.tsx:241 #: src/view/com/modals/VerifyEmail.tsx:241
@ -2050,7 +2059,7 @@ msgstr "Desabilitar feedback tátil"
#~ msgid "Disable haptics" #~ msgid "Disable haptics"
#~ msgstr "Desabilitar feedback tátil" #~ msgstr "Desabilitar feedback tátil"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:379 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:382
msgid "Disable subtitles" msgid "Disable subtitles"
msgstr "Desativar legendas" msgstr "Desativar legendas"
@ -2186,7 +2195,7 @@ msgstr "Baixe o Bluesky"
msgid "Download CAR file" msgid "Download CAR file"
msgstr "Baixar arquivo CAR" msgstr "Baixar arquivo CAR"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:622 #: src/components/dialogs/nuxs/TenMillion/index.tsx:686
msgid "Download image" msgid "Download image"
msgstr "Baixar imagem" msgstr "Baixar imagem"
@ -2433,7 +2442,7 @@ msgstr "Habilitar mídia para"
msgid "Enable priority notifications" msgid "Enable priority notifications"
msgstr "Habilitar notificações prioritárias" msgstr "Habilitar notificações prioritárias"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:380 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:383
msgid "Enable subtitles" msgid "Enable subtitles"
msgstr "Habilitar legendas" msgstr "Habilitar legendas"
@ -2565,7 +2574,7 @@ msgstr "Excluir usuário que você segue"
msgid "Excludes users you follow" msgid "Excludes users you follow"
msgstr "Excluir usuário que você segue" msgstr "Excluir usuário que você segue"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:397 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:400
msgid "Exit fullscreen" msgid "Exit fullscreen"
msgstr "Sair da tela cheia" msgstr "Sair da tela cheia"
@ -2912,13 +2921,13 @@ msgstr "Seguir Conta"
msgid "Follow all" msgid "Follow all"
msgstr "Siga todos" msgstr "Siga todos"
#: src/view/com/profile/FollowButton.tsx:79 #: src/screens/Profile/Header/ProfileHeaderStandard.tsx:223
msgctxt "action" #: src/view/com/post-thread/PostThreadFollowBtn.tsx:142
msgid "Follow Back" msgid "Follow Back"
msgstr "Seguir De Volta" msgstr "Seguir De Volta"
#: src/screens/Profile/Header/ProfileHeaderStandard.tsx:223 #: src/view/com/profile/FollowButton.tsx:79
#: src/view/com/post-thread/PostThreadFollowBtn.tsx:142 msgctxt "action"
msgid "Follow Back" msgid "Follow Back"
msgstr "Seguir De Volta" msgstr "Seguir De Volta"
@ -3075,7 +3084,7 @@ msgctxt "from-feed"
msgid "From <0/>" msgid "From <0/>"
msgstr "Por <0/>" msgstr "Por <0/>"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:398 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:401
msgid "Fullscreen" msgid "Fullscreen"
msgstr "Tela cheia" msgstr "Tela cheia"
@ -3419,7 +3428,7 @@ msgstr "Imagem"
msgid "Image alt text" msgid "Image alt text"
msgstr "Texto alternativo da imagem" msgstr "Texto alternativo da imagem"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:247 #: src/components/dialogs/nuxs/TenMillion/index.tsx:312
#: src/components/StarterPack/ShareDialog.tsx:76 #: src/components/StarterPack/ShareDialog.tsx:76
msgid "Image saved to your camera roll!" msgid "Image saved to your camera roll!"
msgstr "Imagem salva no rolo da câmera!" msgstr "Imagem salva no rolo da câmera!"
@ -3566,8 +3575,12 @@ msgid "Join the conversation"
msgstr "Participe da conversa" msgstr "Participe da conversa"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:492 #: src/components/dialogs/nuxs/TenMillion/index.tsx:492
msgid "Joined {0}" #~ msgid "Joined {0}"
msgstr "Juntou-se {0}" #~ msgstr "Juntou-se {0}"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:559
msgid "Joined on {joinedDate}"
msgstr ""
#: src/screens/Onboarding/index.tsx:21 #: src/screens/Onboarding/index.tsx:21
#: src/screens/Onboarding/state.ts:89 #: src/screens/Onboarding/state.ts:89
@ -4074,8 +4087,8 @@ msgstr "Música"
msgid "Mute" msgid "Mute"
msgstr "Silenciar" msgstr "Silenciar"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:166 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:157
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:389 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VolumeControl.tsx:94
msgctxt "video" msgctxt "video"
msgid "Mute" msgid "Mute"
msgstr "Silenciar" msgstr "Silenciar"
@ -4387,6 +4400,11 @@ msgstr "Nenhum GIF em destaque encontrado."
msgid "No feeds found. Try searching for something else." msgid "No feeds found. Try searching for something else."
msgstr "Nenhum feed encontrado. Tente pesquisar por outra coisa." msgstr "Nenhum feed encontrado. Tente pesquisar por outra coisa."
#: src/components/LikedByList.tsx:78
#: src/view/com/post-thread/PostLikedBy.tsx:85
msgid "No likes yet"
msgstr ""
#: src/components/ProfileCard.tsx:336 #: src/components/ProfileCard.tsx:336
#: src/screens/Profile/Header/ProfileHeaderStandard.tsx:116 #: src/screens/Profile/Header/ProfileHeaderStandard.tsx:116
msgid "No longer following {0}" msgid "No longer following {0}"
@ -4423,6 +4441,14 @@ msgstr "Ninguém além do autor pode citar esta postagem."
msgid "No posts yet." msgid "No posts yet."
msgstr "Nenhuma postagem ainda." msgstr "Nenhuma postagem ainda."
#: src/view/com/post-thread/PostQuotes.tsx:106
msgid "No quotes yet"
msgstr ""
#: src/view/com/post-thread/PostRepostedBy.tsx:78
msgid "No reposts yet"
msgstr ""
#: src/view/com/composer/text-input/mobile/Autocomplete.tsx:101 #: src/view/com/composer/text-input/mobile/Autocomplete.tsx:101
#: src/view/com/composer/text-input/web/Autocomplete.tsx:195 #: src/view/com/composer/text-input/web/Autocomplete.tsx:195
msgid "No result" msgid "No result"
@ -4469,11 +4495,20 @@ msgstr "Ninguém"
#~ msgid "Nobody can reply" #~ msgid "Nobody can reply"
#~ msgstr "Ninguém pode responder" #~ msgstr "Ninguém pode responder"
#: src/components/LikedByList.tsx:79 #: src/components/LikedByList.tsx:80
#: src/components/LikesDialog.tsx:99 #: src/components/LikesDialog.tsx:99
#: src/view/com/post-thread/PostLikedBy.tsx:87
msgid "Nobody has liked this yet. Maybe you should be the first!" msgid "Nobody has liked this yet. Maybe you should be the first!"
msgstr "Ninguém curtiu isso ainda. Você pode ser o primeiro!" msgstr "Ninguém curtiu isso ainda. Você pode ser o primeiro!"
#: src/view/com/post-thread/PostQuotes.tsx:108
msgid "Nobody has quoted this yet. Maybe you should be the first!"
msgstr ""
#: src/view/com/post-thread/PostRepostedBy.tsx:80
msgid "Nobody has reposted this yet. Maybe you should be the first!"
msgstr ""
#: src/screens/StarterPack/Wizard/StepProfiles.tsx:103 #: src/screens/StarterPack/Wizard/StepProfiles.tsx:103
msgid "Nobody was found. Try searching for someone else." msgid "Nobody was found. Try searching for someone else."
msgstr "Ninguém foi encontrado. Tente procurar por outra pessoa." msgstr "Ninguém foi encontrado. Tente procurar por outra pessoa."
@ -4576,7 +4611,7 @@ msgstr "Opa!"
msgid "Oh no! Something went wrong." msgid "Oh no! Something went wrong."
msgstr "Opa! Algo deu errado." msgstr "Opa! Algo deu errado."
#: src/components/dialogs/nuxs/TenMillion/index.tsx:175 #: src/components/dialogs/nuxs/TenMillion/index.tsx:224
msgid "Oh no! We weren't able to generate an image for you to share. Rest assured, we're glad you're here 🦋" msgid "Oh no! We weren't able to generate an image for you to share. Rest assured, we're glad you're here 🦋"
msgstr "Ah, não! Não conseguimos gerar uma imagem para você compartilhar. Fique tranquilo, estamos felizes que você esteja aqui 🦋" msgstr "Ah, não! Não conseguimos gerar uma imagem para você compartilhar. Fique tranquilo, estamos felizes que você esteja aqui 🦋"
@ -4624,7 +4659,7 @@ msgstr "Apenas {0} pode responder."
msgid "Only contains letters, numbers, and hyphens" msgid "Only contains letters, numbers, and hyphens"
msgstr "Contém apenas letras, números e hífens" msgstr "Contém apenas letras, números e hífens"
#: src/view/com/composer/videos/SubtitleFilePicker.tsx:39 #: src/view/com/composer/videos/SubtitleFilePicker.tsx:40
msgid "Only WebVTT (.vtt) files are supported" msgid "Only WebVTT (.vtt) files are supported"
msgstr "Somente arquivos WebVTT (.vtt) são suportados" msgstr "Somente arquivos WebVTT (.vtt) são suportados"
@ -4680,7 +4715,7 @@ msgstr "Abrir opções de mensagem"
msgid "Open muted words and tags settings" msgid "Open muted words and tags settings"
msgstr "Abrir opções de palavras/tags silenciadas" msgstr "Abrir opções de palavras/tags silenciadas"
#: src/view/com/home/HomeHeaderLayoutMobile.tsx:54 #: src/view/com/home/HomeHeaderLayoutMobile.tsx:101
msgid "Open navigation" msgid "Open navigation"
msgstr "Abrir navegação" msgstr "Abrir navegação"
@ -4924,12 +4959,12 @@ msgid "Password updated!"
msgstr "Senha atualizada!" msgstr "Senha atualizada!"
#: src/view/com/util/post-embeds/GifEmbed.tsx:46 #: src/view/com/util/post-embeds/GifEmbed.tsx:46
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:150 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:141
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:366 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:369
msgid "Pause" msgid "Pause"
msgstr "Pausar" msgstr "Pausar"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:319 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:320
msgid "Pause video" msgid "Pause video"
msgstr "Pausar vídeo" msgstr "Pausar vídeo"
@ -4989,8 +5024,8 @@ msgid "Pinned to your feeds"
msgstr "Fixado em seus feeds" msgstr "Fixado em seus feeds"
#: src/view/com/util/post-embeds/GifEmbed.tsx:46 #: src/view/com/util/post-embeds/GifEmbed.tsx:46
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:150 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:141
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:367 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:370
msgid "Play" msgid "Play"
msgstr "Tocar" msgstr "Tocar"
@ -5008,7 +5043,7 @@ msgid "Play or pause the GIF"
msgstr "Tocar ou pausar o GIF" msgstr "Tocar ou pausar o GIF"
#: src/view/com/util/post-embeds/VideoEmbed.tsx:110 #: src/view/com/util/post-embeds/VideoEmbed.tsx:110
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:320 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:321
msgid "Play video" msgid "Play video"
msgstr "Reproduzir vídeo" msgstr "Reproduzir vídeo"
@ -6076,7 +6111,7 @@ msgstr "Veja o guia"
#~ msgid "See what's next" #~ msgid "See what's next"
#~ msgstr "Veja o que vem por aí" #~ msgstr "Veja o que vem por aí"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:631 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/Scrubber.tsx:189
msgid "Seek slider" msgid "Seek slider"
msgstr "Controle deslizante de busca" msgstr "Controle deslizante de busca"
@ -6136,7 +6171,7 @@ msgstr "Seleciona opção {i} de {numItems}"
#~ msgid "Select some accounts below to follow" #~ msgid "Select some accounts below to follow"
#~ msgstr "Selecione algumas contas para seguir" #~ msgstr "Selecione algumas contas para seguir"
#: src/view/com/composer/videos/SubtitleFilePicker.tsx:65 #: src/view/com/composer/videos/SubtitleFilePicker.tsx:66
msgid "Select subtitle file (.vtt)" msgid "Select subtitle file (.vtt)"
msgstr "Selecione o arquivo de legenda (.vtt)" msgstr "Selecione o arquivo de legenda (.vtt)"
@ -6344,7 +6379,7 @@ msgstr "Atividade sexual ou nudez erótica."
msgid "Sexually Suggestive" msgid "Sexually Suggestive"
msgstr "Sexualmente Sugestivo" msgstr "Sexualmente Sugestivo"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:644 #: src/components/dialogs/nuxs/TenMillion/index.tsx:708
#: src/components/StarterPack/QrCodeDialog.tsx:177 #: src/components/StarterPack/QrCodeDialog.tsx:177
#: src/screens/StarterPack/StarterPackScreen.tsx:411 #: src/screens/StarterPack/StarterPackScreen.tsx:411
#: src/screens/StarterPack/StarterPackScreen.tsx:582 #: src/screens/StarterPack/StarterPackScreen.tsx:582
@ -6381,11 +6416,11 @@ msgstr "Compartilhar assim"
msgid "Share feed" msgid "Share feed"
msgstr "Compartilhar feed" msgstr "Compartilhar feed"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:621 #: src/components/dialogs/nuxs/TenMillion/index.tsx:685
msgid "Share image externally" msgid "Share image externally"
msgstr "Compartilhar imagem externamente" msgstr "Compartilhar imagem externamente"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:639 #: src/components/dialogs/nuxs/TenMillion/index.tsx:703
msgid "Share image in post" msgid "Share image in post"
msgstr "Compartilhe a imagem na postagem" msgstr "Compartilhe a imagem na postagem"
@ -6894,15 +6929,15 @@ msgstr "Alto"
msgid "Tap to dismiss" msgid "Tap to dismiss"
msgstr "Toque para dispensar" msgstr "Toque para dispensar"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:145 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:136
msgid "Tap to enter full screen" msgid "Tap to enter full screen"
msgstr "Toque para entrar em tela cheia" msgstr "Toque para entrar em tela cheia"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:151 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:142
msgid "Tap to play or pause" msgid "Tap to play or pause"
msgstr "Toque para reproduzir ou pausar" msgstr "Toque para reproduzir ou pausar"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:164 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:159
msgid "Tap to toggle sound" msgid "Tap to toggle sound"
msgstr "Toque para alternar o som" msgstr "Toque para alternar o som"
@ -6936,7 +6971,7 @@ msgstr "Conte uma piada!"
msgid "Tell us a little more" msgid "Tell us a little more"
msgstr "Conte-nos um pouco mais" msgstr "Conte-nos um pouco mais"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:518 #: src/components/dialogs/nuxs/TenMillion/index.tsx:578
msgid "Ten Million" msgid "Ten Million"
msgstr "Dez milhões" msgstr "Dez milhões"
@ -6977,7 +7012,7 @@ msgstr "Campo de entrada de texto"
msgid "Thank you. Your report has been sent." msgid "Thank you. Your report has been sent."
msgstr "Obrigado. Sua denúncia foi enviada." msgstr "Obrigado. Sua denúncia foi enviada."
#: src/components/dialogs/nuxs/TenMillion/index.tsx:593 #: src/components/dialogs/nuxs/TenMillion/index.tsx:654
msgid "Thanks for being one of our first 10 million users." msgid "Thanks for being one of our first 10 million users."
msgstr "Obrigado por ser um dos nossos primeiros 10 milhões de usuários." msgstr "Obrigado por ser um dos nossos primeiros 10 milhões de usuários."
@ -7002,7 +7037,7 @@ msgstr "Este identificador de usuário já está sendo usado."
msgid "That starter pack could not be found." msgid "That starter pack could not be found."
msgstr "Esse pacote inicial não pôde ser encontrado." msgstr "Esse pacote inicial não pôde ser encontrado."
#: src/view/com/post-thread/PostQuotes.tsx:127 #: src/view/com/post-thread/PostQuotes.tsx:133
msgid "That's all, folks!" msgid "That's all, folks!"
msgstr "É isso, pessoal!" msgstr "É isso, pessoal!"
@ -7457,6 +7492,10 @@ msgstr "Preferências das Threads"
msgid "To disable the email 2FA method, please verify your access to the email address." msgid "To disable the email 2FA method, please verify your access to the email address."
msgstr "Para desabilitar o 2FA via e-mail, por favor verifique seu acesso a este endereço de e-mail." msgstr "Para desabilitar o 2FA via e-mail, por favor verifique seu acesso a este endereço de e-mail."
#: src/components/dialogs/nuxs/TenMillion/Trigger.tsx:69
msgid "To learn more, <0>check out our post.</0>"
msgstr ""
#: src/components/dms/ReportConversationPrompt.tsx:20 #: src/components/dms/ReportConversationPrompt.tsx:20
msgid "To report a conversation, please report one of its messages via the conversation screen. This lets our moderators understand the context of your issue." msgid "To report a conversation, please report one of its messages via the conversation screen. This lets our moderators understand the context of your issue."
msgstr "Para denunciar uma conversa, por favor, denuncie uma das mensagens individualmente. Isso vai permitir a análise da situação pelos nossos moderadores." msgstr "Para denunciar uma conversa, por favor, denuncie uma das mensagens individualmente. Isso vai permitir a análise da situação pelos nossos moderadores."
@ -7469,7 +7508,8 @@ msgstr "Para enviar vídeos para o Bluesky, você deve primeiro verificar seu e-
msgid "To whom would you like to send this report?" msgid "To whom would you like to send this report?"
msgstr "Para quem você gostaria de enviar esta denúncia?" msgstr "Para quem você gostaria de enviar esta denúncia?"
#: src/components/dialogs/nuxs/TenMillion/index.tsx:597 #: src/components/dialogs/nuxs/TenMillion/index.tsx:658
#: src/components/dialogs/nuxs/TenMillion/Trigger.tsx:63
msgid "Together, we're rebuilding the social internet. We're glad you're here." msgid "Together, we're rebuilding the social internet. We're glad you're here."
msgstr "Juntos, estamos reconstruindo a internet social. Estamos felizes que você esteja aqui." msgstr "Juntos, estamos reconstruindo a internet social. Estamos felizes que você esteja aqui."
@ -7613,8 +7653,8 @@ msgstr "Descurtir este feed"
msgid "Unmute" msgid "Unmute"
msgstr "Dessilenciar" msgstr "Dessilenciar"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:165 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:156
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:388 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VolumeControl.tsx:93
msgctxt "video" msgctxt "video"
msgid "Unmute" msgid "Unmute"
msgstr "Ativar o áudio" msgstr "Ativar o áudio"
@ -7645,13 +7685,13 @@ msgstr "Desmutar conversa"
msgid "Unmute thread" msgid "Unmute thread"
msgstr "Dessilenciar thread" msgstr "Dessilenciar thread"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx:317 #: src/view/com/util/post-embeds/VideoEmbedInner/web-controls/VideoControls.tsx:318
msgid "Unmute video" msgid "Unmute video"
msgstr "Ativar o áudio do vídeo" msgstr "Ativar o áudio do vídeo"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:168 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:168
msgid "Unmuted" #~ msgid "Unmuted"
msgstr "Áudio ativado" #~ msgstr "Áudio ativado"
#: src/view/screens/ProfileFeed.tsx:292 #: src/view/screens/ProfileFeed.tsx:292
#: src/view/screens/ProfileList.tsx:673 #: src/view/screens/ProfileList.tsx:673
@ -7927,8 +7967,8 @@ msgstr "Verificar Seu E-mail"
msgid "Version {appVersion} {bundleInfo}" msgid "Version {appVersion} {bundleInfo}"
msgstr "Versão {appVersion} {bundleInfo}" msgstr "Versão {appVersion} {bundleInfo}"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:93 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:84
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:144 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:135
msgid "Video" msgid "Video"
msgstr "Vídeo" msgstr "Vídeo"
@ -7949,7 +7989,7 @@ msgstr "Vídeo não encontrado."
msgid "Video settings" msgid "Video settings"
msgstr "Configurações de vídeo" msgstr "Configurações de vídeo"
#: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:93 #: src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx:84
msgid "Video: {0}" msgid "Video: {0}"
msgstr "Vídeo: {0}" msgstr "Vídeo: {0}"
@ -7999,6 +8039,10 @@ msgstr "Ver thread completa"
msgid "View information about these labels" msgid "View information about these labels"
msgstr "Ver informações sobre estes rótulos" msgstr "Ver informações sobre estes rótulos"
#: src/components/dialogs/nuxs/TenMillion/Trigger.tsx:72
msgid "View our post"
msgstr ""
#: src/components/ProfileHoverCard/index.web.tsx:418 #: src/components/ProfileHoverCard/index.web.tsx:418
#: src/components/ProfileHoverCard/index.web.tsx:436 #: src/components/ProfileHoverCard/index.web.tsx:436
#: src/components/ProfileHoverCard/index.web.tsx:463 #: src/components/ProfileHoverCard/index.web.tsx:463
@ -8023,8 +8067,8 @@ msgstr "Ver usuários que curtiram este feed"
msgid "View your blocked accounts" msgid "View your blocked accounts"
msgstr "Veja suas contas bloqueadas" msgstr "Veja suas contas bloqueadas"
#: src/view/com/home/HomeHeaderLayout.web.tsx:79 #: src/view/com/home/HomeHeaderLayout.web.tsx:132
#: src/view/com/home/HomeHeaderLayoutMobile.tsx:86 #: src/view/com/home/HomeHeaderLayoutMobile.tsx:143
msgid "View your feeds and explore more" msgid "View your feeds and explore more"
msgstr "Veja seus feeds e explore mais" msgstr "Veja seus feeds e explore mais"
@ -8497,7 +8541,7 @@ msgstr "Você deve estar seguindo pelo menos sete outras pessoas para gerar um p
msgid "You must grant access to your photo library to save a QR code" msgid "You must grant access to your photo library to save a QR code"
msgstr "Você deve conceder acesso à sua biblioteca de fotos para salvar o QR code." msgstr "Você deve conceder acesso à sua biblioteca de fotos para salvar o QR code."
#: src/components/dialogs/nuxs/TenMillion/index.tsx:237 #: src/components/dialogs/nuxs/TenMillion/index.tsx:302
#: src/components/StarterPack/ShareDialog.tsx:68 #: src/components/StarterPack/ShareDialog.tsx:68
msgid "You must grant access to your photo library to save the image." msgid "You must grant access to your photo library to save the image."
msgstr "Você deve conceder acesso à sua biblioteca de fotos para salvar a imagem." msgstr "Você deve conceder acesso à sua biblioteca de fotos para salvar a imagem."

View File

@ -1,19 +1,20 @@
import {makeAutoObservable, runInAction} from 'mobx' import {makeAutoObservable, runInAction} from 'mobx'
import {ImageModel} from './image'
import {Image as RNImage} from 'react-native-image-crop-picker'
import {openPicker} from 'lib/media/picker'
import {getImageDim} from 'lib/media/manip' import {getImageDim} from 'lib/media/manip'
import {openPicker} from 'lib/media/picker'
import {ImageInitOptions, ImageModel} from './image'
interface InitialImageUri { interface InitialImageUri {
uri: string uri: string
width: number width: number
height: number height: number
altText?: string
} }
export class GalleryModel { export class GalleryModel {
images: ImageModel[] = [] images: ImageModel[] = []
constructor(uris?: {uri: string; width: number; height: number}[]) { constructor(uris?: InitialImageUri[]) {
makeAutoObservable(this) makeAutoObservable(this)
if (uris) { if (uris) {
@ -33,7 +34,7 @@ export class GalleryModel {
return this.images.some(image => image.altText.trim() === '') return this.images.some(image => image.altText.trim() === '')
} }
*add(image_: Omit<RNImage, 'size'>) { *add(image_: ImageInitOptions) {
if (this.size >= 4) { if (this.size >= 4) {
return return
} }
@ -59,7 +60,6 @@ export class GalleryModel {
path: uri, path: uri,
height, height,
width, width,
mime: 'image/jpeg',
} }
runInAction(() => { runInAction(() => {
@ -100,10 +100,10 @@ export class GalleryModel {
async addFromUris(uris: InitialImageUri[]) { async addFromUris(uris: InitialImageUri[]) {
for (const uriObj of uris) { for (const uriObj of uris) {
this.add({ this.add({
mime: 'image/jpeg',
height: uriObj.height, height: uriObj.height,
width: uriObj.width, width: uriObj.width,
path: uriObj.uri, path: uriObj.uri,
altText: uriObj.altText,
}) })
} }
} }

View File

@ -1,14 +1,15 @@
import {Image as RNImage} from 'react-native-image-crop-picker' import {Image as RNImage} from 'react-native-image-crop-picker'
import {makeAutoObservable, runInAction} from 'mobx'
import {POST_IMG_MAX} from 'lib/constants'
import * as ImageManipulator from 'expo-image-manipulator' import * as ImageManipulator from 'expo-image-manipulator'
import {getDataUriSize} from 'lib/media/util'
import {openCropper} from 'lib/media/picker'
import {ActionCrop, FlipType, SaveFormat} from 'expo-image-manipulator' import {ActionCrop, FlipType, SaveFormat} from 'expo-image-manipulator'
import {makeAutoObservable, runInAction} from 'mobx'
import {Position} from 'react-avatar-editor' import {Position} from 'react-avatar-editor'
import {Dimensions} from 'lib/media/types'
import {isIOS} from 'platform/detection'
import {logger} from '#/logger' import {logger} from '#/logger'
import {POST_IMG_MAX} from 'lib/constants'
import {openCropper} from 'lib/media/picker'
import {Dimensions} from 'lib/media/types'
import {getDataUriSize} from 'lib/media/util'
import {isIOS} from 'platform/detection'
export interface ImageManipulationAttributes { export interface ImageManipulationAttributes {
aspectRatio?: '4:3' | '1:1' | '3:4' | 'None' aspectRatio?: '4:3' | '1:1' | '3:4' | 'None'
@ -19,6 +20,13 @@ export interface ImageManipulationAttributes {
flipVertical?: boolean flipVertical?: boolean
} }
export interface ImageInitOptions {
path: string
width: number
height: number
altText?: string
}
const MAX_IMAGE_SIZE_IN_BYTES = 976560 const MAX_IMAGE_SIZE_IN_BYTES = 976560
export class ImageModel implements Omit<RNImage, 'size'> { export class ImageModel implements Omit<RNImage, 'size'> {
@ -41,12 +49,15 @@ export class ImageModel implements Omit<RNImage, 'size'> {
} }
prevAttributes: ImageManipulationAttributes = {} prevAttributes: ImageManipulationAttributes = {}
constructor(image: Omit<RNImage, 'size'>) { constructor(image: ImageInitOptions) {
makeAutoObservable(this) makeAutoObservable(this)
this.path = image.path this.path = image.path
this.width = image.width this.width = image.width
this.height = image.height this.height = image.height
if (image.altText !== undefined) {
this.setAltText(image.altText)
}
} }
setRatio(aspectRatio: ImageManipulationAttributes['aspectRatio']) { setRatio(aspectRatio: ImageManipulationAttributes['aspectRatio']) {

View File

@ -36,7 +36,7 @@ export interface ComposerOpts {
mention?: string // handle of user to mention mention?: string // handle of user to mention
openEmojiPicker?: (pos: DOMRect | undefined) => void openEmojiPicker?: (pos: DOMRect | undefined) => void
text?: string text?: string
imageUris?: {uri: string; width: number; height: number}[] imageUris?: {uri: string; width: number; height: number; altText?: string}[]
} }
type StateContext = ComposerOpts | undefined type StateContext = ComposerOpts | undefined