From efe8def0c6a2e0d5476bf0652ee51c626063c69f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 09:57:07 +0200 Subject: [PATCH 1/3] New Crowdin Translations (automated) (#34897) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/en-GB.json | 4 ++++ app/javascript/mastodon/locales/pt-PT.json | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/app/javascript/mastodon/locales/en-GB.json b/app/javascript/mastodon/locales/en-GB.json index e5ca4d968f..77c5a30976 100644 --- a/app/javascript/mastodon/locales/en-GB.json +++ b/app/javascript/mastodon/locales/en-GB.json @@ -1,6 +1,7 @@ { "about.blocks": "Moderated servers", "about.contact": "Contact:", + "about.default_locale": "Default", "about.disclaimer": "Mastodon is free, open-source software, and a trademark of Mastodon gGmbH.", "about.domain_blocks.no_reason_available": "Reason not available", "about.domain_blocks.preamble": "Mastodon generally allows you to view content from and interact with users from any other server in the Fediverse. These are the exceptions that have been made on this particular server.", @@ -8,6 +9,7 @@ "about.domain_blocks.silenced.title": "Limited", "about.domain_blocks.suspended.explanation": "No data from this server will be processed, stored or exchanged, making any interaction or communication with users from this server impossible.", "about.domain_blocks.suspended.title": "Suspended", + "about.language_label": "Language", "about.not_available": "This information has not been made available on this server.", "about.powered_by": "Decentralised social media powered by {mastodon}", "about.rules": "Server rules", @@ -19,10 +21,12 @@ "account.block_domain": "Block domain {domain}", "account.block_short": "Block", "account.blocked": "Blocked", + "account.blocking": "Blocking", "account.cancel_follow_request": "Cancel follow", "account.copy": "Copy link to profile", "account.direct": "Privately mention @{name}", "account.disable_notifications": "Stop notifying me when @{name} posts", + "account.domain_blocking": "Blocking domain", "account.edit_profile": "Edit profile", "account.enable_notifications": "Notify me when @{name} posts", "account.endorse": "Feature on profile", diff --git a/app/javascript/mastodon/locales/pt-PT.json b/app/javascript/mastodon/locales/pt-PT.json index 7755267c35..7436b12afa 100644 --- a/app/javascript/mastodon/locales/pt-PT.json +++ b/app/javascript/mastodon/locales/pt-PT.json @@ -1,6 +1,7 @@ { "about.blocks": "Servidores moderados", "about.contact": "Contacto:", + "about.default_locale": "Padrão", "about.disclaimer": "O Mastodon é um software livre, de código aberto e uma marca registada de Mastodon gGmbH.", "about.domain_blocks.no_reason_available": "Motivo não disponível", "about.domain_blocks.preamble": "O Mastodon geralmente permite ver e interagir com o conteúdo de utilizadores de qualquer outra instância no fediverso. Estas são as exceções desta instância em específico.", @@ -8,6 +9,7 @@ "about.domain_blocks.silenced.title": "Limitados", "about.domain_blocks.suspended.explanation": "Nenhum dado deste servidor será processado, armazenado ou trocado, tornando impossível qualquer interação ou comunicação com os utilizadores a partir deste servidor.", "about.domain_blocks.suspended.title": "Suspensos", + "about.language_label": "Idioma", "about.not_available": "Esta informação não foi disponibilizada neste servidor.", "about.powered_by": "Rede social descentralizada baseada no {mastodon}", "about.rules": "Regras do servidor", @@ -308,6 +310,8 @@ "emoji_button.search_results": "Resultados da pesquisa", "emoji_button.symbols": "Símbolos", "emoji_button.travel": "Viagens e lugares", + "empty_column.account_featured.me": "Ainda não colocou nada em destaque. Sabia que pode destacar as etiquetas que mais utiliza e até as contas dos seus amigos no seu perfil?", + "empty_column.account_featured.other": "{acct} ainda não colocou nada em destaque. Sabia que pode destacar as etiquetas que mais utiliza e até as contas dos seus amigos no seu perfil?", "empty_column.account_featured_other.unknown": "Esta conta ainda não colocou nada em destaque.", "empty_column.account_hides_collections": "Este utilizador escolheu não disponibilizar esta informação", "empty_column.account_suspended": "Conta suspensa", @@ -341,6 +345,11 @@ "explore.trending_links": "Notícias", "explore.trending_statuses": "Publicações", "explore.trending_tags": "#Etiquetas", + "featured_carousel.header": "{count, plural, one {Publicação Afixada} other {Publicações Afixadas}}", + "featured_carousel.next": "Seguinte", + "featured_carousel.post": "Publicação", + "featured_carousel.previous": "Anterior", + "featured_carousel.slide": "{index} de {total}", "filter_modal.added.context_mismatch_explanation": "Esta categoria de filtro não se aplica ao contexto em que acedeste a esta publicação. Se pretenderes que esta publicação seja filtrada também neste contexto, terás que editar o filtro.", "filter_modal.added.context_mismatch_title": "O contexto não coincide!", "filter_modal.added.expired_explanation": "Esta categoria de filtro expirou, tens de alterar a data de validade para que ele seja aplicado.", From 6d12831686dab730cdc0068b23400fb342c02078 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 3 Jun 2025 04:00:50 -0400 Subject: [PATCH 2/3] Fix `Rails/OutputSafety` cop from rubocop todo via inline disable (#34893) --- .rubocop_todo.yml | 4 ---- config/initializers/simple_form.rb | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d77232c06f..23f407ada0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -27,10 +27,6 @@ Metrics/CyclomaticComplexity: Metrics/PerceivedComplexity: Max: 27 -Rails/OutputSafety: - Exclude: - - 'config/initializers/simple_form.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedVars. Style/FetchEnvVar: diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index a8bc4b1921..eb1605a8ec 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -5,7 +5,7 @@ module AppendComponent def append(_wrapper_options = nil) @append ||= begin - options[:append].to_s.html_safe if options[:append].present? + options[:append].to_s.html_safe if options[:append].present? # rubocop:disable Rails/OutputSafety end end end @@ -24,7 +24,7 @@ end module WarningHintComponent def warning_hint(_wrapper_options = nil) @warning_hint ||= begin - options[:warning_hint].to_s.html_safe if options[:warning_hint].present? + options[:warning_hint].to_s.html_safe if options[:warning_hint].present? # rubocop:disable Rails/OutputSafety end end end From 129e72b91494f30777cf4fa8a0905de2dccedba7 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 3 Jun 2025 17:06:32 +0200 Subject: [PATCH 3/3] Revert "Add telemetry for status / bio formatting (#32677)" (#34906) --- app/helpers/formatting_helper.rb | 18 +------ app/lib/text_formatter.rb | 87 ++++++++++++++------------------ 2 files changed, 39 insertions(+), 66 deletions(-) diff --git a/app/helpers/formatting_helper.rb b/app/helpers/formatting_helper.rb index e827834975..1b364a000c 100644 --- a/app/helpers/formatting_helper.rb +++ b/app/helpers/formatting_helper.rb @@ -27,14 +27,7 @@ module FormattingHelper module_function :extract_status_plain_text def status_content_format(status) - MastodonOTELTracer.in_span('HtmlAwareFormatter rendering') do |span| - span.add_attributes( - 'app.formatter.content.type' => 'status', - 'app.formatter.content.origin' => status.local? ? 'local' : 'remote' - ) - - html_aware_format(status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : [])) - end + html_aware_format(status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : [])) end def rss_status_content_format(status) @@ -46,14 +39,7 @@ module FormattingHelper end def account_bio_format(account) - MastodonOTELTracer.in_span('HtmlAwareFormatter rendering') do |span| - span.add_attributes( - 'app.formatter.content.type' => 'account_bio', - 'app.formatter.content.origin' => account.local? ? 'local' : 'remote' - ) - - html_aware_format(account.note, account.local?) - end + html_aware_format(account.note, account.local?) end def account_field_value_format(field, with_rel_me: true) diff --git a/app/lib/text_formatter.rb b/app/lib/text_formatter.rb index c1b0a81652..a7620fb74d 100644 --- a/app/lib/text_formatter.rb +++ b/app/lib/text_formatter.rb @@ -33,24 +33,17 @@ class TextFormatter def to_s return ''.html_safe if text.blank? - html = nil - MastodonOTELTracer.in_span('TextFormatter#to_s extract_and_rewrite') do - html = rewrite do |entity| - if entity[:url] - link_to_url(entity) - elsif entity[:hashtag] - link_to_hashtag(entity) - elsif entity[:screen_name] - link_to_mention(entity) - end + html = rewrite do |entity| + if entity[:url] + link_to_url(entity) + elsif entity[:hashtag] + link_to_hashtag(entity) + elsif entity[:screen_name] + link_to_mention(entity) end end - if multiline? - MastodonOTELTracer.in_span('TextFormatter#to_s simple_format') do - html = simple_format(html, {}, sanitize: false).delete("\n") - end - end + html = simple_format(html, {}, sanitize: false).delete("\n") if multiline? html.html_safe # rubocop:disable Rails/OutputSafety end @@ -106,54 +99,48 @@ class TextFormatter end def link_to_url(entity) - MastodonOTELTracer.in_span('TextFormatter#link_to_url') do - TextFormatter.shortened_link(entity[:url], rel_me: with_rel_me?) - end + TextFormatter.shortened_link(entity[:url], rel_me: with_rel_me?) end def link_to_hashtag(entity) - MastodonOTELTracer.in_span('TextFormatter#link_to_hashtag') do - hashtag = entity[:hashtag] - url = tag_url(hashtag) + hashtag = entity[:hashtag] + url = tag_url(hashtag) - <<~HTML.squish - - HTML - end + <<~HTML.squish + + HTML end def link_to_mention(entity) - MastodonOTELTracer.in_span('TextFormatter#link_to_mention') do - username, domain = entity[:screen_name].split('@') - domain = nil if local_domain?(domain) - account = nil + username, domain = entity[:screen_name].split('@') + domain = nil if local_domain?(domain) + account = nil - if preloaded_accounts? - same_username_hits = 0 + if preloaded_accounts? + same_username_hits = 0 - preloaded_accounts.each do |other_account| - same_username = other_account.username.casecmp(username).zero? - same_domain = other_account.domain.nil? ? domain.nil? : other_account.domain.casecmp(domain)&.zero? + preloaded_accounts.each do |other_account| + same_username = other_account.username.casecmp(username).zero? + same_domain = other_account.domain.nil? ? domain.nil? : other_account.domain.casecmp(domain)&.zero? - if same_username && !same_domain - same_username_hits += 1 - elsif same_username && same_domain - account = other_account - end + if same_username && !same_domain + same_username_hits += 1 + elsif same_username && same_domain + account = other_account end - else - account = entity_cache.mention(username, domain) end - - return "@#{h(entity[:screen_name])}" if account.nil? - - url = ActivityPub::TagManager.instance.url_for(account) - display_username = same_username_hits&.positive? || with_domains? ? account.pretty_acct : account.username - - <<~HTML.squish - @#{h(display_username)} - HTML + else + account = entity_cache.mention(username, domain) end + + return "@#{h(entity[:screen_name])}" if account.nil? + + url = ActivityPub::TagManager.instance.url_for(account) + display_username = same_username_hits&.positive? || with_domains? ? account.pretty_acct : account.username + + <<~HTML.squish + @#{h(display_username)} + HTML end def entity_cache