diff --git a/src/PageManager.tsx b/src/PageManager.tsx index d010e7eb..913f5cb9 100644 --- a/src/PageManager.tsx +++ b/src/PageManager.tsx @@ -15,6 +15,7 @@ import { useRef, useState } from 'react' +import TooManyRelaysAlertDialog from './components/TooManyRelaysAlertDialog' import ExplorePage from './pages/primary/ExplorePage' import MePage from './pages/primary/MePage' import NotificationListPage from './pages/primary/NotificationListPage' @@ -300,6 +301,7 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) { {element} ))} + @@ -387,6 +389,7 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) { + diff --git a/src/components/AlertCard/index.tsx b/src/components/AlertCard/index.tsx new file mode 100644 index 00000000..c3142842 --- /dev/null +++ b/src/components/AlertCard/index.tsx @@ -0,0 +1,13 @@ +import { TriangleAlert } from 'lucide-react' + +export default function AlertCard({ title, content }: { title: string; content: string }) { + return ( +
+
+ +
{title}
+
+
{content}
+
+ ) +} diff --git a/src/components/MailboxSetting/RelayCountWarning.tsx b/src/components/MailboxSetting/RelayCountWarning.tsx new file mode 100644 index 00000000..584aa294 --- /dev/null +++ b/src/components/MailboxSetting/RelayCountWarning.tsx @@ -0,0 +1,37 @@ +import { TMailboxRelay } from '@/types' +import { useMemo } from 'react' +import { useTranslation } from 'react-i18next' +import AlertCard from '../AlertCard' + +export default function RelayCountWarning({ relays }: { relays: TMailboxRelay[] }) { + const { t } = useTranslation() + const readRelayCount = useMemo(() => { + return relays.filter((r) => r.scope !== 'write').length + }, [relays]) + const writeRelayCount = useMemo(() => { + return relays.filter((r) => r.scope !== 'read').length + }, [relays]) + const showReadWarning = readRelayCount > 4 + const showWriteWarning = writeRelayCount > 4 + + if (!showReadWarning && !showWriteWarning) { + return null + } + + return ( + + ) +} diff --git a/src/components/MailboxSetting/index.tsx b/src/components/MailboxSetting/index.tsx index 6e6f8025..be432f3a 100644 --- a/src/components/MailboxSetting/index.tsx +++ b/src/components/MailboxSetting/index.tsx @@ -6,6 +6,7 @@ import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import MailboxRelay from './MailboxRelay' import NewMailboxRelayInput from './NewMailboxRelayInput' +import RelayCountWarning from './RelayCountWarning' import SaveButton from './SaveButton' export default function MailboxSetting() { @@ -65,6 +66,7 @@ export default function MailboxSetting() {
{t('write relays description')}
{t('read & write relays notice')}
+
{relays.map((relay) => ( diff --git a/src/components/PostEditor/PollEditor.tsx b/src/components/PostEditor/PollEditor.tsx index 9ee036ea..48ccc13a 100644 --- a/src/components/PostEditor/PollEditor.tsx +++ b/src/components/PostEditor/PollEditor.tsx @@ -5,9 +5,10 @@ import { Switch } from '@/components/ui/switch' import { normalizeUrl } from '@/lib/url' import { TPollCreateData } from '@/types' import dayjs from 'dayjs' -import { AlertCircle, Eraser, X } from 'lucide-react' +import { Eraser, X } from 'lucide-react' import { Dispatch, SetStateAction, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' +import AlertCard from '../AlertCard' export default function PollEditor({ pollCreateData, @@ -124,17 +125,12 @@ export default function PollEditor({
-
-
- -
{t('This is a poll note.')}
-
-
- {t( - 'Unlike regular notes, polls are not widely supported and may not display on other clients.' - )} -
-
+ + + + + + + ) + } + + return ( + + + + {title} + {description} + + + + + + + + + ) +} diff --git a/src/constants.ts b/src/constants.ts index 285e9cc8..2f37e4e1 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -35,6 +35,7 @@ export const StorageKey = { MEDIA_UPLOAD_SERVICE_CONFIG_MAP: 'mediaUploadServiceConfigMap', HIDE_UNTRUSTED_NOTES: 'hideUntrustedNotes', DEFAULT_SHOW_NSFW: 'defaultShowNsfw', + DISMISSED_TOO_MANY_RELAYS_ALERT: 'dismissedTooManyRelaysAlert', MEDIA_UPLOAD_SERVICE: 'mediaUploadService', // deprecated HIDE_UNTRUSTED_EVENTS: 'hideUntrustedEvents', // deprecated ACCOUNT_RELAY_LIST_EVENT_MAP: 'accountRelayListEventMap', // deprecated diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index 6026683c..db550d18 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -338,6 +338,18 @@ export default { 'لم يتم العثور على قائمة المتابعة. هل تريد إنشاء واحدة جديدة؟ إذا كنت قد تابعت مستخدمين من قبل، يرجى عدم التأكيد لأن هذه العملية ستؤدي إلى فقدان قائمة المتابعة السابقة.', MuteListNotFoundConfirmation: 'لم يتم العثور على قائمة الكتم. هل تريد إنشاء واحدة جديدة؟ إذا كنت قد كتمت مستخدمين من قبل، يرجى عدم التأكيد لأن هذه العملية ستؤدي إلى فقدان قائمة الكتم السابقة.', - 'Show NSFW content by default': 'إظهار محتوى NSFW افتراضياً' + 'Show NSFW content by default': 'إظهار محتوى NSFW افتراضياً', + 'Too many read relays': 'Too many read relays', + 'Too many write relays': 'Too many write relays', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'Optimize Relay Settings': 'تحسين إعدادات الترحيل', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'قد لا تكون تكوينات الترحيل الحالية مثلى. هذا قد يجعل من الصعب على الآخرين العثور على منشوراتك وقد يؤدي إلى إشعارات غير مكتملة.', + 'Optimize Now': 'تحسين الآن', + 'Maybe Later': 'ربما لاحقاً', + "Don't remind me again": 'لا تذكرني مرة أخرى' } } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index c89c62d5..06250040 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -345,6 +345,18 @@ export default { 'Folgeliste nicht gefunden. Möchten Sie eine neue erstellen? Wenn Sie zuvor Benutzer gefolgt haben, bestätigen Sie bitte NICHT, da diese Operation dazu führt, dass Sie Ihre vorherige Folgeliste verlieren.', MuteListNotFoundConfirmation: 'Stummschaltungsliste nicht gefunden. Möchten Sie eine neue erstellen? Wenn Sie zuvor Benutzer stummgeschaltet haben, bestätigen Sie bitte NICHT, da diese Operation dazu führt, dass Sie Ihre vorherige Stummschaltungsliste verlieren.', - 'Show NSFW content by default': 'NSFW-Inhalte standardmäßig anzeigen' + 'Show NSFW content by default': 'NSFW-Inhalte standardmäßig anzeigen', + 'Too many read relays': 'Zu viele Lese-Relays', + 'Too many write relays': 'Zu viele Schreib-Relays', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Sie haben {{count}} Lese-Relays. Die meisten Clients verwenden nur 2-4 Relays, mehr einzustellen ist unnötig.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Sie haben {{count}} Schreib-Relays. Die meisten Clients verwenden nur 2-4 Relays, mehr einzustellen ist unnötig.', + 'Optimize Relay Settings': 'Relay-Einstellungen optimieren', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'Ihre aktuelle Relay-Konfiguration ist möglicherweise nicht optimal. Dies könnte es anderen erschweren, Ihre Beiträge zu finden und zu unvollständigen Benachrichtigungen führen.', + 'Optimize Now': 'Jetzt optimieren', + 'Maybe Later': 'Vielleicht später', + "Don't remind me again": 'Nicht mehr erinnern' } } diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index c65b55b5..f82ba820 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -339,6 +339,18 @@ export default { 'Follow list not found. Do you want to create a new one? If you have followed users before, please DO NOT confirm as this operation will cause you to lose your previous follow list.', MuteListNotFoundConfirmation: 'Mute list not found. Do you want to create a new one? If you have muted users before, please DO NOT confirm as this operation will cause you to lose your previous mute list.', - 'Show NSFW content by default': 'Show NSFW content by default' + 'Show NSFW content by default': 'Show NSFW content by default', + 'Too many read relays': 'Too many read relays', + 'Too many write relays': 'Too many write relays', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'Optimize Relay Settings': 'Optimize Relay Settings', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.', + 'Optimize Now': 'Optimize Now', + 'Maybe Later': 'Maybe Later', + "Don't remind me again": "Don't remind me again" } } diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 604e018b..9a8a2b14 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -344,6 +344,18 @@ export default { 'Lista de seguidos no encontrada. ¿Quieres crear una nueva? Si has seguido usuarios antes, por favor NO confirmes ya que esta operación te hará perder tu lista de seguidos anterior.', MuteListNotFoundConfirmation: 'Lista de silenciados no encontrada. ¿Quieres crear una nueva? Si has silenciado usuarios antes, por favor NO confirmes ya que esta operación te hará perder tu lista de silenciados anterior.', - 'Show NSFW content by default': 'Mostrar contenido NSFW por defecto' + 'Show NSFW content by default': 'Mostrar contenido NSFW por defecto', + 'Too many read relays': 'Demasiados relés de lectura', + 'Too many write relays': 'Demasiados relés de escritura', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Tienes {{count}} relés de lectura. La mayoría de los clientes solo usan 2-4 relés, configurar más es innecesario.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Tienes {{count}} relés de escritura. La mayoría de los clientes solo usan 2-4 relés, configurar más es innecesario.', + 'Optimize Relay Settings': 'Optimizar configuración de relés', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'Tu configuración actual de relés puede no ser óptima. Esto podría hacer que sea difícil para otros encontrar tus publicaciones y puede resultar en notificaciones incompletas.', + 'Optimize Now': 'Optimizar ahora', + 'Maybe Later': 'Tal vez más tarde', + "Don't remind me again": 'No recordar de nuevo' } } diff --git a/src/i18n/locales/fa.ts b/src/i18n/locales/fa.ts index 9f87f6e7..1fa1e2ba 100644 --- a/src/i18n/locales/fa.ts +++ b/src/i18n/locales/fa.ts @@ -339,6 +339,18 @@ export default { 'فهرست دنبال‌کنندگان پیدا نشد. آیا می‌خواهید یکی جدید ایجاد کنید؟ اگر قبلاً کاربرانی را دنبال کرده‌اید، لطفاً تأیید نکنید زیرا این عملیات باعث از دست رفتن فهرست دنبال‌کنندگان قبلی شما خواهد شد.', MuteListNotFoundConfirmation: 'فهرست بی‌صدا شده‌ها پیدا نشد. آیا می‌خواهید یکی جدید ایجاد کنید؟ اگر قبلاً کاربرانی را بی‌صدا کرده‌اید، لطفاً تأیید نکنید زیرا این عملیات باعث از دست رفتن فهرست بی‌صدا شده‌های قبلی شما خواهد شد.', - 'Show NSFW content by default': 'نمایش محتوای NSFW به صورت پیش‌فرض' + 'Show NSFW content by default': 'نمایش محتوای NSFW به صورت پیش‌فرض', + 'Too many read relays': 'Too many read relays', + 'Too many write relays': 'Too many write relays', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'Optimize Relay Settings': 'بهینه‌سازی تنظیمات رله', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'پیکربندی فعلی رله شما ممکن است بهینه نباشد. این ممکن است برای دیگران پیدا کردن پست‌های شما را دشوار کند و ممکن است منجر به اعلان‌های ناقص شود.', + 'Optimize Now': 'اکنون بهینه‌سازی کن', + 'Maybe Later': 'شاید بعداً', + "Don't remind me again": 'دیگر به من یادآوری نکن' } } diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index fc12e47e..786e0c78 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -344,6 +344,18 @@ export default { 'Liste de suivi non trouvée. Voulez-vous en créer une nouvelle ? Si vous avez suivi des utilisateurs auparavant, veuillez NE PAS confirmer car cette opération vous fera perdre votre liste de suivi précédente.', MuteListNotFoundConfirmation: 'Liste de mise en sourdine non trouvée. Voulez-vous en créer une nouvelle ? Si vous avez mis en sourdine des utilisateurs auparavant, veuillez NE PAS confirmer car cette opération vous fera perdre votre liste de mise en sourdine précédente.', - 'Show NSFW content by default': 'Afficher le contenu NSFW par défaut' + 'Show NSFW content by default': 'Afficher le contenu NSFW par défaut', + 'Too many read relays': 'Trop de relais de lecture', + 'Too many write relays': "Trop de relais d'écriture", + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + "Vous avez {{count}} relais de lecture. La plupart des clients n'utilisent que 2 à 4 relais, en configurer plus est inutile.", + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + "Vous avez {{count}} relais d'écriture. La plupart des clients n'utilisent que 2 à 4 relais, en configurer plus est inutile.", + 'Optimize Relay Settings': 'Optimiser les paramètres de relais', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'Votre configuration de relais actuelle pourrait ne pas être optimale. Cela pourrait rendre difficile pour les autres de trouver vos publications et pourrait entraîner des notifications incomplètes.', + 'Optimize Now': 'Optimiser maintenant', + 'Maybe Later': 'Peut-être plus tard', + "Don't remind me again": 'Ne plus me rappeler' } } diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index ff5d1761..494eaa81 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -343,6 +343,18 @@ export default { 'Elenco seguiti non trovato. Vuoi crearne uno nuovo? Se hai già seguito degli utenti in precedenza, per favore NON confermare poiché questa operazione causerà la perdita del tuo elenco seguiti precedente.', MuteListNotFoundConfirmation: 'Elenco utenti silenziati non trovato. Vuoi crearne uno nuovo? Se hai già silenziato degli utenti in precedenza, per favore NON confermare poiché questa operazione causerà la perdita del tuo elenco utenti silenziati precedente.', - 'Show NSFW content by default': 'Mostra contenuti NSFW per impostazione predefinita' + 'Show NSFW content by default': 'Mostra contenuti NSFW per impostazione predefinita', + 'Too many read relays': 'Troppi relay di lettura', + 'Too many write relays': 'Troppi relay di scrittura', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Hai {{count}} relay di lettura. La maggior parte dei client usa solo 2-4 relay, impostarne di più è inutile.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Hai {{count}} relay di scrittura. La maggior parte dei client usa solo 2-4 relay, impostarne di più è inutile.', + 'Optimize Relay Settings': 'Ottimizza impostazioni relay', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'La tua configurazione relay attuale potrebbe non essere ottimale. Questo potrebbe rendere difficile per gli altri trovare i tuoi post e potrebbe portare a notifiche incomplete.', + 'Optimize Now': 'Ottimizza ora', + 'Maybe Later': 'Forse più tardi', + "Don't remind me again": 'Non ricordarmelo più' } } diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index b5b9fc82..37544aaf 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -341,6 +341,18 @@ export default { 'フォローリストが見つかりません。新しいものを作成しますか?以前にユーザーをフォローしたことがある場合は、この操作により前のフォローリストが失われるため、確認しないでください。', MuteListNotFoundConfirmation: 'ミュートリストが見つかりません。新しいものを作成しますか?以前にユーザーをミュートしたことがある場合は、この操作により前のミュートリストが失われるため、確認しないでください。', - 'Show NSFW content by default': 'デフォルトでNSFWコンテンツを表示' + 'Show NSFW content by default': 'デフォルトでNSFWコンテンツを表示', + 'Too many read relays': '読み取りリレイが多すぎます', + 'Too many write relays': '書き込みリレイが多すぎます', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + '{{count}} 個の読み取りリレイがあります。ほとんどのクライアントは2〜4個のリレイのみを使用するため、それ以上設定する必要はありません。', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + '{{count}} 個の書き込みリレイがあります。ほとんどのクライアントは2〜4個のリレイのみを使用するため、それ以上設定する必要はありません。', + 'Optimize Relay Settings': 'リレイ設定を最適化', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + '現在のリレイ設定は最適ではない可能性があります。これにより、他の人があなたの投稿を見つけにくくなり、通知が不完全になる可能性があります。', + 'Optimize Now': '今すぐ最適化', + 'Maybe Later': '後で', + "Don't remind me again": '今後表示しない' } } diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts index 83ab52c1..f8744bf6 100644 --- a/src/i18n/locales/ko.ts +++ b/src/i18n/locales/ko.ts @@ -340,6 +340,18 @@ export default { '팔로우 목록을 찾을 수 없습니다. 새로 만드시겠습니까? 이전에 사용자를 팔로우한 적이 있다면 이 작업으로 인해 이전 팔로우 목록을 잃게 되므로 확인하지 마시기 바랍니다.', MuteListNotFoundConfirmation: '음소거 목록을 찾을 수 없습니다. 새로 만드시겠습니까? 이전에 사용자를 음소거한 적이 있다면 이 작업으로 인해 이전 음소거 목록을 잃게 되므로 확인하지 마시기 바랍니다.', - 'Show NSFW content by default': '기본적으로 NSFW 콘텐츠 표시' + 'Show NSFW content by default': '기본적으로 NSFW 콘텐츠 표시', + 'Too many read relays': '읽기 릴레이가 너무 많습니다', + 'Too many write relays': '쓰기 릴레이가 너무 많습니다', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + '{{count}}개의 읽기 릴레이가 있습니다. 대부분의 클라이언트는 2-4개의 릴레이만 사용하므로 더 설정하는 것은 불필요합니다.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + '{{count}}개의 쓰기 릴레이가 있습니다. 대부분의 클라이언트는 2-4개의 릴레이만 사용하므로 더 설정하는 것은 불필요합니다.', + 'Optimize Relay Settings': '릴레이 설정 최적화', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + '현재 릴레이 설정이 최적이 아닐 수 있습니다. 이로 인해 다른 사람들이 귀하의 게시물을 찾기 어려워지고 알림이 불완전할 수 있습니다.', + 'Optimize Now': '지금 최적화', + 'Maybe Later': '나중에', + "Don't remind me again": '다시 알리지 않기' } } diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index a58afd11..4cf1249c 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -343,6 +343,18 @@ export default { 'Lista obserwowanych nie została znaleziona. Czy chcesz utworzyć nową? Jeśli wcześniej obserwowałeś użytkowników, proszę NIE potwierdzaj, ponieważ ta operacja spowoduje utratę poprzedniej listy obserwowanych.', MuteListNotFoundConfirmation: 'Lista wyciszonych nie została znaleziona. Czy chcesz utworzyć nową? Jeśli wcześniej wyciszałeś użytkowników, proszę NIE potwierdzaj, ponieważ ta operacja spowoduje utratę poprzedniej listy wyciszonych.', - 'Show NSFW content by default': 'Domyślnie pokazuj treści NSFW' + 'Show NSFW content by default': 'Domyślnie pokazuj treści NSFW', + 'Too many read relays': 'Too many read relays', + 'Too many write relays': 'Too many write relays', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'Optimize Relay Settings': 'Optymalizuj ustawienia przekaźników', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'Twoja obecna konfiguracja przekaźników może nie być optymalna. To może utrudnić innym znalezienie Twoich postów i może skutkować niekompletnymi powiadomieniami.', + 'Optimize Now': 'Optymalizuj teraz', + 'Maybe Later': 'Może później', + "Don't remind me again": 'Nie przypominaj mi więcej' } } diff --git a/src/i18n/locales/pt-BR.ts b/src/i18n/locales/pt-BR.ts index 0667ee83..68bb2d6c 100644 --- a/src/i18n/locales/pt-BR.ts +++ b/src/i18n/locales/pt-BR.ts @@ -342,6 +342,18 @@ export default { 'Lista de seguindo não encontrada. Deseja criar uma nova? Se você seguiu usuários antes, por favor NÃO confirme, pois esta operação fará você perder sua lista de seguindo anterior.', MuteListNotFoundConfirmation: 'Lista de silenciados não encontrada. Deseja criar uma nova? Se você silenciou usuários antes, por favor NÃO confirme, pois esta operação fará você perder sua lista de silenciados anterior.', - 'Show NSFW content by default': 'Mostrar conteúdo NSFW por padrão' + 'Show NSFW content by default': 'Mostrar conteúdo NSFW por padrão', + 'Too many read relays': 'Muitos relays de leitura', + 'Too many write relays': 'Muitos relays de escrita', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Você tem {{count}} relays de leitura. A maioria dos clientes usa apenas 2-4 relays, configurar mais é desnecessário.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Você tem {{count}} relays de escrita. A maioria dos clientes usa apenas 2-4 relays, configurar mais é desnecessário.', + 'Optimize Relay Settings': 'Otimizar configurações de relay', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'Sua configuração atual de relay pode não ser ideal. Isso pode tornar difícil para outros encontrarem suas postagens e pode resultar em notificações incompletas.', + 'Optimize Now': 'Otimizar agora', + 'Maybe Later': 'Talvez mais tarde', + "Don't remind me again": 'Não me lembrar novamente' } } diff --git a/src/i18n/locales/pt-PT.ts b/src/i18n/locales/pt-PT.ts index ba20c453..2d569dfc 100644 --- a/src/i18n/locales/pt-PT.ts +++ b/src/i18n/locales/pt-PT.ts @@ -343,6 +343,18 @@ export default { 'Lista de seguir não encontrada. Deseja criar uma nova? Se seguiu utilizadores anteriormente, por favor NÃO confirme, pois esta operação fará com que perca a sua lista de seguir anterior.', MuteListNotFoundConfirmation: 'Lista de silenciados não encontrada. Deseja criar uma nova? Se silenciou utilizadores anteriormente, por favor NÃO confirme, pois esta operação fará com que perca a sua lista de silenciados anterior.', - 'Show NSFW content by default': 'Mostrar conteúdo NSFW por padrão' + 'Show NSFW content by default': 'Mostrar conteúdo NSFW por padrão', + 'Too many read relays': 'Demasiados relays de leitura', + 'Too many write relays': 'Demasiados relays de escrita', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Tem {{count}} relays de leitura. A maioria dos clientes usa apenas 2-4 relays, configurar mais é desnecessário.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'Tem {{count}} relays de escrita. A maioria dos clientes usa apenas 2-4 relays, configurar mais é desnecessário.', + 'Optimize Relay Settings': 'Optimizar definições de relay', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'A sua configuração actual de relay pode não ser ideal. Isto pode tornar difícil para outros encontrarem as suas publicações e pode resultar em notificações incompletas.', + 'Optimize Now': 'Optimizar agora', + 'Maybe Later': 'Talvez mais tarde', + "Don't remind me again": 'Não me relembrar novamente' } } diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 4b32b530..e5392595 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -343,6 +343,18 @@ export default { 'Список подписок не найден. Хотите создать новый? Если вы уже подписывались на пользователей ранее, пожалуйста, НЕ подтверждайте, так как эта операция приведет к потере вашего предыдущего списка подписок.', MuteListNotFoundConfirmation: 'Список заблокированных не найден. Хотите создать новый? Если вы уже блокировали пользователей ранее, пожалуйста, НЕ подтверждайте, так как эта операция приведет к потере вашего предыдущего списка заблокированных.', - 'Show NSFW content by default': 'Показывать контент NSFW по умолчанию' + 'Show NSFW content by default': 'Показывать контент NSFW по умолчанию', + 'Too many read relays': 'Слишком много релеев для чтения', + 'Too many write relays': 'Слишком много релеев для записи', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'У вас {{count}} релеев для чтения. Большинство клиентов используют только 2-4 релея, устанавливать больше не нужно.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'У вас {{count}} релеев для записи. Большинство клиентов используют только 2-4 релея, устанавливать больше не нужно.', + 'Optimize Relay Settings': 'Оптимизировать настройки релеев', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'Ваша текущая конфигурация релеев может быть не оптимальной. Это может затруднить поиск ваших сообщений другими пользователями и привести к неполным уведомлениям.', + 'Optimize Now': 'Оптимизировать сейчас', + 'Maybe Later': 'Возможно, позже', + "Don't remind me again": 'Больше не напоминать' } } diff --git a/src/i18n/locales/th.ts b/src/i18n/locales/th.ts index e90b189b..5a0f07cf 100644 --- a/src/i18n/locales/th.ts +++ b/src/i18n/locales/th.ts @@ -337,6 +337,18 @@ export default { 'ไม่พบรายการติดตาม คุณต้องการสร้างรายการใหม่หรือไม่? หากคุณเคยติดตามผู้ใช้มาก่อน กรุณาอย่ายืนยัน เพราะการดำเนินการนี้จะทำให้คุณสูญเสียรายการติดตามก่อนหน้านี้', MuteListNotFoundConfirmation: 'ไม่พบรายการปิดเสียง คุณต้องการสร้างรายการใหม่หรือไม่? หากคุณเคยปิดเสียงผู้ใช้มาก่อน กรุณาอย่ายืนยัน เพราะการดำเนินการนี้จะทำให้คุณสูญเสียรายการปิดเสียงก่อนหน้านี้', - 'Show NSFW content by default': 'แสดงเนื้อหา NSFW โดยค่าเริ่มต้น' + 'Show NSFW content by default': 'แสดงเนื้อหา NSFW โดยค่าเริ่มต้น', + 'Too many read relays': 'Too many read relays', + 'Too many write relays': 'Too many write relays', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.', + 'Optimize Relay Settings': 'ปรับแต่งการตั้งค่า Relay ให้เหมาะสม', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + 'การตั้งค่า relay ปัจจุบันของคุณอาจไม่เหมาะสม อาจทำให้คนอื่นหาโพสต์ของคุณได้ยากและอาจส่งผลให้การแจ้งเตือนไม่สมบูรณ์', + 'Optimize Now': 'ปรับแต่งตอนนี้', + 'Maybe Later': 'ทีหลังค่อยว่า', + "Don't remind me again": 'ไม่ต้องเตือนอีก' } } diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 86b379f2..b7b7614d 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -336,6 +336,18 @@ export default { '未找到关注列表。你想创建一个新的吗?如果你之前已经关注了用户,请不要确认,因为此操作会导致你丢失之前的关注列表。', MuteListNotFoundConfirmation: '未找到屏蔽列表。你想创建一个新的吗?如果你之前已经屏蔽了用户,请不要确认,因为此操作会导致你丢失之前的屏蔽列表。', - 'Show NSFW content by default': '默认显示 NSFW 内容' + 'Show NSFW content by default': '默认显示 NSFW 内容', + 'Too many read relays': '读取中继过多', + 'Too many write relays': '写入中继过多', + 'You have {{count}} read relays. Most clients only use 2-4 relays, setting more is unnecessary.': + '您有 {{count}} 个读取中继。大多数客户端只使用 2-4 个中继,设置更多是不必要的。', + 'You have {{count}} write relays. Most clients only use 2-4 relays, setting more is unnecessary.': + '您有 {{count}} 个写入中继。大多数客户端只使用 2-4 个中继,设置更多是不必要的。', + 'Optimize Relay Settings': '优化中继设置', + 'Your current relay configuration may not be optimal. This could make it difficult for others to find your posts and may result in incomplete notifications.': + '您当前的中继配置可能不是最优的。这可能导致其他人难以找到您发布的内容,也可能导致您无法获取完整的通知列表。', + 'Optimize Now': '立即优化', + 'Maybe Later': '稍后处理', + "Don't remind me again": '不再提醒' } } diff --git a/src/services/local-storage.service.ts b/src/services/local-storage.service.ts index 528731c1..e718d844 100644 --- a/src/services/local-storage.service.ts +++ b/src/services/local-storage.service.ts @@ -33,6 +33,7 @@ class LocalStorageService { private translationServiceConfigMap: Record = {} private mediaUploadServiceConfigMap: Record = {} private defaultShowNsfw: boolean = false + private dismissedTooManyRelaysAlert: boolean = false constructor() { if (!LocalStorageService.instance) { @@ -134,8 +135,10 @@ class LocalStorageService { this.mediaUploadServiceConfigMap = JSON.parse(mediaUploadServiceConfigMapStr) } - const defaultShowNsfwStr = window.localStorage.getItem(StorageKey.DEFAULT_SHOW_NSFW) - this.defaultShowNsfw = defaultShowNsfwStr === 'true' + this.defaultShowNsfw = window.localStorage.getItem(StorageKey.DEFAULT_SHOW_NSFW) === 'true' + + this.dismissedTooManyRelaysAlert = + window.localStorage.getItem(StorageKey.DISMISSED_TOO_MANY_RELAYS_ALERT) === 'true' // Clean up deprecated data window.localStorage.removeItem(StorageKey.ACCOUNT_PROFILE_EVENT_MAP) @@ -360,6 +363,15 @@ class LocalStorageService { this.defaultShowNsfw = defaultShowNsfw window.localStorage.setItem(StorageKey.DEFAULT_SHOW_NSFW, defaultShowNsfw.toString()) } + + getDismissedTooManyRelaysAlert() { + return this.dismissedTooManyRelaysAlert + } + + setDismissedTooManyRelaysAlert(dismissed: boolean) { + this.dismissedTooManyRelaysAlert = dismissed + window.localStorage.setItem(StorageKey.DISMISSED_TOO_MANY_RELAYS_ALERT, dismissed.toString()) + } } const instance = new LocalStorageService()