From 2ff29b9e0fab0509ee0235f6b1c61ae2bdb56d7c Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 5 Jun 2024 19:31:31 +0300 Subject: [PATCH] profile-fix --- public/locales/en/translation.json | 7 ++----- public/locales/ru/translation.json | 8 ++------ src/components/Author/AuthorBadge/AuthorBadge.tsx | 2 +- src/components/Topic/TopicBadge/TopicBadge.tsx | 2 +- src/components/_shared/Subscribers/Subscribers.tsx | 4 ++-- src/context/session.tsx | 2 +- 6 files changed, 9 insertions(+), 16 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 09e06239..f2efa988 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -190,8 +190,8 @@ "Follow the topic": "Follow the topic", "follower": "follower", "Followers": "Followers", - "followersWithCount": "{count} {count, plural, one {follower} other {followers}}", - "FollowersWithCount": "{count, plural, =0 {no followers} one {{count} follower} other {{count} followers}}", + "some followings": "{count, plural, =0 {no followings} one {{count} following} few {{count} followings} other {{count} followings}}", + "some followers": "{count, plural, =0 {no followers} one {{count} follower} other {{count} followers}}", "Following": "Following", "Following...": "Following...", "Forgot password?": "Forgot password?", @@ -258,7 +258,6 @@ "It's OK. Just enter your email to receive a link to change your password": "It's OK. Just enter your email to receive a link to change your password", "italic": "italic", "Italic": "Italic", - "Join": "Join", "Join our maillist": "To receive the best postings, just enter your email", "Join our team of authors": "Join our team of authors", "Join our team of authors text": "Каждый месяц на Дискурсе публикуются десятки новых авторов. Станьте одним из них — предложите свой материал в журнал и присоединитесь к горизонтальной редакции", @@ -438,14 +437,12 @@ "subscriber": "subscriber", "subscriber_rp": "subscriber", "subscribers": "subscribers", - "FollowersWithCount": "{count, plural, =0 {no followers} one {{count} follower} other {{count} followers}}", "subscribing...": "subscribing...", "subscription": "subscription", "Subscription": "Subscription", "subscription_rp": "subscription", "subscriptions": "subscriptions", "Subscriptions": "Subscriptions", - "FollowsWithCount": "{count, plural, =0 {no subscriptions} one {{count} subscription} other {{count} subscriptions}}", "Substrate": "Substrate", "Success": "Success", "Successfully authorized": "Authorization successful", diff --git a/public/locales/ru/translation.json b/public/locales/ru/translation.json index abae2819..26b48558 100644 --- a/public/locales/ru/translation.json +++ b/public/locales/ru/translation.json @@ -28,7 +28,6 @@ "Alignment center": "По центру", "Alignment left": "По левому краю", "Alignment right": "По правому краю", - "All": "Общая лента", "All articles": "Все материалы", "All authors": "Все авторы", "All posts": "Все публикации", @@ -198,8 +197,7 @@ "Follow the topic": "Подписаться на тему", "follower": "подписчик", "Followers": "Подписчики", - "followersWithCount": "{count} {count, plural, one {подписчик} few {подписчика} other {подписчиков}}", - "FollowersWithCount": "{count, plural, =0 {нет подписчиков} one {{count} подписчик} few {{count} подписчика} other {{count} подписчиков}}", + "some followers": "{count, plural, =0 {нет подписчиков} one {{count} подписчик} few {{count} подписчика} other {{count} подписчиков}}", "Following": "Вы подписаны", "Following...": "Подписываем...", "Forgot password?": "Забыли пароль?", @@ -270,7 +268,6 @@ "It's OK. Just enter your email to receive a link to change your password": "Ничего страшного. Просто укажите свою почту, чтобы получить ссылку для смены пароля", "italic": "курсив", "Italic": "Курсив", - "Join": "Присоединиться", "Join our maillist": "Чтобы получать рассылку лучших публикаций, просто укажите свою почту", "Join our team of authors": "Станьте автором", "Join our team of authors text": "Каждый месяц на Дискурсе публикуются десятки новых авторов.
Станьте одним из них — предложите свой материал в журнал и присоединитесь к горизонтальной редакции", @@ -466,11 +463,10 @@ "subscriber": "подписчик", "subscriber_rp": "подписчика", "subscribers": "подписчиков", - "FollowersWithCount": "{count, plural, =0 {нет подписчиков} one {{count} подписчик} few {{count} подписчика} other {{count} подписчиков}}", "subscribing...": "Подписка...", "Subscription": "Подписка", "Subscriptions": "Подписки", - "FollowsWithCount": "{count, plural, =0 {нет подписок} one {{count} подписка} few {{count} подписки} other {{count} подписок}}", + "some followings": "{count, plural, =0 {нет подписок} one {{count} подписка} few {{count} подписки} other {{count} подписок}}", "Substrate": "Подложка", "Success": "Успешно", "Successfully authorized": "Авторизация успешна", diff --git a/src/components/Author/AuthorBadge/AuthorBadge.tsx b/src/components/Author/AuthorBadge/AuthorBadge.tsx index f5aa23de..281c058f 100644 --- a/src/components/Author/AuthorBadge/AuthorBadge.tsx +++ b/src/components/Author/AuthorBadge/AuthorBadge.tsx @@ -124,7 +124,7 @@ export const AuthorBadge = (props: Props) => {
{t('CommentsWithCount', { count: props.author.stat?.comments ?? 0 })}
0}> -
{t('FollowersWithCount', { count: props.author.stat?.followers ?? 0 })}
+
{t('some followers', { count: props.author.stat?.followers ?? 0 })}
diff --git a/src/components/Topic/TopicBadge/TopicBadge.tsx b/src/components/Topic/TopicBadge/TopicBadge.tsx index 61bbb8f0..fe708817 100644 --- a/src/components/Topic/TopicBadge/TopicBadge.tsx +++ b/src/components/Topic/TopicBadge/TopicBadge.tsx @@ -104,7 +104,7 @@ export const TopicBadge = (props: Props) => { {t('authorsWithCount', { count: props.topic?.stat?.authors })} - {t('FollowersWithCount', { count: props.topic?.stat?.followers })} + {t('some followers', { count: props.topic?.stat?.followers })} diff --git a/src/components/_shared/Subscribers/Subscribers.tsx b/src/components/_shared/Subscribers/Subscribers.tsx index 899f5565..d3814a20 100644 --- a/src/components/_shared/Subscribers/Subscribers.tsx +++ b/src/components/_shared/Subscribers/Subscribers.tsx @@ -28,7 +28,7 @@ export const Subscribers = (props: Props) => {
- {t('SubscriberWithCount', { + {t('some followers', { count: props.followersAmount || props.followers.length || 0, })}
@@ -57,7 +57,7 @@ export const Subscribers = (props: Props) => {
- {t('SubscriptionWithCount', { + {t('some followings', { count: props.followingAmount || props.following?.length || 0, })}
diff --git a/src/context/session.tsx b/src/context/session.tsx index aa2259aa..92502b83 100644 --- a/src/context/session.tsx +++ b/src/context/session.tsx @@ -203,7 +203,7 @@ export const SessionProvider = (props: { ssrLoadFrom: 'initial', initialValue: null, }) - const author = createMemo(() => session().user?.app_data?.profile) + const author = createMemo(() => session()?.user?.app_data?.profile) const checkSessionIsExpired = () => { const expires_at_data = localStorage.getItem('expires_at')