mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-29 07:29:02 +01:00
Fix grouped reaction notification text
This commit is contained in:
parent
15e1541115
commit
e5b5f5c018
2 changed files with 22 additions and 7 deletions
|
@ -6,14 +6,28 @@ import type { NotificationGroupReaction } from 'flavours/glitch/models/notificat
|
||||||
import type { LabelRenderer } from './notification_group_with_status';
|
import type { LabelRenderer } from './notification_group_with_status';
|
||||||
import { NotificationGroupWithStatus } from './notification_group_with_status';
|
import { NotificationGroupWithStatus } from './notification_group_with_status';
|
||||||
|
|
||||||
const labelRenderer: LabelRenderer = (values) => (
|
const labelRenderer: LabelRenderer = (displayedName, total) => {
|
||||||
|
if (total === 1)
|
||||||
|
return (
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='notification.reaction'
|
id='notification.reaction'
|
||||||
defaultMessage='{name} reacted to your status'
|
defaultMessage='{name} reacted to your status'
|
||||||
values={values}
|
values={{ name: displayedName }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<FormattedMessage
|
||||||
|
id='notification.reaction.name_and_others'
|
||||||
|
defaultMessage='{name} and {count, plural, one {# other} other {# others}} reacted to your post'
|
||||||
|
values={{
|
||||||
|
name: displayedName,
|
||||||
|
count: total - 1,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const NotificationReaction: React.FC<{
|
export const NotificationReaction: React.FC<{
|
||||||
notification: NotificationGroupReaction;
|
notification: NotificationGroupReaction;
|
||||||
unread: boolean;
|
unread: boolean;
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
"navigation_bar.misc": "Misc",
|
"navigation_bar.misc": "Misc",
|
||||||
"notification.markForDeletion": "Mark for deletion",
|
"notification.markForDeletion": "Mark for deletion",
|
||||||
"notification.reaction": "{name} reacted to your post",
|
"notification.reaction": "{name} reacted to your post",
|
||||||
|
"notification.reaction.name_and_others": "{name} and {count, plural, one {# other} other {# others}} reacted to your post",
|
||||||
"notification_purge.btn_all": "Select\nall",
|
"notification_purge.btn_all": "Select\nall",
|
||||||
"notification_purge.btn_apply": "Clear\nselected",
|
"notification_purge.btn_apply": "Clear\nselected",
|
||||||
"notification_purge.btn_invert": "Invert\nselection",
|
"notification_purge.btn_invert": "Invert\nselection",
|
||||||
|
|
Loading…
Reference in a new issue