Merge commit 'f2a92c2d22345568ca7f47ee1d1d70de53eb547d' into glitch-soc/merge-upstream

pull/2843/head
Claire 2024-09-12 17:34:16 +02:00
commit caaa412e6e
18 changed files with 94 additions and 26 deletions

View File

@ -1,5 +1,7 @@
import { FormattedMessage } from 'react-intl';
import { isEqual } from 'lodash';
import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react';
import ReplyIcon from '@/material-icons/400-24px/reply-fill.svg?react';
import { me } from 'mastodon/initial_state';
@ -47,7 +49,7 @@ export const NotificationMention: React.FC<{
status.get('visibility') === 'direct',
status.get('in_reply_to_account_id') === me,
] as const;
});
}, isEqual);
let labelRenderer = mentionLabelRenderer;

View File

@ -4,6 +4,7 @@ import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { Helmet } from 'react-helmet';
import { isEqual } from 'lodash';
import { useDebouncedCallback } from 'use-debounce';
import DoneAllIcon from '@/material-icons/400-24px/done_all.svg?react';
@ -62,7 +63,7 @@ export const Notifications: React.FC<{
multiColumn?: boolean;
}> = ({ columnId, multiColumn }) => {
const intl = useIntl();
const notifications = useAppSelector(selectNotificationGroups);
const notifications = useAppSelector(selectNotificationGroups, isEqual);
const dispatch = useAppDispatch();
const isLoading = useAppSelector((s) => s.notificationGroups.isLoading);
const hasMore = notifications.at(-1)?.type === 'gap';

View File

@ -3,10 +3,12 @@ import { connect } from 'react-redux';
import { openModal, closeModal } from '../../../actions/modal';
import ModalRoot from '../components/modal_root';
const defaultProps = {};
const mapStateToProps = state => ({
ignoreFocus: state.getIn(['modal', 'ignoreFocus']),
type: state.getIn(['modal', 'stack', 0, 'modalType'], null),
props: state.getIn(['modal', 'stack', 0, 'modalProps'], {}),
props: state.getIn(['modal', 'stack', 0, 'modalProps'], defaultProps),
});
const mapDispatchToProps = dispatch => ({

View File

@ -4,24 +4,11 @@ import { connect } from 'react-redux';
import { NotificationStack } from 'react-notification';
import { dismissAlert } from '../../../actions/alerts';
import { getAlerts } from '../../../selectors';
const formatIfNeeded = (intl, message, values) => {
if (typeof message === 'object') {
return intl.formatMessage(message, values);
}
return message;
};
import { dismissAlert } from 'mastodon/actions/alerts';
import { getAlerts } from 'mastodon/selectors';
const mapStateToProps = (state, { intl }) => ({
notifications: getAlerts(state).map(alert => ({
...alert,
action: formatIfNeeded(intl, alert.action, alert.values),
title: formatIfNeeded(intl, alert.title, alert.values),
message: formatIfNeeded(intl, alert.message, alert.values),
})),
notifications: getAlerts(state, { intl }),
});
const mapDispatchToProps = (dispatch) => ({

View File

@ -97,7 +97,7 @@
"block_modal.title": "Blocio defnyddiwr?",
"block_modal.you_wont_see_mentions": "Fyddwch chi ddim yn gweld postiadau sy'n sôn amdanyn nhw.",
"boost_modal.combo": "Mae modd pwyso {combo} er mwyn hepgor hyn tro nesa",
"boost_modal.reblog": "Hybu postiad",
"boost_modal.reblog": "Hybu postiad?",
"boost_modal.undo_reblog": "Dad-hybu postiad?",
"bundle_column_error.copy_stacktrace": "Copïo'r adroddiad gwall",
"bundle_column_error.error.body": "Nid oedd modd cynhyrchu'r dudalen honno. Gall fod oherwydd gwall yn ein cod neu fater cydnawsedd porwr.",
@ -457,6 +457,7 @@
"lists.subheading": "Eich rhestrau",
"load_pending": "{count, plural, one {# eitem newydd} other {# eitem newydd}}",
"loading_indicator.label": "Yn llwytho…",
"media_gallery.hide": "Cuddio",
"moved_to_account_banner.text": "Ar hyn y bryd, mae eich cyfrif {disabledAccount} wedi ei analluogi am i chi symud i {movedToAccount}.",
"mute_modal.hide_from_notifications": "Cuddio rhag hysbysiadau",
"mute_modal.hide_options": "Cuddio'r dewis",
@ -779,6 +780,7 @@
"status.bookmark": "Llyfrnodi",
"status.cancel_reblog_private": "Dadhybu",
"status.cannot_reblog": "Nid oes modd hybu'r postiad hwn",
"status.continued_thread": "Edefyn parhaus",
"status.copy": "Copïo dolen i'r post",
"status.delete": "Dileu",
"status.detailed_status": "Golwg manwl o'r sgwrs",
@ -812,6 +814,7 @@
"status.reblogs.empty": "Does neb wedi hybio'r post yma eto. Pan y bydd rhywun yn gwneud, byddent yn ymddangos yma.",
"status.redraft": "Dileu ac ailddrafftio",
"status.remove_bookmark": "Tynnu nod tudalen",
"status.replied_in_thread": "Atebodd mewn edefyn",
"status.replied_to": "Wedi ateb {name}",
"status.reply": "Ateb",
"status.replyAll": "Ateb i edefyn",

View File

@ -457,6 +457,7 @@
"lists.subheading": "Tus listas",
"load_pending": "{count, plural, one {# elemento nuevo} other {# elementos nuevos}}",
"loading_indicator.label": "Cargando…",
"media_gallery.hide": "Ocultar",
"moved_to_account_banner.text": "Tu cuenta {disabledAccount} está actualmente deshabilitada porque te mudaste a {movedToAccount}.",
"mute_modal.hide_from_notifications": "Ocultar en las notificaciones",
"mute_modal.hide_options": "Ocultar opciones",

View File

@ -7,14 +7,16 @@ import { me } from '../initial_state';
export { makeGetAccount } from "./accounts";
const getFilters = (state, { contextType }) => {
if (!contextType) return null;
const getFilters = createSelector([state => state.get('filters'), (_, { contextType }) => contextType], (filters, contextType) => {
if (!contextType) {
return null;
}
const serverSideType = toServerSideType(contextType);
const now = new Date();
const serverSideType = toServerSideType(contextType);
return state.get('filters').filter((filter) => filter.get('context').includes(serverSideType) && (filter.get('expires_at') === null || filter.get('expires_at') > now));
};
return filters.filter(filter => filter.get('context').includes(serverSideType) && (filter.get('expires_at') === null || filter.get('expires_at') > now));
});
export const makeGetStatus = () => {
return createSelector(
@ -73,10 +75,21 @@ const ALERT_DEFAULTS = {
style: false,
};
export const getAlerts = createSelector(state => state.get('alerts'), alerts =>
const formatIfNeeded = (intl, message, values) => {
if (typeof message === 'object') {
return intl.formatMessage(message, values);
}
return message;
};
export const getAlerts = createSelector([state => state.get('alerts'), (_, { intl }) => intl], (alerts, intl) =>
alerts.map(item => ({
...ALERT_DEFAULTS,
...item,
action: formatIfNeeded(intl, item.action, item.values),
title: formatIfNeeded(intl, item.title, item.values),
message: formatIfNeeded(intl, item.message, item.values),
})).toArray());
export const makeGetNotification = () => createSelector([

View File

@ -15,6 +15,12 @@ cy:
user/invite_request:
text: Rheswm
errors:
attributes:
domain:
invalid: "- nid yw'n enw parth dilys"
messages:
invalid_domain_on_line: Nid yw %{value} yn enw parth dilys
too_many_lines: "- dros y terfyn o %{limit} llinell"
models:
account:
attributes:

View File

@ -15,6 +15,12 @@ es-AR:
user/invite_request:
text: Motivo
errors:
attributes:
domain:
invalid: no es un nombre de dominio válido
messages:
invalid_domain_on_line: "%{value} no es un nombre de dominio válido"
too_many_lines: está por encima del límite de %{limit} líneas
models:
account:
attributes:

View File

@ -15,6 +15,12 @@ sq:
user/invite_request:
text: Arsye
errors:
attributes:
domain:
invalid: sështë emër i vlefshëm përkatësie
messages:
invalid_domain_on_line: "%{value} sështë emër i vlefshëm përkatësie"
too_many_lines: është tej kufirit prej %{limit} rreshta
models:
account:
attributes:

View File

@ -15,8 +15,12 @@ sv:
user/invite_request:
text: Anledning
errors:
attributes:
domain:
invalid: är inte ett giltigt domännamn
messages:
invalid_domain_on_line: "%{value} Är inte ett giltigt domännamn"
too_many_lines: överskrider gränsen på %{limit} rader
models:
account:
attributes:

View File

@ -33,6 +33,7 @@ cy:
admin:
account_actions:
action: Cyflawni gweithred
already_silenced: Mae'r cyfrif hwn eisoes wedi'i gyfyngu.
already_suspended: Mae'r cyfrif hwn eisoes wedi'i atal.
title: Cyflawni gweithred cymedroli ar %{acct}
account_moderation_notes:
@ -1232,6 +1233,12 @@ cy:
view_strikes: Gweld rybuddion y gorffennol yn erbyn eich cyfrif
too_fast: Cafodd y ffurflen ei chyflwyno'n rhy gyflym, ceisiwch eto.
use_security_key: Defnyddiwch allwedd diogelwch
author_attribution:
example_title: Testun enghreifftiol
hint_html: Rheolwch sut rydych chi'n cael eich canmol pan fydd dolenni'n cael eu rhannu ar Mastodon.
more_from_html: Mwy gan %{name}
s_blog: Blog %{name}
title: Priodoliad awdur
challenge:
confirm: Parhau
hint_html: "<strong>Awgrym:</strong> Fyddwn ni ddim yn gofyn i chi am eich cyfrinair eto am yr awr nesaf."
@ -2080,6 +2087,7 @@ cy:
instructions_html: Copïwch a gludo'r cod isod i HTML eich gwefan. Yna ychwanegwch gyfeiriad eich gwefan i un o'r meysydd ychwanegol ar eich proffil o'r tab "Golygu proffil" a chadw'r newidiadau.
verification: Dilysu
verified_links: Eich dolenni wedi'u dilysu
website_verification: Gwirio gwefan
webauthn_credentials:
add: Ychwanegu allwedd ddiogelwch newydd
create:

View File

@ -1161,6 +1161,12 @@ es-AR:
view_strikes: Ver incumplimientos pasados contra tu cuenta
too_fast: Formulario enviado demasiado rápido, probá de nuevo.
use_security_key: Usar la llave de seguridad
author_attribution:
example_title: Texto de ejemplo
hint_html: Controlá cómo se te da crédito cuando los enlaces son compartidos en Mastodon.
more_from_html: Más de %{name}
s_blog: Blog de %{name}
title: Atribución del autor
challenge:
confirm: Continuar
hint_html: "<strong>Dato:</strong> No volveremos a preguntarte por la contraseña durante la siguiente hora."
@ -1949,6 +1955,7 @@ es-AR:
instructions_html: Copiá y pegá el siguiente código en el HTML de tu sitio web. Luego, agregá la dirección de tu sitio web en uno de los campos extras de tu perfil desde la pestaña "Editar perfil" y guardá los cambios.
verification: Verificación
verified_links: Tus enlaces verificados
website_verification: Verificación del sitio web
webauthn_credentials:
add: Agregar nueva llave de seguridad
create:

View File

@ -3,6 +3,7 @@ cy:
simple_form:
hints:
account:
attribution_domains_as_text: Yn amddiffyn rhag priodoliadau ffug.
discoverable: Mae'n bosibl y bydd eich postiadau cyhoeddus a'ch proffil yn cael sylw neu'n cael eu hargymell mewn gwahanol feysydd o Mastodon ac efallai y bydd eich proffil yn cael ei awgrymu i ddefnyddwyr eraill.
display_name: Eich enw llawn neu'ch enw hwyl.
fields: Eich tudalen cartref, rhagenwau, oed, neu unrhyw beth.
@ -143,6 +144,7 @@ cy:
url: I ble bydd digwyddiadau'n cael eu hanfon
labels:
account:
attribution_domains_as_text: Dim ond yn caniatáu gwefannau penodol
discoverable: Proffil nodwedd a phostiadau mewn algorithmau darganfod
fields:
name: Label

View File

@ -3,6 +3,7 @@ es-AR:
simple_form:
hints:
account:
attribution_domains_as_text: Protege de atribuciones falsas.
discoverable: Tu perfil y publicaciones pueden ser destacadas o recomendadas en varias áreas de Mastodon, y tu perfil puede ser sugerido a otros usuarios.
display_name: Tu nombre completo o tu pseudónimo.
fields: Tu sitio web, pronombres, edad, o lo que quieras.
@ -143,6 +144,7 @@ es-AR:
url: Adónde serán enviados los eventos
labels:
account:
attribution_domains_as_text: Solo permitir sitios web específicos
discoverable: Destacar perfil y mensajes en algoritmos de descubrimiento
fields:
name: Nombre de campo

View File

@ -3,6 +3,7 @@ sq:
simple_form:
hints:
account:
attribution_domains_as_text: Mbron nga atribuime të rreme.
discoverable: Postimet dhe profili juaj publik mund të shfaqen, ose rekomandohen në zona të ndryshme të Mastodon-it dhe profili juaj mund të sugjerohet përdoruesve të tjerë.
display_name: Emri juaj i plotë, ose emri juaj lojcak.
fields: Faqja juaj hyrëse, përemra, moshë, çtë keni qejf.
@ -143,6 +144,7 @@ sq:
url: Ku do të dërgohen aktet
labels:
account:
attribution_domains_as_text: Lejo vetëm sajte specifikë
discoverable: Profilin dhe postimet bëji objekt të algoritmeve të zbulimit
fields:
name: Etiketë

View File

@ -1153,6 +1153,12 @@ sq:
view_strikes: Shihni paralajmërime të dikurshme kundër llogarisë tuaj
too_fast: Formulari u parashtrua shumë shpejt, riprovoni.
use_security_key: Përdor kyç sigurie
author_attribution:
example_title: Tekst shembull
hint_html: Kontrolloni se si vlerësoheni, kur ndahen lidhje me të tjerë në Mastodon.
more_from_html: Më tepër nga %{name}
s_blog: Blogu i %{name}
title: Atribuim autorësh
challenge:
confirm: Vazhdo
hint_html: "<strong>Ndihmëz:</strong> Sdo tju pyesim për fjalëkalimin tuaj sërish, për një orë."
@ -1941,6 +1947,7 @@ sq:
instructions_html: Kopjoni dhe ngjitni në HTML-në e sajtit tuaj kodin më poshtë. Mandej shtoni adresën e sajtit tuaj te një nga fushat shtesë në profilin tuaj, që nga skeda “Përpunoni profil” dhe ruani ndryshimet.
verification: Verifikim
verified_links: Lidhjet tuaja të verifikuara
website_verification: Verifikim sajti
webauthn_credentials:
add: Shtoni kyç të ri sigurie
create:

View File

@ -180,6 +180,7 @@ sv:
confirm_user: Bekräfta användare
create_account_warning: Skapa varning
create_announcement: Skapa kungörelse
create_canonical_email_block: Skapa E-post block
create_custom_emoji: Skapa egen emoji
create_domain_allow: Skapa tillåten domän
create_domain_block: Skapa blockerad domän
@ -239,17 +240,21 @@ sv:
confirm_user_html: "%{name} bekräftad e-post adress av användare %{target}"
create_account_warning_html: "%{name} skickade en varning till %{target}"
create_announcement_html: "%{name} skapade kungörelsen %{target}"
create_canonical_email_block_html: "%{name} blockade e-posten med %{target}"
create_custom_emoji_html: "%{name} laddade upp ny emoji %{target}"
create_domain_allow_html: "%{name} vitlistade domän %{target}"
create_domain_block_html: "%{name} blockerade domänen %{target}"
create_email_domain_block_html: "%{name} blockerade e-post domänet%{target}"
create_ip_block_html: "%{name} skapade regel för IP %{target}"
create_unavailable_domain_html: "%{name} stoppade leverans till domänen %{target}"
create_user_role_html: "%{name} skapade rollen %{target}"
demote_user_html: "%{name} nedgraderade användare %{target}"
destroy_announcement_html: "%{name} raderade kungörelsen %{target}"
destroy_canonical_email_block_html: "%{name} avblockerade e-post med hash%{target}"
destroy_custom_emoji_html: "%{name} raderade emoji %{target}"
destroy_domain_allow_html: "%{name} raderade domän %{target} från vitlistan"
destroy_domain_block_html: "%{name} avblockerade domänen %{target}"
destroy_email_domain_block_html: "%{name} avblockerade e-post domänet %{target}"
destroy_instance_html: "%{name} rensade domän %{target}"
destroy_ip_block_html: "%{name} tog bort regel för IP %{target}"
destroy_status_html: "%{name} tog bort inlägget av %{target}"
@ -870,7 +875,9 @@ sv:
message_html: "<strong>Din objektlagring är felkonfigurerad. Sekretessen för dina användare är i riskzonen.</strong>"
tags:
moderation:
reviewed: Granskat
title: Status
trendable:
name: Namn
reset: Återställ
review: Granskningsstatus
@ -1112,6 +1119,8 @@ sv:
view_strikes: Visa tidigare prickar på ditt konto
too_fast: Formuläret har skickats för snabbt, försök igen.
use_security_key: Använd säkerhetsnyckel
author_attribution:
example_title: Exempeltext
challenge:
confirm: Fortsätt
hint_html: "<strong>Tips:</strong> Vi frågar dig inte efter ditt lösenord igen under nästkommande timme."