From eae5c7334ae61c463edd2e3cd03115b897f6e92b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 27 Oct 2023 12:20:40 -0400 Subject: [PATCH 01/38] Extract class from CSP configuration/initialization (#26905) --- app/lib/content_security_policy.rb | 59 ++++++++ .../initializers/content_security_policy.rb | 21 +-- spec/lib/content_security_policy_spec.rb | 129 ++++++++++++++++++ 3 files changed, 192 insertions(+), 17 deletions(-) create mode 100644 app/lib/content_security_policy.rb create mode 100644 spec/lib/content_security_policy_spec.rb diff --git a/app/lib/content_security_policy.rb b/app/lib/content_security_policy.rb new file mode 100644 index 0000000000..e8fcf76a65 --- /dev/null +++ b/app/lib/content_security_policy.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +class ContentSecurityPolicy + def base_host + Rails.configuration.x.web_domain + end + + def assets_host + url_from_configured_asset_host || url_from_base_host + end + + def media_host + cdn_host_value || assets_host + end + + private + + def url_from_configured_asset_host + Rails.configuration.action_controller.asset_host + end + + def cdn_host_value + s3_alias_host || s3_cloudfront_host || azure_alias_host || s3_hostname_host + end + + def url_from_base_host + host_to_url(base_host) + end + + def host_to_url(host_string) + uri_from_configuration_and_string(host_string) if host_string.present? + end + + def s3_alias_host + host_to_url ENV.fetch('S3_ALIAS_HOST', nil) + end + + def s3_cloudfront_host + host_to_url ENV.fetch('S3_CLOUDFRONT_HOST', nil) + end + + def azure_alias_host + host_to_url ENV.fetch('AZURE_ALIAS_HOST', nil) + end + + def s3_hostname_host + host_to_url ENV.fetch('S3_HOSTNAME', nil) + end + + def uri_from_configuration_and_string(host_string) + Addressable::URI.parse("#{host_protocol}://#{host_string}").tap do |uri| + uri.path += '/' unless uri.path.blank? || uri.path.end_with?('/') + end.to_s + end + + def host_protocol + Rails.configuration.x.use_https ? 'https' : 'http' + end +end diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index e5e672f2c7..8f8ea58028 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -6,24 +6,11 @@ # See the Securing Rails Applications Guide for more information: # https://guides.rubyonrails.org/security.html#content-security-policy-header -def host_to_url(str) - return if str.blank? +require_relative '../../app/lib/content_security_policy' - uri = Addressable::URI.parse("http#{Rails.configuration.x.use_https ? 's' : ''}://#{str}") - uri.path += '/' unless uri.path.blank? || uri.path.end_with?('/') - uri.to_s -end - -base_host = Rails.configuration.x.web_domain - -assets_host = Rails.configuration.action_controller.asset_host -assets_host ||= host_to_url(base_host) - -media_host = host_to_url(ENV['S3_ALIAS_HOST']) -media_host ||= host_to_url(ENV['S3_CLOUDFRONT_HOST']) -media_host ||= host_to_url(ENV['AZURE_ALIAS_HOST']) -media_host ||= host_to_url(ENV['S3_HOSTNAME']) if ENV['S3_ENABLED'] == 'true' -media_host ||= assets_host +policy = ContentSecurityPolicy.new +assets_host = policy.assets_host +media_host = policy.media_host def sso_host return unless ENV['ONE_CLICK_SSO_LOGIN'] == 'true' diff --git a/spec/lib/content_security_policy_spec.rb b/spec/lib/content_security_policy_spec.rb new file mode 100644 index 0000000000..2e92f815ac --- /dev/null +++ b/spec/lib/content_security_policy_spec.rb @@ -0,0 +1,129 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe ContentSecurityPolicy do + subject { described_class.new } + + around do |example| + original_asset_host = Rails.configuration.action_controller.asset_host + original_web_domain = Rails.configuration.x.web_domain + original_use_https = Rails.configuration.x.use_https + example.run + Rails.configuration.action_controller.asset_host = original_asset_host + Rails.configuration.x.web_domain = original_web_domain + Rails.configuration.x.use_https = original_use_https + end + + describe '#base_host' do + before { Rails.configuration.x.web_domain = 'host.example' } + + it 'returns the configured value for the web domain' do + expect(subject.base_host).to eq 'host.example' + end + end + + describe '#assets_host' do + context 'when asset_host is not configured' do + before { Rails.configuration.action_controller.asset_host = nil } + + context 'with a configured web domain' do + before { Rails.configuration.x.web_domain = 'host.example' } + + context 'when use_https is enabled' do + before { Rails.configuration.x.use_https = true } + + it 'returns value from base host with https protocol' do + expect(subject.assets_host).to eq 'https://host.example' + end + end + + context 'when use_https is disabled' do + before { Rails.configuration.x.use_https = false } + + it 'returns value from base host with http protocol' do + expect(subject.assets_host).to eq 'http://host.example' + end + end + end + end + + context 'when asset_host is configured' do + before do + Rails.configuration.action_controller.asset_host = 'https://assets.host.example' + end + + it 'returns full value from configured host' do + expect(subject.assets_host).to eq 'https://assets.host.example' + end + end + end + + describe '#media_host' do + context 'when there is no configured CDN' do + it 'defaults to using the assets_host value' do + expect(subject.media_host).to eq(subject.assets_host) + end + end + + context 'when an S3 alias host is configured' do + around do |example| + ClimateControl.modify S3_ALIAS_HOST: 'asset-host.s3-alias.example' do + example.run + end + end + + it 'uses the s3 alias host value' do + expect(subject.media_host).to eq 'https://asset-host.s3-alias.example' + end + end + + context 'when an S3 alias host with a trailing path is configured' do + around do |example| + ClimateControl.modify S3_ALIAS_HOST: 'asset-host.s3-alias.example/pathname' do + example.run + end + end + + it 'uses the s3 alias host value and preserves the path' do + expect(subject.media_host).to eq 'https://asset-host.s3-alias.example/pathname/' + end + end + + context 'when an S3 cloudfront host is configured' do + around do |example| + ClimateControl.modify S3_CLOUDFRONT_HOST: 'asset-host.s3-cloudfront.example' do + example.run + end + end + + it 'uses the s3 cloudfront host value' do + expect(subject.media_host).to eq 'https://asset-host.s3-cloudfront.example' + end + end + + context 'when an azure alias host is configured' do + around do |example| + ClimateControl.modify AZURE_ALIAS_HOST: 'asset-host.azure-alias.example' do + example.run + end + end + + it 'uses the azure alias host value' do + expect(subject.media_host).to eq 'https://asset-host.azure-alias.example' + end + end + + context 'when s3_enabled is configured' do + around do |example| + ClimateControl.modify S3_ENABLED: 'true', S3_HOSTNAME: 'asset-host.s3.example' do + example.run + end + end + + it 'uses the s3 hostname host value' do + expect(subject.media_host).to eq 'https://asset-host.s3.example' + end + end + end +end From 33f8c1c5eb075424eaba1263846efb09adfa89f5 Mon Sep 17 00:00:00 2001 From: Ricardo Trindade Date: Mon, 30 Oct 2023 15:04:12 +0100 Subject: [PATCH 02/38] Remove version check from update cache_concern.rb (#27592) --- app/controllers/concerns/cache_concern.rb | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/controllers/concerns/cache_concern.rb b/app/controllers/concerns/cache_concern.rb index 55ebe1bd64..2dfe5e263a 100644 --- a/app/controllers/concerns/cache_concern.rb +++ b/app/controllers/concerns/cache_concern.rb @@ -92,18 +92,10 @@ module CacheConcern arguments end - if Rails.gem_version >= Gem::Version.new('7.0') - def attributes_for_database(record) - attributes = record.attributes_for_database - attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr } - attributes - end - else - def attributes_for_database(record) - attributes = record.instance_variable_get(:@attributes).send(:attributes).transform_values(&:value_for_database) - attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr } - attributes - end + def attributes_for_database(record) + attributes = record.attributes_for_database + attributes.transform_values! { |attr| attr.is_a?(::ActiveModel::Type::Binary::Data) ? attr.to_s : attr } + attributes end def deserialize_record(class_name, attributes_from_database, new_record = false) # rubocop:disable Style/OptionalBooleanParameter From bf1d4529786d04527ae22055e22f7fe76a2b198a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:19:20 +0100 Subject: [PATCH 03/38] Update libretranslate/libretranslate Docker tag to v1.4.1 (#27616) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index f1945f8a64..137bebc599 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -70,7 +70,7 @@ services: hard: -1 libretranslate: - image: libretranslate/libretranslate:v1.4.0 + image: libretranslate/libretranslate:v1.4.1 restart: unless-stopped volumes: - lt-data:/home/libretranslate/.local From a918208ec61836f911bd9775d2f2dd6db72ac1a5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:19:25 +0100 Subject: [PATCH 04/38] New Crowdin Translations (automated) (#27596) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/he.json | 8 +-- config/locales/activerecord.he.yml | 2 +- config/locales/devise.he.yml | 24 ++++----- config/locales/es.yml | 4 ++ config/locales/fi.yml | 10 ++-- config/locales/he.yml | 2 +- config/locales/ko.yml | 12 ++--- config/locales/nl.yml | 12 ++--- config/locales/pl.yml | 8 +++ config/locales/simple_form.he.yml | 8 +-- config/locales/sl.yml | 70 +++++++++++++++++++++++++ config/locales/sq.yml | 8 +++ config/locales/sv.yml | 2 + config/locales/vi.yml | 8 +++ config/locales/zh-TW.yml | 2 +- 15 files changed, 140 insertions(+), 40 deletions(-) diff --git a/app/javascript/mastodon/locales/he.json b/app/javascript/mastodon/locales/he.json index 59cdb69a6c..c868655e15 100644 --- a/app/javascript/mastodon/locales/he.json +++ b/app/javascript/mastodon/locales/he.json @@ -202,7 +202,7 @@ "dismissable_banner.community_timeline": "אלו הם החצרוצים הציבוריים האחרונים מהמשתמשים על שרת {domain}.", "dismissable_banner.dismiss": "בטל", "dismissable_banner.explore_links": "אלו הקישורים האחרונים ששותפו על ידי משתמשים ששרת זה רואה ברשת המבוזרת כרגע.", - "dismissable_banner.explore_statuses": "ההודעות האלו, משרת זה ואחרים ברשת המבוזרת, צוברים חשיפה היום. הודעות חדשות יותר עם יותר הדהודים וחיבובים מדורגים יותר לגובה.", + "dismissable_banner.explore_statuses": "ההודעות האלו, משרת זה ואחרים ברשת המבוזרת, צוברים חשיפה היום. הודעות חדשות יותר עם יותר הדהודים וחיבובים מדורגים גבוה יותר.", "dismissable_banner.explore_tags": "התגיות האלו, משרת זה ואחרים ברשת המבוזרת, צוברות חשיפה כעת.", "dismissable_banner.public_timeline": "אלו ההודעות האחרונות שהתקבלו מהמשתמשים שנעקבים על ידי משתמשים מ־{domain}.", "embed.instructions": "ניתן להטמיע את ההודעה הזו באתרך ע\"י העתקת הקוד שלהלן.", @@ -315,7 +315,7 @@ "home.pending_critical_update.title": "יצא עדכון אבטחה חשוב!", "home.show_announcements": "הצג הכרזות", "interaction_modal.description.favourite": "עם חשבון מסטודון, ניתן לחבב את ההודעה כדי לומר למחבר/ת שהערכת את תוכנו או כדי לשמור אותו לקריאה בעתיד.", - "interaction_modal.description.follow": "עם חשבון מסטודון, ניתן לעקוב אחרי {name} כדי לקבל את הםוסטים שלו/ה בפיד הבית.", + "interaction_modal.description.follow": "עם חשבון מסטודון, ניתן לעקוב אחרי {name} כדי לקבל את הפוסטים שלו/ה בפיד הבית.", "interaction_modal.description.reblog": "עם חשבון מסטודון, ניתן להדהד את החצרוץ ולשתף עם עוקבים.", "interaction_modal.description.reply": "עם חשבון מסטודון, ניתן לענות לחצרוץ.", "interaction_modal.login.action": "קח אותי לדף הבית", @@ -493,7 +493,7 @@ "onboarding.steps.setup_profile.title": "התאמה אישית של הפרופיל", "onboarding.steps.share_profile.body": "ספרו לחברים איך למצוא אתכם במסטודון!", "onboarding.steps.share_profile.title": "לשתף פרופיל", - "onboarding.tips.2fa": "הידעת? ניתן לאבטח את החשבון ע\"י הקמת אימות בשני צעדים במסך מאפייני החשבון. השיטה תעבוד עם כל יישומון תואם TOTP על המגשיר שלך, אין צורך לתת לנו את מספר הטלפון!", + "onboarding.tips.2fa": "הידעת? ניתן לאבטח את החשבון ע\"י הקמת אימות דו-שלבי במסך מאפייני החשבון. השיטה תעבוד עם כל יישומון תואם TOTP על המכשיר שלך, ללא צורך במספר טלפון!", "onboarding.tips.accounts_from_other_servers": "הידעת? כיוון שמסטודון פועל ברשת מבוזרת, חלק מהפרופילים שתתקלו בהם פועלים משרתים אחרים משרת הבית שלכם. ניתן להיות איתם בקשר בצורה זהה לכל חשבון אחר! שם השרת שלהם הוא החלק השני של שם המשתמש שלהם!", "onboarding.tips.migration": "הידעת? אם תחליטו כי {domain} איננו שרת שמתאים לכם בעתיד, ניתן לעבור לשרת אחר מבלי לאבד עוקבים. תוכלו אפילו להקים שרת משלכן!", "onboarding.tips.verification": "הידעת? ניתן לאשרר את החשבון ע\"י קישור הפרופיל אל האתר שלכם ומהאתר חזרה לפרופיל. לא נדרשים תשלומים ומסמכים!", @@ -575,7 +575,7 @@ "report.thanks.title": "לא מעוניין/ת לראות את זה?", "report.thanks.title_actionable": "תודה על הדיווח, נבדוק את העניין.", "report.unfollow": "הפסיקו לעקוב אחרי @{name}", - "report.unfollow_explanation": "אתם עוקבים אחרי החשבון הזה. כדי להפסיק לראות את הפרסומים שלו בפיד הבית שלכם, הפסיקו לעקוב אחריהם.", + "report.unfollow_explanation": "אתם עוקבים אחרי החשבון הזה. כדי להפסיק לראות את הפרסומים שלו בפיד הבית שלכם, הפסיקו לעקוב אחריו.", "report_notification.attached_statuses": "{count, plural, one {הודעה מצורפת} two {הודעותיים מצורפות} many {{count} הודעות מצורפות} other {{count} הודעות מצורפות}}", "report_notification.categories.legal": "חוקי", "report_notification.categories.other": "שונות", diff --git a/config/locales/activerecord.he.yml b/config/locales/activerecord.he.yml index 54d0b0a1cc..211d984863 100644 --- a/config/locales/activerecord.he.yml +++ b/config/locales/activerecord.he.yml @@ -9,7 +9,7 @@ he: agreement: הסכם שירות email: כתובת דוא"ל locale: הגדרות אזוריות - password: סיסמא + password: סיסמה user/account: username: שם משתמש/ת user/invite_request: diff --git a/config/locales/devise.he.yml b/config/locales/devise.he.yml index 0f389bd383..e45f62b031 100644 --- a/config/locales/devise.he.yml +++ b/config/locales/devise.he.yml @@ -8,10 +8,10 @@ he: failure: already_authenticated: חשבון זה כבר מחובר. inactive: חשבון זה טרם הופעל. - invalid: "%{authentication_keys} או סיסמא לא נכונים." + invalid: "%{authentication_keys} או סיסמה לא נכונים." last_attempt: יש לך עוד ניסיון אחד לפני נעילת החשבון. locked: חשבון זה נעול. - not_found_in_database: "%{authentication_keys} או סיסמא לא נכונים." + not_found_in_database: "%{authentication_keys} או סיסמה לא נכונים." pending: חשבונך נמצא עדיין בבדיקה. timeout: פג תוקף השהיה בחשבון. נא להכנס מחדש על מנת להמשיך. unauthenticated: יש להרשם או להכנס לחשבון על מנת להמשיך. @@ -27,24 +27,24 @@ he: title: אימות כתובת דוא״ל email_changed: explanation: 'כתובת הדוא"ל של חשבונך שונתה ל:' - extra: אם לא שינית את כתובת הדוא"ל שלך, יכול להיות שמישהו השתלט על חשבונך. נא לשנות את הסיסמא מיידית או ליצור קשר עם מנהלי השרת אם ננעלת מחוץ לחשבון. + extra: אם לא שינית את כתובת הדוא"ל שלך, יכול להיות שמישהו השתלט על חשבונך. נא לשנות את הסיסמה שלך מיידית או ליצור קשר עם מנהלי השרת אם ננעלת מחוץ לחשבונך. subject: 'מסטודון: כתובת הדוא"ל שונתה' title: כתובת דוא״ל חדשה password_change: - explanation: הסיסמא לחשבונך שונתה. - extra: אם לא שינית את סיסמתך, יכול להיות שמישהו השתלט על חשבונך. נא לשנות את הסיסמא מיידית או ליצור קשר עם מנהלי השרת אם ננעלת מחוץ לחשבון. - subject: 'מסטודון: הסיסמא שונתה' - title: הסיסמא שונתה + explanation: הסיסמה לחשבונך שונתה. + extra: אם לא שינית את סיסמתך, יכול להיות שמישהו השתלט על חשבונך. נא לשנות את הסיסמה שלך מיידית או ליצור קשר עם מנהלי השרת אם ננעלת מחוץ לחשבונך. + subject: 'מסטודון: הסיסמה שונתה' + title: הסיסמה שונתה reconfirmation_instructions: explanation: נא לאמת את הכתובת הדוא"ל החדשה על מנת לשנותה. extra: אם שינוי זה לא בוצע על ידך, נא להתעלם מדוא"ל זה. כתובת הדוא"ל של חשבון המסטודון שלך לא תשונה אלא אם תלחץ הקישורית לעיל. subject: 'מסטודון: נא לאשר כתובת דוא"ל עבור %{instance}' title: אימות כתובת דוא״ל reset_password_instructions: - action: שינוי סיסמא - explanation: ביקשת סיסמא חדשה לחשבון. - extra: אם לא ביקשת את זה, נא להתעלם מדוא"ל זה. סיסמתך לא תשתנה עוד שתלחץ הקישורית לעיל ותיוצר סיסמא חדשה. - subject: 'מסטודון: הוראות לאיפוס סיסמא' + action: שינוי סיסמה + explanation: ביקשת סיסמה חדשה לחשבון שלך. + extra: אם לא ביקשת זאת, נא להתעלם מדוא"ל זה. סיסמתך לא תשתנה עוד שתלחץ הקישורית לעיל ותיוצר סיסמה חדשה. + subject: 'מסטודון: הוראות לאיפוס סיסמה' title: איפוס סיסמה two_factor_disabled: explanation: האימות הדו-גורמי לחשבונך בוטל. ניתן עתה להכנס לחשבון עם כתובת דוא"ל וסיסמא בלבד. @@ -81,7 +81,7 @@ he: failure: 'לא ניתן לאמת את חשבונך מ־%{kind} מהסיבה: "%{reason}".' success: נכשל אימות מחשבון %{kind}. passwords: - no_token: לא ניתן לגשת לעמוד זה, אלא מדוא"ל איפוס סיסמא. אם לא הגעת מדוא"ל איפוס סיסמא, יש לוודא שכתובת הקישורית הוקלדה בשלמותה. + no_token: לא ניתן לגשת לעמוד זה, אלא מדוא"ל איפוס סיסמה. אם הגעת מדוא"ל איפוס סיסמה, יש לוודא שכתובת הקישורית הוקלדה בשלמותה. send_instructions: בדקות הקרובות יתקבל דוא"ל עם הוראות לאיפוס סיסמתך. יש לבדוק את תיבת הספאם ליתר בטחון אם ההודעה לא הגיעה תוך דקות ספורות. send_paranoid_instructions: אם כתובת הדוא"ל שלך קיימת במסד הנתונים, יתקבל בדקות הקרובות דוא"ל עם הוראות לאחזור סיסמא. יש לבדוק את תיבת הספאם ליתר בטחון אם ההודעה לא הגיעה תוך דקות ספורות. updated: סיסמתך שונתה בהצלחה. הינך כעת במצב מחובר. diff --git a/config/locales/es.yml b/config/locales/es.yml index aab31747e7..d071e19a12 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1044,7 +1044,11 @@ es: awaiting_review: "¡Tu dirección de correo electrónico ha sido confirmada! El personal de %{domain} está revisando tu registro. ¡Recibirás un correo electrónico cuando aprueben tu cuenta!" awaiting_review_title: Estamos revisando tu registro clicking_this_link: haciendo clic en este enlace + login_link: iniciar sesión + proceed_to_login_html: Ahora puedes proceder a %{login_link}. + redirect_to_app_html: Serás redirigido a la aplicación %{app_name}. Si esto no sucede, prueba %{clicking_this_link} o regresa manualmente a la aplicación. registration_complete: "¡Has completado tu registro en %{domain}!" + welcome_title: "¡Bienvenido, %{name}!" wrong_email_hint: Si esa dirección de correo electrónico no es correcta, puedes cambiarla en la configuración de la cuenta. delete_account: Borrar cuenta delete_account_html: Si desea eliminar su cuenta, puede proceder aquí. Será pedido de una confirmación. diff --git a/config/locales/fi.yml b/config/locales/fi.yml index 4b4585f690..0f670847f4 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -534,7 +534,7 @@ fi: total_reported: Niitä koskevat raportit total_storage: Medialiitteet totals_time_period_hint_html: Alla näkyvät yhteenlasketut tiedot sisältävät koko ajan. - unknown_instance: Tällä palvelimella ei ole tällä hetkellä tähän verkkotunnukseen liittyviä tietueita. + unknown_instance: Tällä palvelimella ei tällä hetkellä ole tähän verkkotunnukseen liittyviä tietueita. invites: deactivate_all: Poista kaikki käytöstä filter: @@ -1041,13 +1041,13 @@ fi: hint_html: Vielä yksi juttu! Meidän on vahvistettava, että olet ihminen (tämän avulla pidämme roskapostin poissa!). Ratkaise alla oleva CAPTCHA-vahvistus ja paina "Jatka". title: Turvatarkastus confirmations: - awaiting_review: Sähköpostiosoitteesi on vahvistettu! Palvelun %{domain} ylläpito tarkistaa nyt rekisteröitymisesi. Saat sähköpostiviestin, jos tilisi hyväksytään! + awaiting_review: Sähköpostiosoitteesi on vahvistettu! Seuraavaksi palvelimen %{domain} ylläpito tarkistaa rekisteröitymisesi ja saat lopuksi ilmoituksen sähköpostitse, jos tilisi hyväksytään! awaiting_review_title: Rekisteröitymisesi on tarkistettavana - clicking_this_link: napsauttaa tätä linkkiä + clicking_this_link: tästä linkistä login_link: kirjautumalla sisään proceed_to_login_html: Voit nyt jatkaa %{login_link}. - redirect_to_app_html: Sinun olisi pitänyt ohjautua sovellukseen %{app_name}. Jos näin ei tapahtunut, kokeile %{clicking_this_link} tai palaa sovellukseen manuaalisesti. - registration_complete: Rekisteröitymisesi palveluun %{domain} on nyt valmis! + redirect_to_app_html: Sinun olisi pitänyt ohjautua sovellukseen %{app_name}. Jos näin ei tapahtunut, yritä avata se %{clicking_this_link} tai palaa sovellukseen manuaalisesti. + registration_complete: Rekisteröitymisesi palvelimelle %{domain} on suoritettu! welcome_title: Tervetuloa, %{name}! wrong_email_hint: Jos sähköpostiosoite ei ole oikein, voit muuttaa sen tilin asetuksista. delete_account: Poista tili diff --git a/config/locales/he.yml b/config/locales/he.yml index d987931f1e..2bd9f89c71 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1134,7 +1134,7 @@ he: new_confirmation_instructions_sent: אתם עומדים לקבל הודעת דואל חדשה עם קיש/ור אימות בדקות הקרובות! title: בדוק/בדקי את תיבת הדואר הנכנס שלך sign_in: - preamble_html: הכנס.י עם שם וסיסמא מאתר %{domain}. אם חשבונך מתארח בשרת אחר, לא ניתן להתחבר איתו פה. + preamble_html: הכנס.י עם שם וסיסמה מאתר %{domain}. אם חשבונך מתארח בשרת אחר, לא ניתן להתחבר איתו פה. title: התחבר אל %{domain} sign_up: manual_review: פתיחת חשבון אצל %{domain} עוברת בדיקה ידנית על ידי הצוות שלנו. כדי לסייע בתהליך הרישום שלכןם, כתבו לנו על עצמכןם ולמה אתןם רוצותים חשבון בשרת %{domain}. diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 1bcc8853e5..dc1b0d1f49 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1025,14 +1025,14 @@ ko: hint_html: 하나만 더! 당신이 사람인지 확인이 필요합니다 (스팸 계정을 거르기 위해서 필요한 과정입니다). 아래에 있는 CAPTCHA를 풀고 "계속"을 누르세요 title: 보안 체크 confirmations: - awaiting_review: 이메일 주소를 확인했어요! 이제 %{domain} 스태프가 가입을 검토해요. 계정이 승인되면 이메일을 보내드려요. - awaiting_review_title: 가입 검토 중 + awaiting_review: 이메일 주소가 확인되었습니다! 이제 %{domain} 스태프가 가입을 검토할 것입니다. 계정이 승인되면 이메일을 받게 됩니다! + awaiting_review_title: 가입 신청을 검토 중입니다 clicking_this_link: 이 링크를 클릭 login_link: 로그인 - proceed_to_login_html: "%{login_link} 할 수 있게 되었어요." - redirect_to_app_html: 곧 %{app_name}으로 리디렉션 되어요. 안 된다면, %{clicking_this_link}하거나 직접 앱으로 돌아가세요. - registration_complete: 지금 막 %{domain} 가입을 마쳤어요! - welcome_title: "%{name} 님 반가워요!" + proceed_to_login_html: 이제 %{login_link} 할 수 있습니다. + redirect_to_app_html: 곧 %{app_name}으로 리디렉션 됩니다. 안 된다면, %{clicking_this_link}하거나 직접 앱으로 돌아가세요. + registration_complete: 지금 막 %{domain} 가입이 완료되었습니다! + welcome_title: "%{name} 님 반갑습니다!" wrong_email_hint: 만약 이메일 주소가 올바르지 않다면, 계정 설정에서 수정할 수 있습니다. delete_account: 계정 삭제 delete_account_html: 계정을 삭제하고 싶은 경우, 여기서 삭제할 수 있습니다. 삭제 전 확인 화면이 표시됩니다. diff --git a/config/locales/nl.yml b/config/locales/nl.yml index d8a1c88656..2a8a59d764 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1041,14 +1041,14 @@ nl: hint_html: Nog maar één ding! Je moet bevestigen dat je een mens bent (dit is om de spam buiten de deur te houden!). Los de onderstaande CAPTCHA op en klik op "Doorgaan". title: Veiligheidscontrole confirmations: - awaiting_review: Je e-mailadres is bevestigd! De %{domain}-medewerkers zijn nu bezig met het bekijken van jouw registratie. Je ontvangt een e-mailbericht als ze jouw account goedkeuren! + awaiting_review: Je e-mailadres is bevestigd! De medewerkers van %{domain} zijn nu bezig met het beoordelen van jouw registratie. Je ontvangt een e-mailbericht wanneer ze jouw account goedkeuren! awaiting_review_title: Je registratie wordt beoordeeld - clicking_this_link: klik op deze koppeling - login_link: aanmelden + clicking_this_link: op deze link te klikken + login_link: inloggen proceed_to_login_html: Je kunt nu verder gaan naar %{login_link}. redirect_to_app_html: Je zou omgeleid moeten zijn naar de %{app_name} app. Als dat niet is gebeurd, probeer dan %{clicking_this_link} of keer handmatig terug naar de app. registration_complete: Je registratie op %{domain} is nu voltooid! - welcome_title: Welkom, %{name}! + welcome_title: Welkom %{name}! wrong_email_hint: Als dat e-mailadres niet correct is, kun je het wijzigen in je accountinstellingen. delete_account: Account verwijderen delete_account_html: Wanneer je jouw account graag wilt verwijderen, kun je dat hier doen. We vragen jou daar om een bevestiging. @@ -1581,8 +1581,8 @@ nl: over_total_limit: Je hebt de limiet van %{limit} in te plannen berichten overschreden too_soon: De datum voor het ingeplande bericht moet in de toekomst liggen self_destruct: - lead_html: Helaas gaat %{domain} permanent afsluiten. Als u daar een account had, kunt u deze niet meer gebruiken, maar u kunt nog steeds een back-up van uw gegevens opvragen. - title: Deze server gaat afsluiten + lead_html: Helaas gaat %{domain} permanent sluiten. Als je daar een account had, kun je deze niet meer gebruiken, maar je kunt nog steeds een back-up van je gegevens opvragen. + title: Deze server gaat sluiten sessions: activity: Laatst actief browser: Webbrowser diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 08df6e7fc9..e02cad0395 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1077,6 +1077,14 @@ pl: hint_html: Jeszcze jedno! Potrzebujemy potwierdzić twoje człowieczeństwo, żeby ograniczyć spam. Rozwiąż poniższą CAPTCHA-ę i naciśnij "Kontynuuj". title: Kontrola bezpieczeństwa confirmations: + awaiting_review: Twój adres e-mail został potwierdzony! Administracja %{domain} sprawdza Twoją rejestrację. Otrzymasz e-mail w momencie, gdy zaakceptują Twoje konto! + awaiting_review_title: Twoja rejestracja jest obecnie sprawdzana + clicking_this_link: kliknąć ten link + login_link: zaloguj się + proceed_to_login_html: Teraz możesz przejść do %{login_link}. + redirect_to_app_html: Powinieneś zostać przekierowany do aplikacji %{app_name}. Jeśli tak się nie stało, spróbuj %{clicking_this_link} lub ręcznie wróć do aplikacji. + registration_complete: Twoja rejestracja na %{domain} została zakończona! + welcome_title: Witaj, %{name}! wrong_email_hint: Jeśli ten adres e-mail nie jest poprawny, możesz go zmienić w ustawieniach konta. delete_account: Usunięcie konta delete_account_html: Jeżeli chcesz usunąć konto, przejdź tutaj. Otrzymasz prośbę o potwierdzenie. diff --git a/config/locales/simple_form.he.yml b/config/locales/simple_form.he.yml index d8d47fee61..581a66807f 100644 --- a/config/locales/simple_form.he.yml +++ b/config/locales/simple_form.he.yml @@ -180,9 +180,9 @@ he: bot: זהו חשבון מסוג בוט chosen_languages: סינון שפות confirm_new_password: אישור סיסמא חדשה - confirm_password: אישור סיסמא + confirm_password: אישור סיסמה context: סינון לפי הקשר - current_password: סיסמא נוכחית + current_password: סיסמה נוכחית data: מידע display_name: שם להצגה email: כתובת דוא"ל @@ -194,10 +194,10 @@ he: irreversible: הסרה במקום הסתרה locale: שפה max_uses: מספר מרבי של שימושים - new_password: סיסמא חדשה + new_password: סיסמה חדשה note: אודות otp_attempt: קוד אימות דו-שלבי - password: סיסמא + password: סיסמה phrase: מילת מפתח או ביטוי setting_advanced_layout: אפשר ממשק ווב מתקדם setting_aggregate_reblogs: קבץ הדהודים זהים diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 00c696f6fd..77ddfd6e2b 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -401,9 +401,11 @@ sl: cancel: Prekliči confirm: Suspendiraj permanent_action: Z razveljavitvijo suzpenza ne boste obnovili nobenih podatkov ali razmerij. + preamble_html: Suspendirali boste %{domain} in njene poddomene. remove_all_data: S tem boste odstranili celotno vsebino, medijske vsebine ter podatke iz profila za rčune te domene na vašem strežniku. stop_communication: Vaš strežnik bo prenehal komunicirati s temi strežniki. title: Potrdi domenski blok za %{domain} + undo_relationships: To bo prekinilo vse odnose sledenja med računi na teh strežnikih in na vašem strežniku. created_msg: Domenski blok se sedaj obdeluje destroyed_msg: Domenski blok je bil razveljavljen domain: Domena @@ -554,6 +556,7 @@ sl: total_reported: Prijave o njih total_storage: Predstavnostne priloge totals_time_period_hint_html: Spodaj prikazani seštevki vključujejo podatke za celotno obdobje. + unknown_instance: Trenutno ne obstaja zapis te domene na tem strežniku. invites: deactivate_all: Onemogoči vse filter: @@ -767,6 +770,9 @@ sl: branding: preamble: Blagovna znamka vašega strežnika ga loči od drugih strežnikov v omrežju. Podatki se lahko prikžejo prek številnih okolij, kot so spletni vmesnik Mastodona, domorodni programi, predogledi povezav na drugih spletiščih, aplikacije za sporočanje itn. Zatorej je najbolje, da te podatke ohranite jasne, kratke in pomenljive. title: Blagovne znamke + captcha_enabled: + desc_html: To se zanaša na zunanje skripte hCaptcha in lahko predstavlja tveganje za varnost in zasebnost. Poleg tega to lahko nekaterim ljudem (posebno invalidom) občutno oteži dostopnost registracijskega postopka. Zato svetujemo, da razmislite o drugih ukrepih, kot je na primer registracija na podlagi odobritve ali povabila. + title: Od novih uporabnikov zahtevaj reševanje CAPTCHA za potrditev računov content_retention: preamble: Nazdor nad hrambo vsebine uporabnikov v Mastodonu. title: Hramba vsebin @@ -795,13 +801,17 @@ sl: none: Nihče se ne more prijaviti open: Vsakdo se lahko prijavi security: + authorized_fetch: Od drugih strežnikov v federaciji zahtevaj overitev pristnosti + authorized_fetch_hint: Zahtevanje overitve pristnosti od drugih strežnikov v federaciji omogoči strožje uveljavljanje uporabniških in strežniških blokad. Vendar je cena za to počasnejše delovanje, zmanjšanje dosega vaših odgovorov in morebitne težave z združljivostjo z nekaterimi storitvami v federaciji. Poleg tega to odločenim akterjem ne bo preprečilo pridobivanja vaših javnih objav in računov. authorized_fetch_overridden_hint: Trenutno ne morete spremeniti te nastavitve, ker jo preglasi okoljska spremenljivka. + federation_authentication: Izvršba overitve pristnosti v federaciji title: Nastavitve strežnika site_uploads: delete: Izbriši naloženo datoteko destroyed_msg: Prenos na strežnik uspešno izbrisan! software_updates: critical_update: Kritično — čim prej posodobite + description: Vašo namestitev Mastodona je priporočeno vedno imeti posodobljeno in tako koristiti najnovejše popravke ter zmožnosti. Poleg tega je včasih nujno čim prej posodobiti Mastodon in se s tem izogniti varnostnim težavam. Zato Mastodon vsakih 30 minut preverja razpoložljivost posodobitev in vas o njih obvešča glede na vaše nastavitve obveščanja po e-pošti. documentation_link: Več o tem release_notes: Opombe ob izdaji title: Razpoložljive posodobitve @@ -851,10 +861,20 @@ sl: system_checks: database_schema_check: message_html: Na čakanju so migracije zbirke podatkov. Prosimo, izvedite jih, da zagotovite, da se program vede pričakovano + elasticsearch_health_red: + message_html: Z gručo Elasticsearch ni vse v redu (rdeče stanje), zmožnosti iskanja niso na voljo + elasticsearch_health_yellow: + message_html: Z gručo Elasticsearch ni vse v redu (rumeno stanje), priporočeno je ugotoviti razlog + elasticsearch_index_mismatch: + message_html: Preslikave kazala Elasticsearch so zastarele. Poženite tootctl search deploy --only=%{value} elasticsearch_preset: action: Glejte dokumentacijo + message_html: Vaša gruča Elasticsearch vsebuje več kot eno vozlišče, vendar Mastodon ni nastavljen, da bi jih uporabljal. elasticsearch_preset_single_node: action: Glejte dokumentacijo + message_html: Vaša gruča Elasticsearch vsebuje samo eno vozlišče, ES_PRESET bi moralo biti nastavljeno na single_node_cluster. + elasticsearch_reset_chewy: + message_html: Sistemsko kazalo Elasticsearch je zastarelo zaradi spremembe nastavitve. Za posodobitev poženite tootctl search deploy --reset-chewy. elasticsearch_running_check: message_html: Povezava z Elasticsearch ni uspela. Preverite, da deluje, ali onemogočite iskanje po vsem besedilu elasticsearch_version_check: @@ -867,6 +887,7 @@ sl: message_html: Noben proces Sidekiq ne poteka za %{value} vrst. Preglejte svojo prilagoditev Sidekiq software_version_critical_check: action: Glejte razpoložljive posodobitve + message_html: Na voljo je kritična posodobitev Mastodona. Posodobite čim prej. software_version_patch_check: action: Glejte razpoložljive posodobitve message_html: Na voljo je posodobitev Mastodona s popravki hroščev. @@ -991,6 +1012,9 @@ sl: body: "%{target} se pritožuje na moderatorsko odločitev %{action_taken_by} z dne %{date}, ki je bila %{type}. Zapisal/a je:" next_steps: Pritožbi lahko ugodite in s tem razveljavite moderatorsko odločitev ali pa jo prezrete. subject: "%{username} se je pritožil na moderatorsko odločitev na %{instance}" + new_critical_software_updates: + body: Izdane so bile nove kritične različice Mastodona. Priporočena je čimprejšnja posodobitev. + subject: Za %{instance} so na voljo kritične posodobitve Mastodona! new_pending_account: body: Podrobnosti o novem računu so navedene spodaj. To aplikacijo lahko odobrite ali zavrnete. subject: Nov račun za pregled na %{instance} (%{username}) @@ -998,6 +1022,9 @@ sl: body: "%{reporter} je prijavil %{target}" body_remote: Nekdo iz %{domain} je prijavil %{target} subject: Nove prijave za %{instance} (#%{id}) + new_software_updates: + body: Izdane so bile nove različice Mastodona. Priporočena je posodobitev. + subject: Za %{instance} so na voljo nove različice Mastodona. new_trends: body: 'Naslednji elementi potrebujejo pregled, preden jih je možno javno prikazati:' new_trending_links: @@ -1046,8 +1073,18 @@ sl: auth: apply_for_account: Zaprosite za račun captcha_confirmation: + help_html: Če imate težave pri reševanju CAPTCHA, lahko prek %{email} stopite v stik z nami in pomagali vam bomo. + hint_html: Samo še nekaj. Moramo se prepričati, da ste človek (to nam pomaga pri preprečevanju neželenih vsebin). Rešite spodnji CAPTCHA in kliknite »Nadaljuj«. title: Varnostno preverjanje confirmations: + awaiting_review: Vaš e-poštni naslov je potrjen. Skrbniki %{domain} bodo pregledali vašo prijavo. Če odobrijo vaš račun, boste o tem prejeli e-pošto. + awaiting_review_title: Vaša prijava se pregleduje + clicking_this_link: s klikom na to povezavo + login_link: prijavo + proceed_to_login_html: Sedaj lahko nadaljujete na %{login_link}. + redirect_to_app_html: Morali bi biti preusmerjeni na aplikacijo %{app_name}. Če se to ni zgodilo, poskusite %{clicking_this_link} ali pa se ročno vrnite na aplikacijo. + registration_complete: Vaša prijava na %{domain} je sedaj zaključena. + welcome_title: Pozdravljeni, %{name}! wrong_email_hint: Če ta e-poštni naslov ni pravilen, ga lahko spremenite v nastavitvah računa. delete_account: Izbriši račun delete_account_html: Če želite izbrisati svoj račun, lahko nadaljujete tukaj. Prosili vas bomo za potrditev. @@ -1083,7 +1120,9 @@ sl: rules: accept: Sprejmi back: Nazaj + invited_by: "%{domain} se lahko pridružite zahvaljujoč povabilu, ki ste ga prejeli od:" preamble: Slednje določajo in njihovo spoštovanje zagotavljajo moderatorji %{domain}. + preamble_invited: Preden nadaljujete, si preberite osnovna pravila, ki so jih postavili moderatorji na %{domain}. title: Nekaj osnovnih pravil. title_invited: Ste povabljeni. security: Varnost @@ -1107,6 +1146,7 @@ sl: functional: Vaš račun je polno opravilen. pending: Naše osebje preverja vašo prijavo. To lahko traja nekaj časa. Če bo vaša prijava odobrena, boste prejeli e-pošto. redirecting_to: Vaš račun ni dejaven, ker trenutno preusmerja na račun %{acct}. + self_destruct: Ker se %{domain} zapira, boste imeli omejen dostop da svojega računa. view_strikes: Pokaži pretekle ukrepe proti mojemu računu too_fast: Obrazec oddan prehitro, poskusite znova. use_security_key: Uporabi varnostni ključ @@ -1188,6 +1228,7 @@ sl: invalid_domain: ni veljavno ime domene edit_profile: basic_information: Osnovni podatki + hint_html: "Prilagodite, kaj ljudje vidijo na vašem javnem profilu in poleg vaših objav. Drugi vam bodo raje sledili nazaj in z vami klepetali, če boste imeli izpolnjen profil in nastavljeno profilno sliko." other: Drugo errors: '400': Zahteva, ki ste jo oddali, je neveljavna ali nepravilno oblikovana. @@ -1322,6 +1363,20 @@ sl: merge_long: Ohrani obstoječe zapise in dodaj nove overwrite: Prepiši overwrite_long: Zamenjaj trenutne zapise z novimi + overwrite_preambles: + blocking_html: Svoj seznam blokiranih računov boste nadomestili z največ %{total_items} računi iz %{filename}. + bookmarks_html: Svoje zaznamke boste nadomestili z največ %{total_items} objavami iz %{filename}. + domain_blocking_html: Svoj seznam blokiranih domen boste nadomestili z največ %{total_items} domenami iz %{filename}. + following_html: "Začeli boste slediti največ %{total_items} računom iz %{filename} in prenehali slediti vsem ostalim." + lists_html: Svoje sezname boste nadomestili z vsebino datoteke %{filename}. Največ %{total_items} računov bo dodanih na nove sezname. + muting_html: Svoj seznam utišanih računov boste nadomestili z največ %{total_items} računi iz %{filename}. + preambles: + blocking_html: "Blokirali boste največ %{total_items} računov iz %{filename}." + bookmarks_html: "Med zaznamke boste dodali boste največ %{total_items} objav iz %{filename}." + domain_blocking_html: "Blokirali boste največ %{total_items} domen iz %{filename}." + following_html: "Začeli boste slediti največ %{total_items} računom iz %{filename}." + lists_html: Dodali boste največ %{total_items} računov iz %{filename} na svoje sezname. Po potrebi bodo ustvarjeni novi seznami. + muting_html: "Utišali boste največ %{total_items} računov iz %{filename}." preface: Podatke, ki ste jih izvozili iz drugega strežnika, lahko uvozite. Na primer seznam oseb, ki jih spremljate ali blokirate. recent_imports: Nedavni uvozi states: @@ -1393,6 +1448,7 @@ sl: unsubscribe: action: Da, odjavi me complete: Odjavljeni + confirmation_html: Ali se res želite odjaviti od prejemanja %{type} za Mastodon na %{domain} na svojo e-pošto %{email}? Kadarkoli se lahko znova prijavite iz svojih nastavitev e-poštnih obvestil. emails: notification_emails: favourite: e-sporočil z obvestili o priljubljenosti @@ -1400,6 +1456,7 @@ sl: follow_request: e-sporočil o zahtevah za sledenje mention: e-sporočil z obvestili o omembah reblog: e-sporočil z obvestili o izpostavljanju + resubscribe_html: Če ste se odjavili po pomoti, se lahko znova prijavite iz svojih nastavitev e-poštnih obvestil. success_html: Nič več ne boste prejemali %{type} za Mastodon na %{domain} na svoj e-naslov %{email}. title: Odjavi od naročnine media_attachments: @@ -1526,9 +1583,13 @@ sl: posting_defaults: Privzete nastavitev objavljanja public_timelines: Javne časovnice privacy: + hint_html: "Prilagodite, kako lahko drugi najdejo vaš profil in vaše objave. V Mastodonu obstaja več zmožnosti, ki vam pomagajo doseči širše občinstvo, če so omogočene. Vzemite si čas in preverite, ali te nastavitve ustrezajo vašemu namenu uporabe." privacy: Zasebnost + privacy_hint_html: Nadzorujte, koliko informacij želite razkriti drugim. Ljudje lahko zanimive profile in aplikacije odkrijejo z brskanjem po seznamih sledenih in ko vidijo katere programe drugi uporabljajo za objavljanje. Morda pa bi to želeli skriti in varovati zasebnost. reach: Dosegljivost + reach_hint_html: Nadzorujte, ali želite, da vas drugi ljudje najdejo in vam pričnejo slediti. Ali želite, da se vaše objave prikažejo na strani Razišči? Ali želite, da vas drugi ljudje vidijo med predlogi za sledenje? Ali želite nove sledilce odobriti samodejno, ali vsakega posebej odobriti ročno? search: Iskanje + search_hint_html: Nadzorujte, kako želite, da vas najdejo. Ali želite, da vas ljudje najdejo po javnih objavah? Ali želite, da ljudje, ki niso na Mastodonu, lahko najdejo vaš profil med iskanjem po spletu? Vedite, da javnih objav in podatkov ni mogoče povsem izvzeti iz podatkovnih zbirk vseh spletnih iskalnikov. title: Zasebnost in dosegljivost privacy_policy: title: Pravilnik o zasebnosti @@ -1571,6 +1632,9 @@ sl: over_daily_limit: Za ta dan ste presegli omejitev %{limit} načrtovanih objav over_total_limit: Presegli ste omejitev %{limit} načrtovanih objav too_soon: Načrtovani datum mora biti v prihodnosti + self_destruct: + lead_html: Na žalost se %{domain} za vedno zapira. Če ste tu imeli svoj račun, ga v prihodnje ne boste mogli več uporabljati. Zahtevate lahko kopijo svojih podatkov. + title: Ta strežnik se zapira sessions: activity: Zadnja dejavnost browser: Brskalnik @@ -1752,6 +1816,10 @@ sl: month: "%b %Y" time: "%H:%M" with_time_zone: "%d. %b. %Y %H:%M %Z" + translation: + errors: + quota_exceeded: Kvota uporabe prevajalne storitve za ta strežnik je bila presežena. + too_many_requests: V zadnjem času je prevajalna storitev prejela preveč zahtevkov. two_factor_authentication: add: Dodaj disable: Onemogoči @@ -1837,7 +1905,9 @@ sl: seamless_external_login: Prijavljeni ste prek zunanje storitve, tako da nastavitve gesla in e-pošte niso na voljo. signed_in_as: 'Vpisani kot:' verification: + extra_instructions_html: Nasvet: Povezava na vaši spletni strani je lahko nevidna. Pomembni del je atribut rel="me", ki preprečuje lažno predstavljanje na spletnih straneh z uporabniško ustvarjeno vsebino. Namesto oznake a lahko uporabite tudi oznako link znotraj glave (head) spletne strani, vendar mora biti HTML dosegljiv brez izvajanja skript JavaScript. here_is_how: Kako to poteka + hint_html: "Vsakdo lahko potrdi svojo istovetnost na Mastodonu. To temelji na odprtih spletnih standardih in je sedaj in za vedno brezplačno. Potrebujete le osebno spletno stran, po kateri vas ljudje prepoznajo. Ko na svoj profil dodate povezavo na to osebno spletno stran, bo Mastodon preveril, ali na njej obstaja povezava nazaj na profil. Če ta obstaja, bo to vidno na profiu." instructions_html: Spodnjo kodo kopirajte in prilepite v HTML svojega spletnega mesta. Nato dodajte naslov svoje spletne strani v eno od dodatnih polj v svojem profilu v zavihku »Uredi profil« in shranite spremembe. verification: Potrditev verified_links: Vaše preverjene povezave diff --git a/config/locales/sq.yml b/config/locales/sq.yml index 74810b147a..e4fb811ce3 100644 --- a/config/locales/sq.yml +++ b/config/locales/sq.yml @@ -1035,6 +1035,14 @@ sq: hint_html: Edhe një gjë tjetër! Na duhet të ripohoni se jeni qenie njerëzore (që të mbajmë larg mesazhe të padëshiruar!). Zgjidhni CAPTCHA-n më poshtë dhe klikoni mbi “Vazhdo”. title: Kontroll sigurie confirmations: + awaiting_review: Adresa juaj email u ripohua! Ekipi i %{domain} stani po bën regjistrimin tuaj. Nëse e miratojnë llogarinë tuaj, do të merrni një email! + awaiting_review_title: Regjistrimi juaj po merret në shqyrtim + clicking_this_link: duke klikuar këtë lidhje + login_link: hyni + proceed_to_login_html: Tani mund të vazhdoni të %{login_link}. + redirect_to_app_html: Duhet të ishit ridrejtuar te aplikacioni %{app_name}. Nëse s’ndodhi, provoni %{clicking_this_link}, ose të ktheheni dorazi te aplikacioni. + registration_complete: Tanimë është plotësuar regjistrimi juaj në %{domain}! + welcome_title: Mirë se vini, %{name}! wrong_email_hint: Nëse ajo adresë email s’është e saktë, mund ta ndryshoni te rregullimet e llogarisë. delete_account: Fshije llogarinë delete_account_html: Nëse dëshironi të fshihni llogarinë tuaj, mund ta bëni që këtu. Do t’ju kërkohet ta ripohoni. diff --git a/config/locales/sv.yml b/config/locales/sv.yml index 1d84f8a6af..a6ee12ba27 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1044,6 +1044,8 @@ sv: awaiting_review_title: Din registrering är under granskning clicking_this_link: klicka på denna länk login_link: logga in + proceed_to_login_html: Du kan nu fortsätta med att %{login_link}. + redirect_to_app_html: Du borde ha omdirigerats till appen %{app_name}. Om det inte hände, försök att %{clicking_this_link} eller återgå manuellt till appen. registration_complete: Din registrering på %{domain} är nu slutförd! welcome_title: Välkommen %{name}! wrong_email_hint: Om e-postadressen inte är rätt, kan du ändra den i kontoinställningarna. diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 79ec13571d..ec8f6c1395 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1023,6 +1023,14 @@ vi: hint_html: Còn một xíu nữa! Chúng tôi cần xác minh bạn là con người (để chúng tôi có thể ngăn chặn thư rác!). Nhập CAPTCHA bên dưới và nhấn "Tiếp tục". title: Kiểm tra an toàn confirmations: + awaiting_review: Đã xác minh email của bạn! Kiểm duyệt viên %{domain} đang xem xét đăng ký của bạn. Bạn sẽ nhận được một email nếu tài khoản của bạn được duyệt! + awaiting_review_title: Đăng ký của bạn đang chờ duyệt + clicking_this_link: nhấn vào link này + login_link: đăng nhập + proceed_to_login_html: Bạn có thể tiếp tục %{login_link}. + redirect_to_app_html: Bạn đã có thể chuyển tiếp tới %{app_name}. Nếu không có gì xảy ra, thử %{clicking_this_link} hoặc tự quay lại app. + registration_complete: Hoàn tất đăng ký trên %{domain}! + welcome_title: Chào mừng, %{name}! wrong_email_hint: Nếu địa chỉ email đó không chính xác, bạn có thể thay đổi nó trong cài đặt tài khoản. delete_account: Xóa tài khoản delete_account_html: Nếu bạn muốn xóa tài khoản của mình, hãy yêu cầu tại đây. Bạn sẽ được yêu cầu xác nhận. diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 9d75f50a50..7bcc133964 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1027,7 +1027,7 @@ zh-TW: confirmations: awaiting_review: 已驗證您的電子郵件!%{domain} 的管理員正在審核您的註冊申請。若您的帳號通過審核,您將收到電子郵件通知。 awaiting_review_title: 我們正在審核您的註冊申請 - clicking_this_link: 點擊這個連結 + clicking_this_link: 點擊此連結 login_link: 登入 proceed_to_login_html: 您現在可以前往 %{login_link}。 redirect_to_app_html: 您應被重新導向至 %{app_name} 應用程式。如尚未重新導向,請嘗試 %{clicking_this_link} 或手動回到應用程式。 From c2cc1df5efd174677ab4ecd4002735c315d6dadc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 23:30:02 +0100 Subject: [PATCH 05/38] Update dependency @types/react to v18.2.33 (#27615) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 44abf3f61d..9bf6fba3d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2512,9 +2512,9 @@ "@types/react" "*" "@types/react@*", "@types/react@16 || 17 || 18", "@types/react@>=16.9.11", "@types/react@^18.0.26", "@types/react@^18.2.7": - version "18.2.31" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.31.tgz#74ae2630e4aa9af599584157abd3b95d96fb9b40" - integrity sha512-c2UnPv548q+5DFh03y8lEDeMfDwBn9G3dRwfkrxQMo/dOtRHUUO57k6pHvBIfH/VF4Nh+98mZ5aaSe+2echD5g== + version "18.2.33" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.33.tgz#055356243dc4350a9ee6c6a2c07c5cae12e38877" + integrity sha512-v+I7S+hu3PIBoVkKGpSYYpiBT1ijqEzWpzQD62/jm4K74hPpSP7FF9BnKG6+fg2+62weJYkkBWDJlZt5JO/9hg== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" From 547d3c1b9bf569f83d43faa4ac2c908b09bae5d3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 23:30:26 +0100 Subject: [PATCH 06/38] Update dependency core-js to v3.33.2 (#27624) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9bf6fba3d4..c398aef27e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4411,9 +4411,9 @@ core-js@^2.5.0: integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== core-js@^3.30.2: - version "3.33.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.33.1.tgz#ef3766cfa382482d0a2c2bc5cb52c6d88805da52" - integrity sha512-qVSq3s+d4+GsqN0teRCJtM6tdEEXyWxjzbhVrCHmBS5ZTM0FS2MOS0D13dUXAWDUN6a+lHI/N1hF9Ytz6iLl9Q== + version "3.33.2" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.33.2.tgz#312bbf6996a3a517c04c99b9909cdd27138d1ceb" + integrity sha512-XeBzWI6QL3nJQiHmdzbAOiMYqjrb7hwU7A39Qhvd/POSa/t9E1AeZyEZx3fNvp/vtM8zXwhoL0FsiS0hD0pruQ== core-util-is@~1.0.0: version "1.0.3" From 372494e553a841ad6753eac066b171f32e087e30 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 23:31:22 +0100 Subject: [PATCH 07/38] Update dependency punycode to v2.3.1 (#27625) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c398aef27e..dfd1991147 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10075,9 +10075,9 @@ punycode@1.4.1, punycode@^1.2.4, punycode@^1.4.1: integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== punycode@^2.1.0, punycode@^2.1.1, punycode@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" - integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== pure-rand@^6.0.0: version "6.0.2" From b8adb08f92fde81d22fa70860bc5704d0272c4ec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 23:31:32 +0100 Subject: [PATCH 08/38] Update dependency axios to v1.6.0 (#27580) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index dfd1991147..7ca344e6dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3410,9 +3410,9 @@ axe-core@^4.6.2: integrity sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g== axios@^1.4.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.5.1.tgz#11fbaa11fc35f431193a9564109c88c1f27b585f" - integrity sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A== + version "1.6.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.0.tgz#f1e5292f26b2fd5c2e66876adc5b06cdbd7d2102" + integrity sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg== dependencies: follow-redirects "^1.15.0" form-data "^4.0.0" From 6c52f8286b335248162035acf86635c63cfc9222 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 30 Oct 2023 23:32:25 +0100 Subject: [PATCH 09/38] Fix posts from force-sensitized accounts being able to trend (#27620) --- app/models/trends/statuses.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/trends/statuses.rb b/app/models/trends/statuses.rb index 427fa8e797..c47fb8427b 100644 --- a/app/models/trends/statuses.rb +++ b/app/models/trends/statuses.rb @@ -106,7 +106,7 @@ class Trends::Statuses < Trends::Base private def eligible?(status) - status.public_visibility? && status.account.discoverable? && !status.account.silenced? && status.spoiler_text.blank? && !status.sensitive? && !status.reply? && valid_locale?(status.language) + status.public_visibility? && status.account.discoverable? && !status.account.silenced? && !status.account.sensitized? && status.spoiler_text.blank? && !status.sensitive? && !status.reply? && valid_locale?(status.language) end def calculate_scores(statuses, at_time) From beee9ea9915f8ef93e35ace45b9fcc34e9dc5f4d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 31 Oct 2023 04:22:19 -0400 Subject: [PATCH 10/38] Fix `RSpec/LetSetup` cop in spec/controllers/admin area (#27619) --- .rubocop_todo.yml | 5 ----- .../admin/accounts_controller_spec.rb | 5 ++++- .../admin/action_logs_controller_spec.rb | 4 ++-- .../admin/instances_controller_spec.rb | 4 ++-- .../admin/reports/actions_controller_spec.rb | 18 ++++++++++++------ .../admin/statuses_controller_spec.rb | 7 ++++--- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9609923434..6409181601 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -130,11 +130,6 @@ RSpec/InstanceVariable: RSpec/LetSetup: Exclude: - - 'spec/controllers/admin/accounts_controller_spec.rb' - - 'spec/controllers/admin/action_logs_controller_spec.rb' - - 'spec/controllers/admin/instances_controller_spec.rb' - - 'spec/controllers/admin/reports/actions_controller_spec.rb' - - 'spec/controllers/admin/statuses_controller_spec.rb' - 'spec/controllers/api/v1/accounts/statuses_controller_spec.rb' - 'spec/controllers/api/v1/filters_controller_spec.rb' - 'spec/controllers/api/v2/admin/accounts_controller_spec.rb' diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb index 782e460a42..b57ec67141 100644 --- a/spec/controllers/admin/accounts_controller_spec.rb +++ b/spec/controllers/admin/accounts_controller_spec.rb @@ -285,7 +285,10 @@ RSpec.describe Admin::AccountsController do let(:current_user) { Fabricate(:user, role: role) } let(:account) { Fabricate(:account, suspended: true) } - let!(:email_block) { Fabricate(:canonical_email_block, reference_account: account) } + + before do + _email_block = Fabricate(:canonical_email_block, reference_account: account) + end context 'when user is admin' do let(:role) { UserRole.find_by(name: 'Admin') } diff --git a/spec/controllers/admin/action_logs_controller_spec.rb b/spec/controllers/admin/action_logs_controller_spec.rb index 044ddf2c42..b7854469dd 100644 --- a/spec/controllers/admin/action_logs_controller_spec.rb +++ b/spec/controllers/admin/action_logs_controller_spec.rb @@ -8,8 +8,8 @@ describe Admin::ActionLogsController do # Action logs typically cause issues when their targets are not in the database let!(:account) { Fabricate(:account) } - let!(:orphaned_logs) do - %w( + before do + _orphaned_logs = %w( Account User UserRole Report DomainBlock DomainAllow EmailDomainBlock UnavailableDomain Status AccountWarning Announcement IpBlock Instance CustomEmoji CanonicalEmailBlock Appeal diff --git a/spec/controllers/admin/instances_controller_spec.rb b/spec/controllers/admin/instances_controller_spec.rb index 5fed5d98d2..74d69d1aaa 100644 --- a/spec/controllers/admin/instances_controller_spec.rb +++ b/spec/controllers/admin/instances_controller_spec.rb @@ -8,10 +8,10 @@ RSpec.describe Admin::InstancesController do let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) } let!(:account_popular_main) { Fabricate(:account, domain: 'popular') } - let!(:account_popular_other) { Fabricate(:account, domain: 'popular') } - let!(:account_less_popular) { Fabricate(:account, domain: 'less.popular') } before do + _account_less_popular = Fabricate(:account, domain: 'less.popular') + _account_popular_other = Fabricate(:account, domain: 'popular') sign_in current_user, scope: :user end diff --git a/spec/controllers/admin/reports/actions_controller_spec.rb b/spec/controllers/admin/reports/actions_controller_spec.rb index 1f3951516d..06d4b31f54 100644 --- a/spec/controllers/admin/reports/actions_controller_spec.rb +++ b/spec/controllers/admin/reports/actions_controller_spec.rb @@ -54,13 +54,16 @@ describe Admin::Reports::ActionsController do describe 'POST #create' do let(:target_account) { Fabricate(:account) } let(:statuses) { [Fabricate(:status, account: target_account), Fabricate(:status, account: target_account)] } - let!(:media) { Fabricate(:media_attachment, account: target_account, status: statuses[0]) } let(:report) { Fabricate(:report, target_account: target_account, status_ids: statuses.map(&:id)) } let(:text) { 'hello' } let(:common_params) do { report_id: report.id, text: text } end + before do + _media = Fabricate(:media_attachment, account: target_account, status: statuses[0]) + end + shared_examples 'common behavior' do it 'closes the report and redirects' do expect { subject }.to mark_report_action_taken.and create_target_account_strike @@ -122,14 +125,17 @@ describe Admin::Reports::ActionsController do let(:action) { 'mark_as_sensitive' } let(:statuses) { [media_attached_status, media_attached_deleted_status] } - let!(:status) { Fabricate(:status, account: target_account) } let(:media_attached_status) { Fabricate(:status, account: target_account) } - let!(:media_attachment) { Fabricate(:media_attachment, account: target_account, status: media_attached_status) } let(:media_attached_deleted_status) { Fabricate(:status, account: target_account, deleted_at: 1.day.ago) } - let!(:media_attachment2) { Fabricate(:media_attachment, account: target_account, status: media_attached_deleted_status) } let(:last_media_attached_status) { Fabricate(:status, account: target_account) } - let!(:last_media_attachment) { Fabricate(:media_attachment, account: target_account, status: last_media_attached_status) } - let!(:last_status) { Fabricate(:status, account: target_account) } + + before do + _last_media_attachment = Fabricate(:media_attachment, account: target_account, status: last_media_attached_status) + _last_status = Fabricate(:status, account: target_account) + _media_attachment = Fabricate(:media_attachment, account: target_account, status: media_attached_status) + _media_attachment2 = Fabricate(:media_attachment, account: target_account, status: media_attached_deleted_status) + _status = Fabricate(:status, account: target_account) + end it_behaves_like 'common behavior' diff --git a/spec/controllers/admin/statuses_controller_spec.rb b/spec/controllers/admin/statuses_controller_spec.rb index 9befdf978f..dc5e28e972 100644 --- a/spec/controllers/admin/statuses_controller_spec.rb +++ b/spec/controllers/admin/statuses_controller_spec.rb @@ -9,13 +9,14 @@ describe Admin::StatusesController do let(:account) { Fabricate(:account) } let!(:status) { Fabricate(:status, account: account) } let(:media_attached_status) { Fabricate(:status, account: account, sensitive: !sensitive) } - let!(:media_attachment) { Fabricate(:media_attachment, account: account, status: media_attached_status) } let(:last_media_attached_status) { Fabricate(:status, account: account, sensitive: !sensitive) } - let!(:last_media_attachment) { Fabricate(:media_attachment, account: account, status: last_media_attached_status) } - let!(:last_status) { Fabricate(:status, account: account) } let(:sensitive) { true } before do + _last_media_attachment = Fabricate(:media_attachment, account: account, status: last_media_attached_status) + _last_status = Fabricate(:status, account: account) + _media_attachment = Fabricate(:media_attachment, account: account, status: media_attached_status) + sign_in user, scope: :user end From 204c00b5c63c088e8a673ec9cf703097d549fbd5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 08:24:04 +0000 Subject: [PATCH 11/38] Update dependency bootsnap to '~> 1.17.0' (#27617) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index c935b5410f..b8fcbaa886 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'blurhash', '~> 0.1' gem 'active_model_serializers', '~> 0.10' gem 'addressable', '~> 2.8' -gem 'bootsnap', '~> 1.16.0', require: false +gem 'bootsnap', '~> 1.17.0', require: false gem 'browser' gem 'charlock_holmes', '~> 0.7.7' gem 'chewy', '~> 7.3' diff --git a/Gemfile.lock b/Gemfile.lock index 5021800eba..1a64667d20 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -171,7 +171,7 @@ GEM binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) blurhash (0.1.7) - bootsnap (1.16.0) + bootsnap (1.17.0) msgpack (~> 1.2) brakeman (6.0.1) browser (5.3.1) @@ -455,7 +455,7 @@ GEM mini_mime (1.1.5) mini_portile2 (2.8.4) minitest (5.20.0) - msgpack (1.7.1) + msgpack (1.7.2) multi_json (1.15.0) multipart-post (2.3.0) mutex_m (0.1.2) @@ -833,7 +833,7 @@ DEPENDENCIES better_errors (~> 2.9) binding_of_caller (~> 1.0) blurhash (~> 0.1) - bootsnap (~> 1.16.0) + bootsnap (~> 1.17.0) brakeman (~> 6.0) browser bundler-audit (~> 0.9) From 147417a6d02dcd4396ad2c4d62953711bb36af2e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:26:21 +0100 Subject: [PATCH 12/38] Update dependency rspec-sidekiq to v4.1.0 (#27593) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1a64667d20..6ca89599c5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -631,7 +631,7 @@ GEM rspec-support (~> 3.12.0) rspec-github (2.4.0) rspec-core (~> 3.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-rails (6.0.3) @@ -642,7 +642,7 @@ GEM rspec-expectations (~> 3.12) rspec-mocks (~> 3.12) rspec-support (~> 3.12) - rspec-sidekiq (4.0.1) + rspec-sidekiq (4.1.0) rspec-core (~> 3.0) rspec-expectations (~> 3.0) rspec-mocks (~> 3.0) From e5b7ae95765eb99c1c9536bbed43425c63c68108 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Oct 2023 09:43:17 +0100 Subject: [PATCH 13/38] New Crowdin Translations (automated) (#27630) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/he.json | 6 ++-- app/javascript/mastodon/locales/ms.json | 7 +++- config/locales/bg.yml | 13 ++++++++ config/locales/ms.yml | 43 ++++++++++++++++++++++--- config/locales/oc.yml | 3 ++ config/locales/simple_form.ms.yml | 15 ++++++--- 6 files changed, 75 insertions(+), 12 deletions(-) diff --git a/app/javascript/mastodon/locales/he.json b/app/javascript/mastodon/locales/he.json index c868655e15..01618118a3 100644 --- a/app/javascript/mastodon/locales/he.json +++ b/app/javascript/mastodon/locales/he.json @@ -202,7 +202,7 @@ "dismissable_banner.community_timeline": "אלו הם החצרוצים הציבוריים האחרונים מהמשתמשים על שרת {domain}.", "dismissable_banner.dismiss": "בטל", "dismissable_banner.explore_links": "אלו הקישורים האחרונים ששותפו על ידי משתמשים ששרת זה רואה ברשת המבוזרת כרגע.", - "dismissable_banner.explore_statuses": "ההודעות האלו, משרת זה ואחרים ברשת המבוזרת, צוברים חשיפה היום. הודעות חדשות יותר עם יותר הדהודים וחיבובים מדורגים גבוה יותר.", + "dismissable_banner.explore_statuses": "ההודעות האלו, משרת זה ואחרים ברשת המבוזרת, צוברים חשיפה היום. הודעות חדשות יותר עם יותר הדהודים וחיבובים מדורגות גבוה יותר.", "dismissable_banner.explore_tags": "התגיות האלו, משרת זה ואחרים ברשת המבוזרת, צוברות חשיפה כעת.", "dismissable_banner.public_timeline": "אלו ההודעות האחרונות שהתקבלו מהמשתמשים שנעקבים על ידי משתמשים מ־{domain}.", "embed.instructions": "ניתן להטמיע את ההודעה הזו באתרך ע\"י העתקת הקוד שלהלן.", @@ -349,7 +349,7 @@ "keyboard_shortcuts.hotkey": "מקש קיצור", "keyboard_shortcuts.legend": "הצגת מקרא", "keyboard_shortcuts.local": "פתיחת ציר זמן קהילתי", - "keyboard_shortcuts.mention": "לאזכר את המחבר(ת)", + "keyboard_shortcuts.mention": "לאזכר את המחבר.ת", "keyboard_shortcuts.muted": "פתיחת רשימת משתמשים מושתקים", "keyboard_shortcuts.my_profile": "פתיחת הפרופיל שלך", "keyboard_shortcuts.notifications": "פתיחת טור התראות", @@ -707,7 +707,7 @@ "upload_modal.apply": "החל", "upload_modal.applying": "מחיל…", "upload_modal.choose_image": "בחר/י תמונה", - "upload_modal.description_placeholder": "דג סקרן שט בים מאוכזב ולפתע מצא חברה", + "upload_modal.description_placeholder": "עטלף אבק נס דרך מזגן שהתפוצץ כי חם", "upload_modal.detect_text": "זהה טקסט מתמונה", "upload_modal.edit_media": "עריכת מדיה", "upload_modal.hint": "הקליקי או גררי את המעגל על גבי התצוגה המקדימה על מנת לבחור בנקודת המוקד שתראה תמיד בכל התמונות הממוזערות.", diff --git a/app/javascript/mastodon/locales/ms.json b/app/javascript/mastodon/locales/ms.json index 3814e69151..a3bbd0067d 100644 --- a/app/javascript/mastodon/locales/ms.json +++ b/app/javascript/mastodon/locales/ms.json @@ -137,7 +137,7 @@ "compose.language.search": "Cari bahasa...", "compose.published.body": "Pos telah diterbitkan.", "compose.published.open": "Buka", - "compose.saved.body": "Pos disimpan.", + "compose.saved.body": "Kiriman disimpan.", "compose_form.direct_message_warning_learn_more": "Ketahui lebih lanjut", "compose_form.encryption_warning": "Hantaran pada Mastodon tidak disulitkan hujung ke hujung. Jangan berkongsi sebarang maklumat sensitif melalui Mastodon.", "compose_form.hashtag_warning": "Hantaran ini tidak akan disenaraikan di bawah mana-mana tanda pagar kerana ia tidak tersenarai. Hanya hantaran awam sahaja boleh dicari menggunakan tanda pagar.", @@ -307,6 +307,9 @@ "home.explore_prompt.body": "Suapan rumah anda akan mempunyai gabungan pos daripada hashtag yang telah anda pilih untuk diikuti, orang yang telah anda pilih untuk diikuti dan pos yang mereka tingkatkan. Jika itu terasa terlalu senyap, anda mungkin mahu:", "home.explore_prompt.title": "Ini adalah pusat operasi anda dalam Mastodon.", "home.hide_announcements": "Sembunyikan pengumuman", + "home.pending_critical_update.body": "Sila kemas kini pelayan Mastodon anda secepat yang mungkin!", + "home.pending_critical_update.link": "Lihat pengemaskinian", + "home.pending_critical_update.title": "Kemas kini keselamatan kritikal tersedia!", "home.show_announcements": "Tunjukkan pengumuman", "interaction_modal.description.favourite": "Dengan akaun di Mastodon, anda boleh menggemari pos ini untuk memberitahu pengarang anda menghargainya dan menyimpannya untuk kemudian.", "interaction_modal.description.follow": "Dengan akaun pada Mastodon, anda boleh mengikut {name} untuk menerima hantaran mereka di suapan rumah anda.", @@ -408,6 +411,7 @@ "navigation_bar.lists": "Senarai", "navigation_bar.logout": "Log keluar", "navigation_bar.mutes": "Pengguna yang dibisukan", + "navigation_bar.opened_in_classic_interface": "Kiriman, akaun dan halaman tertentu yang lain dibuka secara lalai di antara muka web klasik.", "navigation_bar.personal": "Peribadi", "navigation_bar.pins": "Hantaran disemat", "navigation_bar.preferences": "Keutamaan", @@ -583,6 +587,7 @@ "search.quick_action.open_url": "Buka URL dalam Mastadon", "search.quick_action.status_search": "Pos sepadan {x}", "search.search_or_paste": "Cari atau tampal URL", + "search_popout.full_text_search_disabled_message": "Tidak tersedia di {domain}.", "search_popout.language_code": "Kod bahasa ISO", "search_popout.options": "Pilihan carian", "search_popout.quick_actions": "Tindakan pantas", diff --git a/config/locales/bg.yml b/config/locales/bg.yml index b1d91875b3..04b4d438bb 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -534,6 +534,7 @@ bg: total_reported: Доклади за тях total_storage: Прикачена мултимедия totals_time_period_hint_html: Общите стойности, показани по-долу, включват данни за всички времена. + unknown_instance: В момента няма запис на този домейн на този сървър. invites: deactivate_all: Деактивиране на всички filter: @@ -1040,6 +1041,14 @@ bg: hint_html: Просто още едно нещо! Трябва да потвърдим, че сте човек (това е с цел предпазване на нежелани съобщения!). Разгадайте капчата долу и щракнете на "Продължаване". title: Проверка за сигурност confirmations: + awaiting_review: Вашият адрес на е-поща е потвърден! Служителите на %{domain} сега преглеждат регистрацията ви. Ще получите е-писмо, ако одобрят акаунта ви! + awaiting_review_title: Вашата регистрация се преглежда + clicking_this_link: щракване на тази връзка + login_link: влизане + proceed_to_login_html: Сега може да пристъпите към %{login_link}. + redirect_to_app_html: Трябва да сте пренасочени към приложението %{app_name}. Ако не се случи това, то опитайте %{clicking_this_link} или ръчно се върнете към приложението. + registration_complete: Вашата регистрация на %{domain} вече завърши! + welcome_title: Добре дошли, %{name}! wrong_email_hint: Ако този адрес на е-поща не е правилен, то може да го промените в настройки на акаунта. delete_account: Изтриване на акаунта delete_account_html: Ако желаете да изтриете акаунта си, може да сторите това тук. Ще ви се поиска потвърждение. @@ -1101,6 +1110,7 @@ bg: functional: Вашият акаунт е в изправност. pending: Вашето приложение чака преглед от нашия екип. Това може да отнеме време. Ще получите имейл, ако приложението е одобрено. redirecting_to: Вашият акаунт е бездеен, защото сега се пренасочва към %{acct}. + self_destruct: Затваряйки %{domain}, ще получите само ограничен достъп до акаунта си. view_strikes: Преглед на предишните предупреждения против акаунта ви too_fast: Образецът подаден пребързо, опитайте пак. use_security_key: Употреба на ключ за сигурност @@ -1570,6 +1580,9 @@ bg: over_daily_limit: Завишили сте ограничението от %{limit} планирани публикации за днес over_total_limit: Завишили сте ограничението от %{limit} планирани публикации too_soon: Заплануваната дата трябва да е в бъдеще + self_destruct: + lead_html: За жалост, %{domain} е трайно затворен. Ако сте имали там акаунт, то няма да може да продължите да го употребявате, но още може да заявите резервно копие на данните си. + title: Този сървър се затваря sessions: activity: Последна активност browser: Браузър diff --git a/config/locales/ms.yml b/config/locales/ms.yml index 6d1ededbc4..951b04194e 100644 --- a/config/locales/ms.yml +++ b/config/locales/ms.yml @@ -306,6 +306,7 @@ ms: unpublish: Nyahterbit unpublished_msg: Pengumuman berjaya dinyahterbitkan! updated_msg: Pengumuman berjaya dikemaskini! + critical_update_pending: Kemas kini kritikal belum selesai custom_emojis: assign_category: Menugaskan kategori by_domain: Domain @@ -522,6 +523,7 @@ ms: total_reported: Laporan tentang mereka total_storage: Lampiran media totals_time_period_hint_html: Jumlah yang dipaparkan di bawah termasuk data untuk sepanjang masa. + unknown_instance: Pada masa ini tiada rekod domain ini pada pelayan ini. invites: deactivate_all: Nyahaktifkan semua filter: @@ -756,10 +758,26 @@ ms: approved: Kelulusan diperlukan untuk pendaftaran none: Tiada siapa boleh mendaftar open: Sesiapapun boleh mendaftar + security: + authorized_fetch: Memerlukan pengesahan daripada pelayan bersekutu + authorized_fetch_overridden_hint: Pada masa ini anda tidak dapat menukar tetapan ini kerana ia ditindih oleh pemboleh ubah persekitaran. + federation_authentication: Penguatkuasaan pengesahan persekutuan title: Tetapan server site_uploads: delete: Hapuskan fail yang dimuat naik destroyed_msg: Muat naik tapak berjaya dihapuskan! + software_updates: + critical_update: Penting — sila kemas kini dengan segera + description: Disarankan untuk memastikan pemasangan Mastodon anda dikemas kini bagi mendapat manfaat daripada pembaikan dan ciri terkini. Selain itu, kadangkala penting untuk mengemas kini Mastodon tepat pada masanya untuk mengelakkan isu keselamatan. Atas sebab ini, Mastodon menyemak kemas kini setiap 30 minit dan akan memberitahu anda mengikut keutamaan pemberitahuan e-mel anda. + documentation_link: Ketahui lebih lanjut + release_notes: Catatan keluaran + title: Kemas kini tersedia + type: Jenis + types: + major: Keluaran utama + minor: Keluaran kecil + patch: Keluaran tampung — pembetulan pepijat dan perubahan yang mudah diterapkan + version: Versi statuses: account: Penulis application: Aplikasi @@ -807,10 +825,10 @@ ms: elasticsearch_index_mismatch: message_html: Pemetaan indeks Elasticsearch sudah lapuk. Sila jalankan tootctl search deploy --only=%{value} elasticsearch_preset: - action: Lihat dokumentasi - message_html: Kelompok Elasticsearch anda mempunyai lebih daripada satu nod, tetapi Mastodon tidak dikonfigurasikan untuk menggunakannya. + action: Lihat pendokumenan + message_html: Kelompok Elasticsearch anda mempunyai lebih daripada satu nod, tetapi Mastodon tidak ditatarajah untuk menggunakannya. elasticsearch_preset_single_node: - action: Lihat dokumentasi + action: Lihat pendokumenan message_html: Kelompok Elasticsearch anda hanya mempunyai satu nod, ES_PRESET hendaklah ditetapkan kepada single_node_cluster. elasticsearch_reset_chewy: message_html: Indeks sistem Elasticsearch anda sudah lapuk kerana perubahan tetapan. Sila jalankan tootctl search deploy --reset-chewy untuk mengemas kininya. @@ -824,6 +842,12 @@ ms: message_html: Anda belum menentukan sebarang peraturan server. sidekiq_process_check: message_html: Tiada proses Sidekiq berjalan untuk baris gilir %{value}. Sila semak konfigurasi Sidekiq anda + software_version_critical_check: + action: Lihat kemas kini yang tersedia + message_html: Kemas kini kritikal Mastodon telah tersedia, sila kemas kini secepat yang mungkin. + software_version_patch_check: + action: Lihat kemas kini yang tersedia + message_html: Kemas kini pembetulan pepijat Mastodon telah tersedia. upload_check_privacy_error: action: Semak di sini untuk maklumat lanjut message_html: "Server web anda salah konfigurasi. Privasi pengguna anda berisiko" @@ -933,6 +957,9 @@ ms: body: "%{target} sedang merayu keputusan penyederhanaan sebanyak %{action_taken_by} dari %{date}, iaitu %{type}. Mereka tulis:" next_steps: Anda boleh meluluskan rayuan untuk membuat asal keputusan penyederhanaan atau mengabaikannya. subject: "%{username} sedang merayu keputusan penyederhanaan pada %{instance}" + new_critical_software_updates: + body: Versi kritikal baharu Mastodon telah dikeluarkan, anda mungkin ingin mengemas kini secepat yang mungkin! + subject: Kemas kini kritikal Mastodon telah tersedia untuk %{instance}! new_pending_account: body: Butiran akaun baharu ada di bawah. Anda boleh meluluskan atau menolak aplikasi ini. subject: Akaun baharu disediakan untuk semakan pada %{instance} (%{username}) @@ -940,6 +967,9 @@ ms: body: "%{reporter} telah melaporkan %{target}" body_remote: Seseorang daripada %{domain} telah melaporkan %{target} subject: Laporan baharu untuk %{instance} (#%{id}) + new_software_updates: + body: Versi baharu Mastodon telah dikeluarkan, anda mungkin mahu mengemas kini! + subject: Versi baharu Mastodon telah tersedia untuk %{instance}! new_trends: body: 'Item berikut memerlukan semakan sebelum boleh dipaparkan secara terbuka:' new_trending_links: @@ -1053,6 +1083,7 @@ ms: functional: Akaun anda beroperasi sepenuhnya. pending: Permohonan anda sedang menunggu semakan oleh kakitangan kami. Ini mungkin mengambil sedikit masa. Anda akan menerima e-mel sekiranya permohonan anda diluluskan. redirecting_to: Akaun anda tidak aktif kerana ia sedang mengubah hala ke %{acct}. + self_destruct: Memandangkan %{domain} akan ditutup, anda hanya akan mendapat capaian terhad kepada akaun anda. view_strikes: Lihat pelanggaran yang lepas terhadap akaun anda too_fast: Borang diserahkan terlalu cepat, cuba lagi. use_security_key: Gunakan kunci keselamatan @@ -1504,6 +1535,9 @@ ms: over_daily_limit: Anda telah melebihi had %{limit} pos berjadual untuk hari ini over_total_limit: Anda telah melebihi had %{limit} pos berjadual too_soon: Tarikh yang dijadualkan mestilah pada masa hadapan + self_destruct: + lead_html: Malangnya, %{domain} akan ditutup secara kekal. Jika anda mempunyai akaun di situ, anda tidak akan dapat terus menggunakannya, tetapi anda masih boleh meminta sandaran data anda. + title: Pelayan ini akan ditutup sessions: activity: Aktiviti terakhir browser: Pelayar @@ -1666,9 +1700,10 @@ ms: default: "%b %d, %Y, %H:%M" month: "%b %Y" time: "%H:%M" + with_time_zone: "%d %b %Y, %H:%M %Z" translation: errors: - quota_exceeded: Kuota penggunaan seluruh server untuk perkhidmatan terjemahan telah melebihi. + quota_exceeded: Kuota penggunaan seluruh pelayan untuk perkhidmatan terjemahan telah berlebihan. too_many_requests: Terdapat terlalu banyak permintaan kepada perkhidmatan terjemahan baru-baru ini. two_factor_authentication: add: Tambah diff --git a/config/locales/oc.yml b/config/locales/oc.yml index 8145002e56..83c2638b51 100644 --- a/config/locales/oc.yml +++ b/config/locales/oc.yml @@ -474,6 +474,9 @@ oc: warning: Mèfi ! Agachatz de partejar aquela donada amb degun ! your_token: Vòstre geton d’accès auth: + confirmations: + clicking_this_link: en clicant aqueste ligam + welcome_title: La benvenguda %{name} ! delete_account: Suprimir lo compte delete_account_html: Se volètz suprimir vòstre compte, podètz o far aquí. Vos demandarem que confirmetz. description: diff --git a/config/locales/simple_form.ms.yml b/config/locales/simple_form.ms.yml index c0d47ace0a..79929cec5d 100644 --- a/config/locales/simple_form.ms.yml +++ b/config/locales/simple_form.ms.yml @@ -6,10 +6,10 @@ ms: discoverable: Siaran awam dan profil anda mungkin dipaparkan atau disyorkan dalam pelbagai kawasan Mastodon dan profil anda mungkin dicadangkan kepada pengguna lain. display_name: Nama penuh anda atau nama anda yang menyeronokkan. fields: Halaman utama anda, kata ganti nama, umur, apa sahaja yang anda mahukan. - indexable: Pos awam anda mungkin muncul dalam hasil carian di Mastodon. Orang yang telah berinteraksi dengan pos anda mungkin boleh mencarinya tanpa mengira. + indexable: Kiriman awam anda mungkin muncul dalam hasil carian di Mastodon. Orang yang telah berinteraksi dengan kiriman anda mungkin boleh mencarinya. note: 'Anda boleh @menyebut orang lain atau #hashtags.' - show_collections: Orang akan dapat menyemak imbas mengikut dan pengikut anda. Orang yang anda ikuti akan melihat bahawa anda mengikuti mereka tanpa mengira. - unlocked: Orang akan dapat mengikuti anda tanpa meminta kelulusan. Nyahtanda jika anda ingin menyemak permintaan ikuti dan pilih sama ada untuk menerima atau menolak pengikut baharu. + show_collections: Orang akan dapat menyemak imbas ikutan dan pengikut anda. Orang yang anda ikuti akan melihat bahawa anda tetap mengikuti mereka. + unlocked: Orang akan dapat mengikuti anda tanpa meminta kelulusan. Nyahtanda jika anda ingin menyemak permintaan ikutan dan pilih sama ada untuk menerima atau menolak pengikut baharu. account_alias: acct: Tentukan namapengguna@domain akaun yang ingin anda alihkan daripada account_migration: @@ -144,7 +144,7 @@ ms: fields: name: Label value: Kandungan - indexable: Sertakan pos awam dalam hasil carian + indexable: Termasuk kiriman awam dalam hasil carian show_collections: Tunjukkan ikutan dan pengikut pada profil unlocked: Terima pengikut baharu secara automatik account_alias: @@ -291,6 +291,12 @@ ms: pending_account: Akaun baru memerlukan semakan reblog: Seorang menggalakan hantaran anda report: Laporan baru telah dihantar + software_updates: + all: Beritahu mengenai semua kemas kini + critical: Beritahu mengenai kemas kini kritikal sahaja + label: Versi baharu Mastodon kini tersedia + none: Tidak pernah memberitahu mengenai kemas kini (tidak disarankan) + patch: Beritahu mengenai kemas kini pembetulan pepijat trending_tag: Trend baru memerlukan semakan rule: text: Peraturan @@ -317,6 +323,7 @@ ms: url: URL titik akhir 'no': Tidak not_recommended: Tidak disyorkan + overridden: Ditindih recommended: Disyorkan required: mark: "*" From d649bbf28f9bbf7cddc7d471121129a4788298b2 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 31 Oct 2023 10:40:30 +0100 Subject: [PATCH 14/38] Add some more tests and clean up domain block controller (#27469) --- .../admin/domain_blocks_controller.rb | 2 +- spec/features/admin/domain_blocks_spec.rb | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/domain_blocks_controller.rb b/app/controllers/admin/domain_blocks_controller.rb index 96c31a38fd..325b33df80 100644 --- a/app/controllers/admin/domain_blocks_controller.rb +++ b/app/controllers/admin/domain_blocks_controller.rb @@ -33,7 +33,7 @@ module Admin # Disallow accidentally downgrading a domain block if existing_domain_block.present? && !@domain_block.stricter_than?(existing_domain_block) - @domain_block.save + @domain_block.validate flash.now[:alert] = I18n.t('admin.domain_blocks.existing_domain_block_html', name: existing_domain_block.domain, unblock_url: admin_domain_block_path(existing_domain_block)).html_safe @domain_block.errors.delete(:domain) return render :new diff --git a/spec/features/admin/domain_blocks_spec.rb b/spec/features/admin/domain_blocks_spec.rb index 0d7b90c21c..4379ac91db 100644 --- a/spec/features/admin/domain_blocks_spec.rb +++ b/spec/features/admin/domain_blocks_spec.rb @@ -4,6 +4,7 @@ require 'rails_helper' describe 'blocking domains through the moderation interface' do before do + allow(DomainBlockWorker).to receive(:perform_async).and_return(true) sign_in Fabricate(:user, role: UserRole.find_by(name: 'Admin')), scope: :user end @@ -16,6 +17,7 @@ describe 'blocking domains through the moderation interface' do click_button I18n.t('admin.domain_blocks.new.create') expect(DomainBlock.exists?(domain: 'example.com', severity: 'silence')).to be true + expect(DomainBlockWorker).to have_received(:perform_async) end end @@ -27,13 +29,15 @@ describe 'blocking domains through the moderation interface' do select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity' click_button I18n.t('admin.domain_blocks.new.create') - # It presents a confirmation screen + # It doesn't immediately block but presents a confirmation screen expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'example.com')) + expect(DomainBlockWorker).to_not have_received(:perform_async) # Confirming creates a block click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm') expect(DomainBlock.exists?(domain: 'example.com', severity: 'suspend')).to be true + expect(DomainBlockWorker).to have_received(:perform_async) end end @@ -47,13 +51,15 @@ describe 'blocking domains through the moderation interface' do select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity' click_button I18n.t('admin.domain_blocks.new.create') - # It presents a confirmation screen + # It doesn't immediately block but presents a confirmation screen expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'example.com')) + expect(DomainBlockWorker).to_not have_received(:perform_async) # Confirming updates the block click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm') expect(domain_block.reload.severity).to eq 'suspend' + expect(DomainBlockWorker).to have_received(:perform_async) end end @@ -67,13 +73,15 @@ describe 'blocking domains through the moderation interface' do select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity' click_button I18n.t('admin.domain_blocks.new.create') - # It presents a confirmation screen + # It doesn't immediately block but presents a confirmation screen expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'subdomain.example.com')) + expect(DomainBlockWorker).to_not have_received(:perform_async) # Confirming creates the block click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm') expect(DomainBlock.where(domain: 'subdomain.example.com', severity: 'suspend')).to exist + expect(DomainBlockWorker).to have_received(:perform_async) # And leaves the previous block alone expect(domain_block.reload.severity).to eq 'silence' @@ -90,11 +98,13 @@ describe 'blocking domains through the moderation interface' do select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity' click_button I18n.t('generic.save_changes') - # It presents a confirmation screen + # It doesn't immediately block but presents a confirmation screen expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'example.com')) + expect(DomainBlockWorker).to_not have_received(:perform_async) # Confirming updates the block click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm') + expect(DomainBlockWorker).to have_received(:perform_async) expect(domain_block.reload.severity).to eq 'suspend' end From a916251d8a8fffcaeb6be80eacf50138a53650dc Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 31 Oct 2023 05:47:16 -0400 Subject: [PATCH 15/38] Update haml-lint line length configuration to match rubocop value (#27570) --- .haml-lint.yml | 2 ++ .haml-lint_todo.yml | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.haml-lint.yml b/.haml-lint.yml index d1ed30b260..8cfcaec8d9 100644 --- a/.haml-lint.yml +++ b/.haml-lint.yml @@ -12,3 +12,5 @@ linters: enabled: true MiddleDot: enabled: true + LineLength: + max: 320 diff --git a/.haml-lint_todo.yml b/.haml-lint_todo.yml index ff66764e07..9686c177bd 100644 --- a/.haml-lint_todo.yml +++ b/.haml-lint_todo.yml @@ -1,17 +1,31 @@ # This configuration was generated by # `haml-lint --auto-gen-config` -# on 2023-10-25 08:29:48 -0400 using Haml-Lint version 0.51.0. +# on 2023-10-26 09:32:34 -0400 using Haml-Lint version 0.51.0. # The point is for the user to remove these configuration records # one by one as the lints are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of Haml-Lint, may require this file to be generated again. linters: - # Offense count: 945 + # Offense count: 16 LineLength: - enabled: false + exclude: + - 'app/views/admin/account_actions/new.html.haml' + - 'app/views/admin/accounts/index.html.haml' + - 'app/views/admin/ip_blocks/new.html.haml' + - 'app/views/admin/roles/_form.html.haml' + - 'app/views/admin/settings/discovery/show.html.haml' + - 'app/views/auth/registrations/edit.html.haml' + - 'app/views/auth/registrations/new.html.haml' + - 'app/views/filters/_filter_fields.html.haml' + - 'app/views/media/player.html.haml' + - 'app/views/settings/applications/_fields.html.haml' + - 'app/views/settings/imports/index.html.haml' + - 'app/views/settings/preferences/appearance/show.html.haml' + - 'app/views/settings/preferences/notifications/show.html.haml' + - 'app/views/settings/preferences/other/show.html.haml' - # Offense count: 10 + # Offense count: 9 RuboCop: exclude: - 'app/views/admin/accounts/_buttons.html.haml' From 9c8891b39a2d04898880f4bd0754a52739ada30a Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 31 Oct 2023 11:17:37 +0100 Subject: [PATCH 16/38] Rewrite `AutosuggestTextarea` as Functional Component (#27618) --- .../components/autosuggest_textarea.jsx | 231 +++++++++--------- .../compose/components/compose_form.jsx | 26 +- 2 files changed, 130 insertions(+), 127 deletions(-) diff --git a/app/javascript/mastodon/components/autosuggest_textarea.jsx b/app/javascript/mastodon/components/autosuggest_textarea.jsx index 230e4f6572..4d173af59d 100644 --- a/app/javascript/mastodon/components/autosuggest_textarea.jsx +++ b/app/javascript/mastodon/components/autosuggest_textarea.jsx @@ -1,9 +1,9 @@ import PropTypes from 'prop-types'; +import { useCallback, useRef, useState, useEffect, forwardRef } from 'react'; import classNames from 'classnames'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import ImmutablePureComponent from 'react-immutable-pure-component'; import Textarea from 'react-textarea-autosize'; @@ -37,54 +37,46 @@ const textAtCursorMatchesToken = (str, caretPosition) => { } }; -export default class AutosuggestTextarea extends ImmutablePureComponent { +const AutosuggestTextarea = forwardRef(({ + value, + suggestions, + disabled, + placeholder, + onSuggestionSelected, + onSuggestionsClearRequested, + onSuggestionsFetchRequested, + onChange, + onKeyUp, + onKeyDown, + onPaste, + onFocus, + autoFocus = true, + lang, + children, +}, textareaRef) => { - static propTypes = { - value: PropTypes.string, - suggestions: ImmutablePropTypes.list, - disabled: PropTypes.bool, - placeholder: PropTypes.string, - onSuggestionSelected: PropTypes.func.isRequired, - onSuggestionsClearRequested: PropTypes.func.isRequired, - onSuggestionsFetchRequested: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onKeyUp: PropTypes.func, - onKeyDown: PropTypes.func, - onPaste: PropTypes.func.isRequired, - autoFocus: PropTypes.bool, - lang: PropTypes.string, - }; + const [suggestionsHidden, setSuggestionsHidden] = useState(true); + const [selectedSuggestion, setSelectedSuggestion] = useState(0); + const lastTokenRef = useRef(null); + const tokenStartRef = useRef(0); - static defaultProps = { - autoFocus: true, - }; - - state = { - suggestionsHidden: true, - focused: false, - selectedSuggestion: 0, - lastToken: null, - tokenStart: 0, - }; - - onChange = (e) => { + const handleChange = useCallback((e) => { const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart); - if (token !== null && this.state.lastToken !== token) { - this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); - this.props.onSuggestionsFetchRequested(token); + if (token !== null && lastTokenRef.current !== token) { + tokenStartRef.current = tokenStart; + lastTokenRef.current = token; + setSelectedSuggestion(0); + onSuggestionsFetchRequested(token); } else if (token === null) { - this.setState({ lastToken: null }); - this.props.onSuggestionsClearRequested(); + lastTokenRef.current = null; + onSuggestionsClearRequested(); } - this.props.onChange(e); - }; - - onKeyDown = (e) => { - const { suggestions, disabled } = this.props; - const { selectedSuggestion, suggestionsHidden } = this.state; + onChange(e); + }, [onSuggestionsFetchRequested, onSuggestionsClearRequested, onChange, setSelectedSuggestion]); + const handleKeyDown = useCallback((e) => { if (disabled) { e.preventDefault(); return; @@ -102,80 +94,75 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { document.querySelector('.ui').parentElement.focus(); } else { e.preventDefault(); - this.setState({ suggestionsHidden: true }); + setSuggestionsHidden(true); } break; case 'ArrowDown': if (suggestions.size > 0 && !suggestionsHidden) { e.preventDefault(); - this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); + setSelectedSuggestion(Math.min(selectedSuggestion + 1, suggestions.size - 1)); } break; case 'ArrowUp': if (suggestions.size > 0 && !suggestionsHidden) { e.preventDefault(); - this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); + setSelectedSuggestion(Math.max(selectedSuggestion - 1, 0)); } break; case 'Enter': case 'Tab': // Select suggestion - if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { + if (lastTokenRef.current !== null && suggestions.size > 0 && !suggestionsHidden) { e.preventDefault(); e.stopPropagation(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); + onSuggestionSelected(tokenStartRef.current, lastTokenRef.current, suggestions.get(selectedSuggestion)); } break; } - if (e.defaultPrevented || !this.props.onKeyDown) { + if (e.defaultPrevented || !onKeyDown) { return; } - this.props.onKeyDown(e); - }; + onKeyDown(e); + }, [disabled, suggestions, suggestionsHidden, selectedSuggestion, setSelectedSuggestion, setSuggestionsHidden, onSuggestionSelected, onKeyDown]); - onBlur = () => { - this.setState({ suggestionsHidden: true, focused: false }); - }; + const handleBlur = useCallback(() => { + setSuggestionsHidden(true); + }, [setSuggestionsHidden]); - onFocus = (e) => { - this.setState({ focused: true }); - if (this.props.onFocus) { - this.props.onFocus(e); + const handleFocus = useCallback((e) => { + if (onFocus) { + onFocus(e); } - }; + }, [onFocus]); - onSuggestionClick = (e) => { - const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); + const handleSuggestionClick = useCallback((e) => { + const suggestion = suggestions.get(e.currentTarget.getAttribute('data-index')); e.preventDefault(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); - this.textarea.focus(); - }; + onSuggestionSelected(tokenStartRef.current, lastTokenRef.current, suggestion); + textareaRef.current?.focus(); + }, [suggestions, onSuggestionSelected, textareaRef]); - UNSAFE_componentWillReceiveProps (nextProps) { - if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { - this.setState({ suggestionsHidden: false }); - } - } - - setTextarea = (c) => { - this.textarea = c; - }; - - onPaste = (e) => { + const handlePaste = useCallback((e) => { if (e.clipboardData && e.clipboardData.files.length === 1) { - this.props.onPaste(e.clipboardData.files); + onPaste(e.clipboardData.files); e.preventDefault(); } - }; + }, [onPaste]); - renderSuggestion = (suggestion, i) => { - const { selectedSuggestion } = this.state; + // Show the suggestions again whenever they change and the textarea is focused + useEffect(() => { + if (suggestions.size > 0 && textareaRef.current === document.activeElement) { + setSuggestionsHidden(false); + } + }, [suggestions, textareaRef, setSuggestionsHidden]); + + const renderSuggestion = (suggestion, i) => { let inner, key; if (suggestion.type === 'emoji') { @@ -190,50 +177,64 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { } return ( -
+
{inner}
); }; - render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props; - const { suggestionsHidden } = this.state; + return [ +
+
+