From 7a876c2ccec9cf91fa5d9cb75ce6073538f8537b Mon Sep 17 00:00:00 2001 From: Alexander Petkov Date: Thu, 1 Feb 2024 13:17:31 +0200 Subject: [PATCH] locales: Fix broken translation of notifications modal on some pages Not every page includes the auth namespace, thus on some pages, translation on buttons is broken(Blog, finance report etc..) Move notification related ctas, to the common namespace --- public/locales/bg/auth.json | 1 - public/locales/bg/common.json | 12 ++++++++---- public/locales/en/auth.json | 1 - public/locales/en/common.json | 12 ++++++++---- .../client/notifications/CampaignSubscribeModal.tsx | 10 +++++----- .../client/notifications/GeneralSubscribeModal.tsx | 10 +++++----- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/public/locales/bg/auth.json b/public/locales/bg/auth.json index 440e59019..943d0491f 100644 --- a/public/locales/bg/auth.json +++ b/public/locales/bg/auth.json @@ -12,7 +12,6 @@ }, "cta": { "login": "Вход", - "guest": "Като гост", "logout": "Изход", "register": "Регистрация", "send": "Изпрати", diff --git a/public/locales/bg/common.json b/public/locales/bg/common.json index 39d98e0c0..8517c4046 100644 --- a/public/locales/bg/common.json +++ b/public/locales/bg/common.json @@ -102,6 +102,13 @@ "more-information": "Повече информация" }, "notifications": { + "cta": { + "login": "Вход", + "guest": "Като гост", + "subscribe-button": "Запиши ме", + "profile-button": "На профилния", + "another-button": "На друг" + }, "subscribe": "Абонирай се за email известия за кампанията", "subscribeFooter": "Абонирай се за бюлетина", "subscribeGeneral": "Абонирайте се за email известия от Подкрепи.бг", @@ -118,10 +125,7 @@ "subscribe-text-nonLoggedUser-general": "Моля, продължи като гост и въведи email адреса, на който желаеш да получаваш известия от нас, или влез в профила си. Вписвайки се с потребителското си име и парола, ще можеш да управляваш абонамента си от своя Личен профил.", "subscribe-text-loggedUser": "Моля, избери дали желаеш да получаваш новините за кампанията на email адреса, асоцииран с профила ти, или на алтернативен адрес:", "subscribe-subtitle": "Искам да получавам новини и известия от Подкрепи.бг на този email адрес:", - "subscribe-campaign-subtTitle": "Искам да получавам новини за кампанията на този email адрес:", - "subscribe-button": "Запиши ме", - "profile-button": "На профилния", - "another-button": "На друг" + "subscribe-campaign-subtTitle": "Искам да получавам новини за кампанията на този email адрес:" }, "cookieConsent": "Подкрепи.бг не използва бисквитки, освен тези от трети страни, нужни за аналитичните компоненти Google Analytics и HotJar. Приемането на бисквитките ще ни помогне да подобрим вашето потребителско преживяване.", "cookieConsentButton": "Приемам", diff --git a/public/locales/en/auth.json b/public/locales/en/auth.json index 8fb087a09..a3e659ade 100644 --- a/public/locales/en/auth.json +++ b/public/locales/en/auth.json @@ -11,7 +11,6 @@ }, "cta": { "login": "Login", - "guest": "As guest", "logout": "Logout", "register": "Register", "send": "Send", diff --git a/public/locales/en/common.json b/public/locales/en/common.json index c047bf5e1..b385ca011 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -102,6 +102,13 @@ "more-information": "More information" }, "notifications": { + "cta": { + "login": "Login", + "guest": "As guest", + "subscribe-button": "Subscribe me", + "profile-button": "On the profile one", + "another-button": "On another one" + }, "subscribe": "Subscribe for email notifications for the campaign", "subscribeFooter": "Subscribe for the newsletter", "subscribeGeneral": "Subscribe for email notifications from Podkrepi.bg", @@ -118,10 +125,7 @@ "subscribe-text-nonLoggedUser-general": "Please, proceed as a guest and write down your email, on which you want to receive notifications from us or you can log in. If you log in with your and password you will be able to manage your subscription from your Personal profile", "subscribe-text-loggedUser": "Please, choose if you want to receive the news about the campaign on your profile email or on another one:", "subscribe-subtitle": "I want to receive news and notifications from Podkrepi.bg on this email:", - "subscribe-campaign-subtTitle": "I want to receive news about the campaign on this email:", - "subscribe-button": "Subscribe me", - "profile-button": "On the profile one", - "another-button": "On another one" + "subscribe-campaign-subtTitle": "I want to receive news about the campaign on this email:" }, "cookieConsent": "Podkrepi.bg doesn't use cookies, except the third-party cookies required for the analytics components Google Analytics and HotJar. Accepting the cookies will help us improve your user experience.", diff --git a/src/components/client/notifications/CampaignSubscribeModal.tsx b/src/components/client/notifications/CampaignSubscribeModal.tsx index fb8f1ac4e..fd919cf44 100644 --- a/src/components/client/notifications/CampaignSubscribeModal.tsx +++ b/src/components/client/notifications/CampaignSubscribeModal.tsx @@ -120,7 +120,7 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda @@ -177,8 +177,8 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda className={classes.subscribeBtn} label={ status !== 'authenticated' - ? 'auth:cta.login' - : 'common:notifications.profile-button' + ? 'common:notifications.cta.login' + : 'common:notifications.cta.profile-button' } loading={loading} onClick={() => sendOnProfileEmail(status)} @@ -190,8 +190,8 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda className={classes.subscribeBtn} label={ status !== 'authenticated' - ? 'auth:cta.guest' - : 'common:notifications.another-button' + ? 'common:notifications.cta.guest' + : 'common:notifications.cta.another-button' } loading={loading} onClick={() => openAsGuest()} diff --git a/src/components/client/notifications/GeneralSubscribeModal.tsx b/src/components/client/notifications/GeneralSubscribeModal.tsx index 1f09c12fb..0b489db25 100644 --- a/src/components/client/notifications/GeneralSubscribeModal.tsx +++ b/src/components/client/notifications/GeneralSubscribeModal.tsx @@ -125,7 +125,7 @@ export default function RenderSubscribeModal({ setOpen }: ModalProps) { @@ -182,8 +182,8 @@ export default function RenderSubscribeModal({ setOpen }: ModalProps) { className={classes.subscribeBtn} label={ status !== 'authenticated' - ? 'auth:cta.login' - : 'common:notifications.profile-button' + ? 'common:notifications.cta.login' + : 'common:notifications.cta.profile-button' } loading={loading} onClick={() => sendOnProfileEmail(status)} @@ -195,8 +195,8 @@ export default function RenderSubscribeModal({ setOpen }: ModalProps) { className={classes.subscribeBtn} label={ status !== 'authenticated' - ? 'auth:cta.guest' - : 'common:notifications.another-button' + ? 'common:notifications.cta.guest' + : 'common:notifications.cta.another-button' } loading={loading} onClick={() => openAsGuest()}