diff --git a/public/locales/en.json b/public/locales/en.json index aef5137a..5bd20971 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -451,5 +451,61 @@ "broken_message": "Broken message", "empty_message": "Empty message", "edited": " (edited)" + }, + "Inbox": { + "inbox": "Inbox", + "invites": "Invites", + "notifications": "Notifications", + + "notification_messages": "Notifications", + "filter": "Filter", + "all_notifications": "All Notifications", + "highlighted": "Highlighted", + "mark_as_read": "Mark as Read", + "open": "Open", + "no_notifications": "No Notifications", + "no_notifications_desc": "You don't have any new notifications to display yet.", + "scroll_to_top": "Scroll to Top", + + "encrypted": "Encrypted", + "direct_message": "Direct Message", + "space": "Space", + "decline": "Decline", + "accept": "Accept", + "from": "From: ", + "reason_label": "Reason: ", + + "primary": "Primary", + "public": "Public", + "spam": "Spam", + + "no_invites": "No Invites", + "no_invites_known_desc": "When someone you share a room with sends you an invite, it'll show up here.", + "no_invites_unknown_desc": "Invites from people outside your rooms will appear here.", + "decline_all": "Decline All", + + "spam_invites_count_one": "{{count}} Spam Invite", + "spam_invites_count_other": "{{count}} Spam Invites", + "spam_invites_desc": "Some of the following invites may contain harmful content or have been sent by banned users.", + "report_all": "Report All", + "block_all": "Block All", + "hide_all": "Hide All", + "view_all": "View All", + "no_spam_invites": "No Spam Invites", + "no_spam_invites_desc": "Invites detected as spam appear here.", + + "invite_title": "Invite", + "user_id": "User ID", + "user_id_placeholder": "@username:server", + "reason_optional": "Reason (Optional)", + "invite_button": "Invite", + + "notif_default": "Default", + "notif_all_messages": "All Messages", + "notif_mentions_keywords": "Mention & Keywords", + "notif_mute": "Mute", + + "unverified_device": "Unverified Device", + "unverified_devices": "Unverified Devices" } } diff --git a/public/locales/ru.json b/public/locales/ru.json index 31fc5a62..2361c3de 100644 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -451,5 +451,63 @@ "broken_message": "Повреждённое сообщение", "empty_message": "Пустое сообщение", "edited": " (изменено)" + }, + "Inbox": { + "inbox": "Входящие", + "invites": "Приглашения", + "notifications": "Уведомления", + + "notification_messages": "Уведомления", + "filter": "Фильтр", + "all_notifications": "Все уведомления", + "highlighted": "Выделенные", + "mark_as_read": "Отметить прочитанным", + "open": "Открыть", + "no_notifications": "Нет уведомлений", + "no_notifications_desc": "У вас пока нет новых уведомлений.", + "scroll_to_top": "Наверх", + + "encrypted": "Зашифровано", + "direct_message": "Личное сообщение", + "space": "Пространство", + "decline": "Отклонить", + "accept": "Принять", + "from": "От: ", + "reason_label": "Причина: ", + + "primary": "Основные", + "public": "Публичные", + "spam": "Спам", + + "no_invites": "Нет приглашений", + "no_invites_known_desc": "Когда кто-то, с кем вы состоите в одной комнате, отправит вам приглашение, оно появится здесь.", + "no_invites_unknown_desc": "Приглашения от людей за пределами ваших комнат появятся здесь.", + "decline_all": "Отклонить все", + + "spam_invites_count_one": "{{count}} спам-приглашение", + "spam_invites_count_few": "{{count}} спам-приглашения", + "spam_invites_count_many": "{{count}} спам-приглашений", + "spam_invites_count_other": "{{count}} спам-приглашений", + "spam_invites_desc": "Некоторые из этих приглашений могут содержать вредоносный контент или были отправлены забаненными пользователями.", + "report_all": "Пожаловаться на все", + "block_all": "Заблокировать всех", + "hide_all": "Скрыть все", + "view_all": "Показать все", + "no_spam_invites": "Нет спам-приглашений", + "no_spam_invites_desc": "Приглашения, распознанные как спам, появятся здесь.", + + "invite_title": "Пригласить", + "user_id": "ID пользователя", + "user_id_placeholder": "@username:server", + "reason_optional": "Причина (необязательно)", + "invite_button": "Пригласить", + + "notif_default": "По умолчанию", + "notif_all_messages": "Все сообщения", + "notif_mentions_keywords": "Упоминания и ключевые слова", + "notif_mute": "Без уведомлений", + + "unverified_device": "Неподтверждённое устройство", + "unverified_devices": "Неподтверждённые устройства" } } diff --git a/src/app/components/RoomNotificationSwitcher.tsx b/src/app/components/RoomNotificationSwitcher.tsx index 7ce91566..9bab99c5 100644 --- a/src/app/components/RoomNotificationSwitcher.tsx +++ b/src/app/components/RoomNotificationSwitcher.tsx @@ -1,6 +1,7 @@ import { Box, config, Icon, Menu, MenuItem, PopOut, RectCords, Text } from 'folds'; import React, { MouseEventHandler, ReactNode, useMemo, useState } from 'react'; import FocusTrap from 'focus-trap-react'; +import { useTranslation } from 'react-i18next'; import { stopPropagation } from '../utils/keyboard'; import { getRoomNotificationModeIcon, @@ -20,16 +21,18 @@ const useRoomNotificationModes = (): RoomNotificationMode[] => [] ); -const useRoomNotificationModeStr = (): Record => - useMemo( +const useRoomNotificationModeStr = (): Record => { + const { t } = useTranslation(); + return useMemo( () => ({ - [RoomNotificationMode.Unset]: 'Default', - [RoomNotificationMode.AllMessages]: 'All Messages', - [RoomNotificationMode.SpecialMessages]: 'Mention & Keywords', - [RoomNotificationMode.Mute]: 'Mute', + [RoomNotificationMode.Unset]: t('Inbox.notif_default'), + [RoomNotificationMode.AllMessages]: t('Inbox.notif_all_messages'), + [RoomNotificationMode.SpecialMessages]: t('Inbox.notif_mentions_keywords'), + [RoomNotificationMode.Mute]: t('Inbox.notif_mute'), }), - [] + [t] ); +}; type NotificationModeSwitcherProps = { roomId: string; diff --git a/src/app/components/invite-user-prompt/InviteUserPrompt.tsx b/src/app/components/invite-user-prompt/InviteUserPrompt.tsx index ddac0576..a121d27a 100644 --- a/src/app/components/invite-user-prompt/InviteUserPrompt.tsx +++ b/src/app/components/invite-user-prompt/InviteUserPrompt.tsx @@ -32,6 +32,7 @@ import { import { Room } from 'matrix-js-sdk'; import { isKeyHotkey } from 'is-hotkey'; import FocusTrap from 'focus-trap-react'; +import { useTranslation } from 'react-i18next'; import { stopPropagation } from '../../utils/keyboard'; import { useDirectUsers } from '../../hooks/useDirectUsers'; import { getMxIdLocalPart, getMxIdServer, isUserId } from '../../utils/matrix'; @@ -56,6 +57,7 @@ type InviteUserProps = { requestClose: () => void; }; export function InviteUserPrompt({ room, requestClose }: InviteUserProps) { + const { t } = useTranslation(); const mx = useMatrixClient(); const alive = useAlive(); @@ -169,7 +171,7 @@ export function InviteUserPrompt({ room, requestClose }: InviteUserProps) { > - Invite + {t('Inbox.invite_title')} @@ -187,14 +189,14 @@ export function InviteUserPrompt({ room, requestClose }: InviteUserProps) { gap="400" > - User ID + {t('Inbox.user_id')}
- Reason (Optional) + {t('Inbox.reason_optional')}