Skip to content

Commit

Permalink
locales: Fix broken translation of notifications modal on some pages (#…
Browse files Browse the repository at this point in the history
…1714)

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
  • Loading branch information
sashko9807 authored Feb 1, 2024
1 parent 324bd9f commit b825364
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 20 deletions.
1 change: 0 additions & 1 deletion public/locales/bg/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
},
"cta": {
"login": "Вход",
"guest": "Като гост",
"logout": "Изход",
"register": "Регистрация",
"send": "Изпрати",
Expand Down
12 changes: 8 additions & 4 deletions public/locales/bg/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@
"more-information": "Повече информация"
},
"notifications": {
"cta": {
"login": "Вход",
"guest": "Като гост",
"subscribe-button": "Запиши ме",
"profile-button": "На профилния",
"another-button": "На друг"
},
"subscribe": "Абонирай се за email известия за кампанията",
"subscribeFooter": "Абонирай се за бюлетина",
"subscribeGeneral": "Абонирайте се за email известия от Подкрепи.бг",
Expand All @@ -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": "Приемам",
Expand Down
1 change: 0 additions & 1 deletion public/locales/en/auth.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"cta": {
"login": "Login",
"guest": "As guest",
"logout": "Logout",
"register": "Register",
"send": "Send",
Expand Down
12 changes: 8 additions & 4 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.",
Expand Down
10 changes: 5 additions & 5 deletions src/components/client/notifications/CampaignSubscribeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function RenderCampaignSubscribeModal({ campaign, setOpen }: Moda
<SubmitButton
sx={{ width: '40%' }}
className={classes.subscribeBtn}
label="common:notifications.subscribe-button"
label="common:notifications.cta.subscribe-button"
loading={loading}
/>
</Grid>
Expand Down Expand Up @@ -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)}
Expand All @@ -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()}
Expand Down
10 changes: 5 additions & 5 deletions src/components/client/notifications/GeneralSubscribeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default function RenderSubscribeModal({ setOpen }: ModalProps) {
<SubmitButton
sx={{ width: '40%' }}
className={classes.subscribeBtn}
label="common:notifications.subscribe-button"
label="common:notifications.cta.subscribe-button"
loading={loading}
/>
</Grid>
Expand Down Expand Up @@ -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)}
Expand All @@ -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()}
Expand Down

0 comments on commit b825364

Please sign in to comment.