Merge remote-tracking branch 'origin/HEAD'

This commit is contained in:
Vitor Pamplona
2023-07-14 08:38:49 -04:00
3 changed files with 210 additions and 6 deletions

View File

@@ -40,7 +40,9 @@ import com.vitorpamplona.amethyst.ui.theme.DoubleVertSpacer
import com.vitorpamplona.amethyst.ui.theme.StdPadding
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.xmlpull.v1.XmlPullParser
import org.xmlpull.v1.XmlPullParserException
@@ -80,12 +82,19 @@ fun Context.getLangPreferenceDropdownEntries(): Map<String, String> {
}
fun getLanguageIndex(languageEntries: Map<String, String>): Int {
var languageIndex = languageEntries.values.toTypedArray().indexOf(Locale.current.toLanguageTag())
val language = LocalPreferences.getPreferredLanguage()
var languageIndex = -1
if (language.isNotBlank()) {
languageIndex = languageEntries.values.toTypedArray().indexOf(language)
} else {
languageIndex = languageEntries.values.toTypedArray().indexOf(Locale.current.toLanguageTag())
}
if (languageIndex == -1) languageIndex = languageEntries.values.toTypedArray().indexOf(Locale.current.language)
if (languageIndex == -1) languageIndex = languageEntries.values.toTypedArray().indexOf("en")
return languageIndex
}
@OptIn(DelicateCoroutinesApi::class)
@Composable
fun SettingsScreen(
accountViewModel: AccountViewModel,
@@ -139,10 +148,13 @@ fun SettingsScreen(
placeholder = languageList[languageIndex],
options = languageList,
onSelect = {
scope.launch(Dispatchers.IO) {
val locale = languageEntries[languageList[it]]
accountViewModel.account.settings.preferredLanguage = locale
LocalPreferences.saveToEncryptedStorage(accountViewModel.account)
GlobalScope.launch(Dispatchers.Main) {
val job = scope.launch(Dispatchers.IO) {
val locale = languageEntries[languageList[it]]
accountViewModel.account.settings.preferredLanguage = locale
LocalPreferences.saveToEncryptedStorage(accountViewModel.account)
}
job.join()
val appLocale: LocaleListCompat = LocaleListCompat.forLanguageTags(languageEntries[languageList[it]])
AppCompatDelegate.setApplicationLocales(appLocale)
}

View File

@@ -164,7 +164,7 @@
<string name="translations_show_in_lang_first">最初に%1$sで表示</string>
<string name="translations_always_translate_to_lang">常に%1$sに翻訳</string>
<string name="translations_never_translate_from_lang">%1$sを翻訳しない</string>
<string name="never">never</string>
<string name="never">なし</string>
<string name="now"></string>
<string name="h">時間</string>
<string name="m"></string>
@@ -459,4 +459,17 @@
<string name="add_sensitive_content_label">センシティブなコンテンツ</string>
<string name="add_sensitive_content_description">コンテンツを表示する前に、センシティブなコンテンツであることを示す警告を表示します</string>
<string name="settings">設定</string>
<string name="always">常に</string>
<string name="wifi_only">Wifiのみ</string>
<string name="system">システム</string>
<string name="light">ライト</string>
<string name="dark">ダーク</string>
<string name="application_preferences">アプリ設定</string>
<string name="language">言語</string>
<string name="theme">テーマ</string>
<string name="automatically_load_images_gifs">自動的に画像/GIFを読み込み</string>
<string name="automatically_play_videos">自動的に動画を再生</string>
<string name="automatically_show_url_preview">自動的にURLプレビューを表示</string>
<string name="load_image">画像読み込み</string>
</resources>

View File

@@ -23,6 +23,7 @@
<string name="copy_note_id">Copiar ID da Nota</string>
<string name="broadcast">Transmitir</string>
<string name="request_deletion">Pedir para excluir</string>
<string name="block_report">Bloquear / Denunciar</string>
<string name="block_hide_user">Bloquear e ocultar usuário</string>
<string name="report_spam_scam">Denunciar spam/fraude</string>
<string name="report_impersonation">Denunciar representação</string>
@@ -33,6 +34,8 @@
<string name="login_with_a_private_key_to_like_posts">Faça login com uma chave privada para curtir postagens</string>
<string name="no_zap_amount_setup_long_press_to_change">Nenhuma configuração de quantidade de Zap. Pressione e segure para alterar</string>
<string name="login_with_a_private_key_to_be_able_to_send_zaps">Faça login com uma chave privada para poder enviar Zaps</string>
<string name="login_with_a_private_key_to_be_able_to_follow">Faça login com uma chave privada para poder seguir</string>
<string name="login_with_a_private_key_to_be_able_to_unfollow">Faça login com uma chave privada para poder remover seguidores</string>
<string name="zaps">Zaps</string>
<string name="view_count">Contagem de visualizações</string>
<string name="boost">Impulsionar</string>
@@ -121,6 +124,7 @@
<string name="send_a_direct_message">Enviar uma mensagem direta</string>
<string name="edits_the_user_s_metadata">Muda os dados do usuário</string>
<string name="follow">Seguir</string>
<string name="follow_back">Seguir de volta</string>
<string name="unblock">Desbloquear</string>
<string name="copy_user_id">Copiar ID do usuário</string>
<string name="unblock_user">Desbloquear Usuário</string>
@@ -247,5 +251,180 @@
<string name="wallet_connect_service_explainer">Use sua chave privada para pagar zaps sem sair do app. Qualquer pessoa com acesso à sua chave privada Nostr poderá gastar o saldo da sua carteira. Guarde apenas os fundos que você pode perder e use um retransmissor privado, se possível. O operador de Relay pode ver seus metadados de pagamentos.</string>
<string name="wallet_connect_service_pubkey">Wallet Connect Pubkey</string>
<string name="wallet_connect_service_relay">Wallet Connect Relay</string>
<string name="wallet_connect_service_secret">Wallet Connect Secret</string>
<string name="wallet_connect_service_show_secret">Mostrar chave secreta</string>
<string name="wallet_connect_service_secret_placeholder">chave privada nsec / hex</string>
<string name="pledge_amount_in_sats">Valor em Sats</string>
<string name="post_poll">Postar enquete</string>
<string name="poll_heading_required">Campos obrigatórios:</string>
<string name="poll_zap_recipients">Destinatários Zap</string>
<string name="poll_primary_description">Descrição da enquete principal...</string>
<string name="poll_option_index">Opção %s</string>
<string name="poll_option_description">Descrição da opção de enquete</string>
<string name="poll_heading_optional">Campos opcionais:</string>
<string name="poll_zap_value_min">Zap mínimo</string>
<string name="poll_zap_value_max">Zap máximo</string>
<string name="poll_consensus_threshold">Consenso</string>
<string name="poll_consensus_threshold_percent">(0100)%</string>
<string name="poll_closing_time">Fechar depois</string>
<string name="poll_closing_time_days">dias</string>
<string name="poll_is_closed">Enquete está fechada para novos votos</string>
<string name="poll_zap_amount">Valor do Zap</string>
<string name="one_vote_per_user_on_atomic_votes">Apenas um voto por usuário é permitido neste tipo de enquete</string>
<string name="looking_for_event">Procurando o evento %1$s</string>
<string name="custom_zaps_add_a_message">Adicionar uma mensagem pública</string>
<string name="custom_zaps_add_a_message_private">Adicionar uma mensagem privada</string>
<string name="custom_zaps_add_a_message_nonzap">Adicionar uma mensagem</string>
<string name="custom_zaps_add_a_message_example">Obrigado por todo o seu trabalho!</string>
<string name="lightning_create_and_add_invoice">Criar e adicionar</string>
<string name="poll_author_no_vote">Os autores de enquetes não podem votar em suas próprias enquetes.</string>
<string name="hash_verification_passed">A imagem é a mesma desde o post</string>
<string name="hash_verification_failed">A imagem mudou. O autor pode não ter visto a mudança</string>
<string name="content_description_add_image">Adicionar Imagem</string>
<string name="content_description_add_video">Adicionar Video</string>
<string name="content_description_add_document">Adicionar Documento</string>
<string name="add_content">Adicionar à mensagem</string>
<string name="content_description">Descrição do conteúdo</string>
<string name="content_description_example">Um barco azul em uma praia de areia branca ao pôr do sol</string>
<string name="zap_type">Tipo de Zap</string>
<string name="zap_type_explainer">Tipo de Zap para todas as opções</string>
<string name="zap_type_public">Público</string>
<string name="zap_type_public_explainer">Todos podem ver a transação e a mensagem</string>
<string name="zap_type_private">Privado</string>
<string name="zap_type_private_explainer">O remetente e o destinatário podem se ver e ler a mensagem</string>
<string name="zap_type_anonymous">Anônimo</string>
<string name="zap_type_anonymous_explainer">Destinatário e o público não sabem quem enviou o pagamento</string>
<string name="zap_type_nonzap">Sem Zap</string>
<string name="zap_type_nonzap_explainer">Nenhum traço no Nostr, apenas na Lightning</string>
<string name="file_server">Servidor de arquivos</string>
<string name="zap_forward_lnAddress">LnAddress ou @Usuario</string>
<string name="upload_server_imgur">imgur.com - confiável</string>
<string name="upload_server_imgur_explainer">Imgur pode modificar o arquivo</string>
<string name="upload_server_nostrimg">nostrimg.com - confiável</string>
<string name="upload_server_nostrimg_explainer">NostrImg pode modificar o arquivo</string>
<string name="upload_server_nostrbuild">nostr.build - confiável</string>
<string name="upload_server_nostrbuild_explainer">Nostr.build pode modificar o arquivo</string>
<string name="upload_server_nostrfilesdev">nostrfiles.dev - confiável</string>
<string name="upload_server_nostrfilesdev_explainer">Nostrfiles.dev pode modificar o arquivo</string>
<string name="upload_server_nostrcheckme">nostrcheck.me - confiável</string>
<string name="upload_server_nostrcheckme_explainer">nostrcheck.me pode modificar o arquivo</string>
<string name="upload_server_imgur_nip94">Imgur verificável (NIP-94)</string>
<string name="upload_server_imgur_nip94_explainer">Verifica se o Imgur modificou o arquivo. Novo NIP: outros clientes podem não ver</string>
<string name="upload_server_nostrimg_nip94">NostrImg verificável (NIP-94)</string>
<string name="upload_server_nostrimg_nip94_explainer">Verifica se NostrImg modificou o arquivo. Novo NIP: outros clientes podem não ver</string>
<string name="upload_server_nostrbuild_nip94">Nostr.build verificável (NIP-94)</string>
<string name="upload_server_nostrbuild_nip94_explainer">Verifica se Nostr.build modificou o arquivo. Novo NIP: outros clientes podem não ver</string>
<string name="upload_server_nostrfilesdev_nip94">Nostrfiles.dev verificável (NIP-94)</string>
<string name="upload_server_nostrfilesdev_nip94_explainer">Verifica se Nostrfiles.dev modificou o arquivo. Novo NIP: outros clientes podem não ver</string>
<string name="upload_server_nostrcheckme_nip94">Verificável Nostrcheck.me (NIP-94)</string>
<string name="upload_server_nostrcheckme_nip94_explainer">Verifica se Nostrcheck.me modificou o arquivo. Novo NIP: outros clientes podem não ver</string>
<string name="upload_server_relays_nip95">Seus relays (NIP-95)</string>
<string name="upload_server_relays_nip95_explainer">Os arquivos são hospedados por seus relays. Novo NIP: verifique se eles suportam</string>
<string name="connect_via_tor_short">Configuração do Tor/Orbot</string>
<string name="connect_via_tor">Conecte-se através da configuração do Orbot</string>
<string name="do_you_really_want_to_disable_tor_title">Desconectar do Orbot/Tor?</string>
<string name="do_you_really_want_to_disable_tor_text">Seus dados serão transferidos imediatamente na rede regular</string>
<string name="yes">Sim</string>
<string name="no">Não</string>
<string name="follow_list_selection">Lista de seguidores</string>
<string name="follow_list_kind3follows">Seguindo</string>
<string name="follow_list_global">Global</string>
<string name="connect_through_your_orbot_setup_markdown">
## Conecte-se através do Tor com o Orbot
\n\n1. Instale o [Orbot](https://play.google.com/store/apps/details?id=org.torproject.android)
\n2. Iniciar Orbot
\n3. No Orbot, verifique a porta Socks. O padrão usa 9050
\n4. Se necessário altere a porta no Orbot
\n5. Configure a porta Socks nesta tela
\n6. Pressione o botão Ativar para usar o Orbot como proxy
</string>
<string name="orbot_socks_port">Porta Socks Orbot</string>
<string name="invalid_port_number">Número de porta inválido</string>
<string name="use_orbot">Usar Orbot</string>
<string name="disconnect_from_your_orbot_setup">Desconectar Tor/Orbot</string>
<string name="app_notification_dms_channel_name">Mensagens privadas</string>
<string name="app_notification_dms_channel_description">Notifica você quando chega uma mensagem privada</string>
<string name="app_notification_zaps_channel_name">Zaps Recebidos</string>
<string name="app_notification_zaps_channel_description">Notifica quando alguém te manda um zap</string>
<string name="app_notification_zaps_channel_message">%1$s sats</string>
<string name="app_notification_zaps_channel_message_from">De %1$s</string>
<string name="app_notification_zaps_channel_message_for">por %1$s</string>
<string name="reply_notify">"Notificar: "</string>
<string name="channel_list_join_conversation">Entrar na conversa</string>
<string name="channel_list_user_or_group_id">ID do usuário ou grupo</string>
<string name="channel_list_user_or_group_id_demo">npub, nevent ou hex</string>
<string name="channel_list_create_channel">Criar</string>
<string name="channel_list_join_channel">Entrar</string>
<string name="today">Hoje</string>
<string name="content_warning">Aviso de conteúdo</string>
<string name="content_warning_explanation">Esta nota contém conteúdo sensível que algumas pessoas podem achar ofensivo ou perturbador</string>
<string name="content_warning_hide_all_sensitive_content">Sempre ocultar conteúdo sensível</string>
<string name="content_warning_show_all_sensitive_content">Sempre mostrar conteúdo sensível</string>
<string name="content_warning_see_warnings">Sempre mostrar avisos de conteúdo</string>
<string name="recommended_apps">"Recomenda: "</string>
<string name="filter_spam_from_strangers">Filtrar spam de estranhos</string>
<string name="warn_when_posts_have_reports_from_your_follows">Avise quando as postagens tiverem denuncias de seus seguidores</string>
<string name="new_reaction_symbol">Novo símbolo de reação</string>
<string name="no_reaction_type_setup_long_press_to_change">Nenhum tipo de reação selecionado. Pressione e segure para alterar</string>
<string name="zapraiser">Arrecadação de Zaps</string>
<string name="zapraiser_explainer">Adiciona uma quantidade alvo de sats para financiar esta postagem. Os clientes podem mostrar isso como uma barra de progresso para incentivar doações</string>
<string name="zapraiser_target_amount_in_sats">Valor alvo em Sats</string>
<string name="sats_to_complete">Arrecadação de Zaps em %1$s. %2$s sats para meta</string>
<string name="read_from_relay">Ler do Relay</string>
<string name="write_to_relay">Enviar para o Relay</string>
<string name="an_error_ocurred_trying_to_get_relay_information">Ocorreu um erro ao tentar obter informações do relay de %1$s</string>
<string name="owner">Proprietário</string>
<string name="version">Versão</string>
<string name="software">Programa</string>
<string name="contact">Contato</string>
<string name="supports">NIPs Suportados</string>
<string name="admission_fees">Taxas de admissão</string>
<string name="payments_url">URL de pagamentos</string>
<string name="limitations">Limitações</string>
<string name="countries">Países</string>
<string name="languages">Línguas</string>
<string name="tags">Tags</string>
<string name="posting_policy">Política de postagem</string>
<string name="message_length">Tamanho da mensagem</string>
<string name="subscriptions">Assinaturas</string>
<string name="filters">Filtros</string>
<string name="subscription_id_length">Comprimento do ID da assinatura</string>
<string name="minimum_prefix">Prefixo mínimo</string>
<string name="maximum_event_tags">Máximo de tags de evento</string>
<string name="content_length">Tamanho do conteúdo</string>
<string name="minimum_pow">PoW mínimo</string>
<string name="auth">Autenticação</string>
<string name="payment">Pagamento</string>
<string name="cashu">Token Cashu</string>
<string name="cashu_redeem">Resgatar</string>
<string name="live_stream_live_tag">AO VIVO</string>
<string name="live_stream_offline_tag">DESLIGADA</string>
<string name="live_stream_ended_tag">FINALIZADA</string>
<string name="live_stream_planned_tag">AGENDADA</string>
<string name="live_stream_is_offline">A transmissão ao vivo está offline</string>
<string name="live_stream_has_ended">Transmissão ao vivo encerrada</string>
<string name="are_you_sure_you_want_to_log_out">Sair exclui todas as suas informações locais. Certifique-se de fazer backup de suas chaves privadas para evitar a perda de sua conta. Você quer continuar?</string>
<string name="followed_tags">Tags Seguidas</string>
<string name="relay_setup">Relays</string>
<string name="discover_live">Ao vivo</string>
<string name="discover_community">Comunidade</string>
<string name="discover_chat">Chats</string>
<string name="community_approved_posts">Postagens Aprovadas</string>
<string name="groups_no_descriptor">Este grupo não tem uma descrição ou regras. Fale com o proprietário para adicionar</string>
<string name="community_no_descriptor">Esta comunidade não tem uma descrição. Fale com o proprietário para adicionar</string>
<string name="add_sensitive_content_label">Conteúdo sensível</string>
<string name="add_sensitive_content_description">Adiciona aviso de conteúdo sensível antes de mostrar este conteúdo</string>
<string name="settings">Configurações</string>
<string name="always">Sempre</string>
<string name="wifi_only">Somente wifi</string>
<string name="system">Sistema</string>
<string name="light">Claro</string>
<string name="dark">Escuro</string>
<string name="application_preferences">Preferências do aplicativo</string>
<string name="language">Linguagem</string>
<string name="theme">Tema</string>
<string name="automatically_load_images_gifs">Carregar imagens/gifs automaticamente</string>
<string name="automatically_play_videos">Reproduzir vídeos automaticamente</string>
<string name="automatically_show_url_preview">Mostrar automaticamente a visualização da URL</string>
<string name="load_image">Carregar imagem</string>
</resources>