diff --git a/shared/locales/de/website-bank-details.json b/shared/locales/de/website-bank-details.json index 12a013c5c..f4bbad9a6 100644 --- a/shared/locales/de/website-bank-details.json +++ b/shared/locales/de/website-bank-details.json @@ -11,7 +11,7 @@ "bankIBANPrompt": "IBAN", "bankIBAN1": "CH19 0900 0000 1511 2638 6", "bankIBAN2": "CH57 0900 0000 1548 6088 1", - "bankBICPrompt" : "BIC", + "bankBICPrompt": "BIC", "bankBIC": "POFICHBEXXX" } } diff --git a/shared/locales/en/website-bank-details.json b/shared/locales/en/website-bank-details.json index 2f77f78ca..7b56b62d7 100644 --- a/shared/locales/en/website-bank-details.json +++ b/shared/locales/en/website-bank-details.json @@ -11,7 +11,7 @@ "bankIBANPrompt": "IBAN", "bankIBAN1": "CH19 0900 0000 1511 2638 6", "bankIBAN2": "CH57 0900 0000 1548 6088 1", - "bankBICPrompt" : "BIC", + "bankBICPrompt": "BIC", "bankBIC": "POFICHBEXXX" } } diff --git a/shared/locales/en/website-evidence.json b/shared/locales/en/website-evidence.json index 134979aa7..44d5981e9 100644 --- a/shared/locales/en/website-evidence.json +++ b/shared/locales/en/website-evidence.json @@ -121,7 +121,7 @@ "link": "https://drive.google.com/file/d/1KTsAwaWPH0NaiD2SLVQmJZHn2bxeWFHz/view?usp=sharing" }, "part-2": { - "text":", ", + "text": ", ", "text-blue": "Covarrubias 2012", "link": "https://drive.google.com/file/d/1OEFeYCgxnbbrFVNFoYYQsSrnmVxZdz9v/view?usp=sharing" }, @@ -160,9 +160,9 @@ } } }, - "section-3": { - "topic": "Empowerment", - "title-black": "How does Social Income ", + "section-3": { + "topic": "Empowerment", + "title-black": "How does Social Income ", "title-red": "empower people?", "evidence": "Studies of direct cash transfer programs like Social Income have measured a range of beneficial effects on recipients’ lives.", "cards": { @@ -299,7 +299,7 @@ } }, "card-4": { - "title" : "Empowerment of women", + "title": "Empowerment of women", "description": "By enabling them to make freer decisions, direct cash transfers help women become more resilient, self-reliant, and involved in society.", "paragraphs": { "paragraph-1": { @@ -433,7 +433,7 @@ } } } - }, + }, "section-4": { "topic": "Well-being", "title-black": "How does Social Income contribute to ", diff --git a/shared/locales/it/website-bank-details.json b/shared/locales/it/website-bank-details.json index 7919e82ce..51bacad8e 100644 --- a/shared/locales/it/website-bank-details.json +++ b/shared/locales/it/website-bank-details.json @@ -11,7 +11,7 @@ "bankIBANPrompt": "IBAN", "bankIBAN1": "CH19 0900 0000 1511 2638 6", "bankIBAN2": "CH57 0900 0000 1548 6088 1", - "bankBICPrompt" : "BIC", + "bankBICPrompt": "BIC", "bankBIC": "POFICHBEXXX" } } diff --git a/shared/src/utils/i18n.ts b/shared/src/utils/i18n.ts index 977b538bc..87cf65b65 100644 --- a/shared/src/utils/i18n.ts +++ b/shared/src/utils/i18n.ts @@ -8,7 +8,7 @@ interface TranslateProps { namespace?: string; language?: string; context?: object; - returnObjects?: boolean; + returnObjects?: boolean; } interface TranslatorProps { @@ -41,7 +41,7 @@ export class Translator { lng: language, ns: namespaces, fallbackLng: FALLBACK_LANGUAGE, - returnObjects: false, + returnObjects: false, interpolation: { escapeValue: false, }, @@ -53,7 +53,7 @@ export class Translator { return this.instance.t(key, { ns: translateProps?.namespace || this.namespaces, lng: translateProps?.language || this.language, - returnObjects: translateProps?.returnObjects || false, + returnObjects: translateProps?.returnObjects || false, ...translateProps?.context, }); }; diff --git a/website/src/app/[lang]/[country]/(website)/bank/section-1.tsx b/website/src/app/[lang]/[country]/(website)/bank/section-1.tsx index 648635f34..f23b9b32e 100644 --- a/website/src/app/[lang]/[country]/(website)/bank/section-1.tsx +++ b/website/src/app/[lang]/[country]/(website)/bank/section-1.tsx @@ -1,7 +1,6 @@ -import { Translator } from "@socialincome/shared/src/utils/i18n"; -import { DefaultPageProps } from "../.."; -import { BaseContainer, Typography } from "@socialincome/ui"; - +import { Translator } from '@socialincome/shared/src/utils/i18n'; +import { BaseContainer, Typography } from '@socialincome/ui'; +import { DefaultPageProps } from '../..'; export default async function Section1({ params }: DefaultPageProps) { const translator = await Translator.getInstance({ @@ -10,84 +9,84 @@ export default async function Section1({ params }: DefaultPageProps) { }); return ( - + - {translator.t('section-1.bankIntroText') + ": "} - + {translator.t('section-1.bankIntroText') + ': '} +
{translator.t('section-1.bankInfoTextRecurring')} - +
- {translator.t('section-1.bankPrompt') + ": "} - + {translator.t('section-1.bankPrompt') + ': '} + {translator.t('section-1.bankPostFinance')} - +
- {translator.t('section-1.bankAccountHolderPrompt') + ": "} - + {translator.t('section-1.bankAccountHolderPrompt') + ': '} + {translator.t('section-1.bankAccountHolder')} - +
- {translator.t('section-1.bankIBANPrompt') + ": "} - + {translator.t('section-1.bankIBANPrompt') + ': '} + {translator.t('section-1.bankIBAN1')} - +
- {translator.t('section-1.bankBICPrompt') + ": "} - + {translator.t('section-1.bankBICPrompt') + ': '} + {translator.t('section-1.bankBIC')} - +
{translator.t('section-1.bankOneTime')} - +
- {translator.t('section-1.bankPrompt') + ": "} - + {translator.t('section-1.bankPrompt') + ': '} + {translator.t('section-1.bankPostFinance')} - +
- {translator.t('section-1.bankAccountHolderPrompt') + ": "} - + {translator.t('section-1.bankAccountHolderPrompt') + ': '} + {translator.t('section-1.bankAccountHolder')} - +
- {translator.t('section-1.bankIBANPrompt') + ": "} - + {translator.t('section-1.bankIBANPrompt') + ': '} + {translator.t('section-1.bankIBAN2')} - +
- {translator.t('section-1.bankBICPrompt') + ": "} - + {translator.t('section-1.bankBICPrompt') + ': '} + {translator.t('section-1.bankBIC')} - +
diff --git a/website/src/app/[lang]/[country]/(website)/evidence/page.tsx b/website/src/app/[lang]/[country]/(website)/evidence/page.tsx index f60a66d25..d5846888f 100644 --- a/website/src/app/[lang]/[country]/(website)/evidence/page.tsx +++ b/website/src/app/[lang]/[country]/(website)/evidence/page.tsx @@ -9,8 +9,8 @@ export default async function Page(props: DefaultPageProps) { <> - - + + ); } diff --git a/website/src/app/[lang]/[country]/(website)/evidence/section-1.tsx b/website/src/app/[lang]/[country]/(website)/evidence/section-1.tsx index f829a87c7..7ea4f6d7d 100644 --- a/website/src/app/[lang]/[country]/(website)/evidence/section-1.tsx +++ b/website/src/app/[lang]/[country]/(website)/evidence/section-1.tsx @@ -10,11 +10,9 @@ export default async function Section1({ params }: DefaultPageProps) { return ( - + {translator.t('section-1.title')} -
- {translator.t('section-1.red-title')} -
+
{translator.t('section-1.red-title')}
{translator.t('section-1.subtitle')} diff --git a/website/src/app/[lang]/[country]/(website)/evidence/section-2.tsx b/website/src/app/[lang]/[country]/(website)/evidence/section-2.tsx index 9c7aea7c2..c6f000da5 100644 --- a/website/src/app/[lang]/[country]/(website)/evidence/section-2.tsx +++ b/website/src/app/[lang]/[country]/(website)/evidence/section-2.tsx @@ -1,33 +1,44 @@ import { DefaultPageProps } from '@/app/[lang]/[country]'; import { Translator } from '@socialincome/shared/src/utils/i18n'; -import { BaseContainer,Typography } from '@socialincome/ui'; +import { BaseContainer, Typography } from '@socialincome/ui'; import { SectionCard } from './section-card'; export default async function Section2({ params }: DefaultPageProps) { - const section = 2; + const section = 2; const translator = await Translator.getInstance({ language: params.lang, namespaces: ['website-evidence'], }); - const c = translator.t(`section-${section}.cards`, {returnObjects: true}); - let cards: Object[] = []; - for(const card in c){cards.push(card);} - let i = 0; + const c = translator.t(`section-${section}.cards`, { returnObjects: true }); + let cards: Object[] = []; + for (const card in c) { + cards.push(card); + } + let i = 0; return ( - - {translator.t(`section-${section}.topic`)} -
- {translator.t(`section-${section}.title-black`)} - {translator.t(`section-${section}.title-red`)} + + + {translator.t(`section-${section}.topic`)} + +
+ + {translator.t(`section-${section}.title-black`)} + + + {translator.t(`section-${section}.title-red`)} +
-
- {translator.t(`section-${section}.evidence`)} -
- { - cards.map((card, key)=> {i++;return ()}) - } +
+ + {translator.t(`section-${section}.evidence`)} + +
+ {cards.map((card, key) => { + i++; + return ; + })}
diff --git a/website/src/app/[lang]/[country]/(website)/evidence/section-3.tsx b/website/src/app/[lang]/[country]/(website)/evidence/section-3.tsx index 94067ca83..676ba17e7 100644 --- a/website/src/app/[lang]/[country]/(website)/evidence/section-3.tsx +++ b/website/src/app/[lang]/[country]/(website)/evidence/section-3.tsx @@ -1,33 +1,44 @@ import { DefaultPageProps } from '@/app/[lang]/[country]'; import { Translator } from '@socialincome/shared/src/utils/i18n'; -import { BaseContainer,Typography } from '@socialincome/ui'; +import { BaseContainer, Typography } from '@socialincome/ui'; import { SectionCard } from './section-card'; export default async function Section3({ params }: DefaultPageProps) { - const section = 3; + const section = 3; const translator = await Translator.getInstance({ language: params.lang, namespaces: ['website-evidence'], }); - const c = translator.t(`section-${section}.cards`, {returnObjects: true}); - let cards: Object[] = []; - for(const card in c){cards.push(card);} - let i = 0; + const c = translator.t(`section-${section}.cards`, { returnObjects: true }); + let cards: Object[] = []; + for (const card in c) { + cards.push(card); + } + let i = 0; return ( - - {translator.t(`section-${section}.topic`)} -
- {translator.t(`section-${section}.title-black`)} - {translator.t(`section-${section}.title-red`)} + + + {translator.t(`section-${section}.topic`)} + +
+ + {translator.t(`section-${section}.title-black`)} + + + {translator.t(`section-${section}.title-red`)} +
-
- {translator.t(`section-${section}.evidence`)} -
- { - cards.map((card, key)=> {i++;return ()}) - } +
+ + {translator.t(`section-${section}.evidence`)} + +
+ {cards.map((card, key) => { + i++; + return ; + })}
diff --git a/website/src/app/[lang]/[country]/(website)/evidence/section-4.tsx b/website/src/app/[lang]/[country]/(website)/evidence/section-4.tsx index f862e1b5c..aa3f4ded1 100644 --- a/website/src/app/[lang]/[country]/(website)/evidence/section-4.tsx +++ b/website/src/app/[lang]/[country]/(website)/evidence/section-4.tsx @@ -1,33 +1,44 @@ import { DefaultPageProps } from '@/app/[lang]/[country]'; import { Translator } from '@socialincome/shared/src/utils/i18n'; -import { BaseContainer,Typography } from '@socialincome/ui'; +import { BaseContainer, Typography } from '@socialincome/ui'; import { SectionCard } from './section-card'; export default async function Section4({ params }: DefaultPageProps) { - const section = 4; + const section = 4; const translator = await Translator.getInstance({ language: params.lang, namespaces: ['website-evidence'], }); - const c = translator.t(`section-${section}.cards`, {returnObjects: true}); - let cards: Object[] = []; - for(const card in c){cards.push(card);} - let i = 0; + const c = translator.t(`section-${section}.cards`, { returnObjects: true }); + let cards: Object[] = []; + for (const card in c) { + cards.push(card); + } + let i = 0; return ( - - {translator.t(`section-${section}.topic`)} -
- {translator.t(`section-${section}.title-black`)} - {translator.t(`section-${section}.title-red`)} + + + {translator.t(`section-${section}.topic`)} + +
+ + {translator.t(`section-${section}.title-black`)} + + + {translator.t(`section-${section}.title-red`)} +
-
- {translator.t(`section-${section}.evidence`)} -
- { - cards.map((card, key)=> {i++;return ()}) - } +
+ + {translator.t(`section-${section}.evidence`)} + +
+ {cards.map((card, key) => { + i++; + return ; + })}
diff --git a/website/src/app/[lang]/[country]/(website)/evidence/section-card.tsx b/website/src/app/[lang]/[country]/(website)/evidence/section-card.tsx index f6bf0956b..bf0e138dc 100644 --- a/website/src/app/[lang]/[country]/(website)/evidence/section-card.tsx +++ b/website/src/app/[lang]/[country]/(website)/evidence/section-card.tsx @@ -1,61 +1,80 @@ +import { DefaultParams } from '@/app/[lang]/[country]'; import { Translator } from '@socialincome/shared/src/utils/i18n'; -import {Card, CardTitle, Typography, Dialog, DialogTitle, DialogTrigger, DialogContent, DialogHeader, DialogDescription, DialogFooter, Button, } from '@socialincome/ui'; +import { + Button, + Card, + CardTitle, + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, + Typography, +} from '@socialincome/ui'; import Link from 'next/link'; -import { DefaultParams } from '@/app/[lang]/[country]'; import { SectionParagraph } from './section-paragraph'; type SectionCardProps = { - section: number; - cardNumber: number; - params: DefaultParams; -} - + section: number; + cardNumber: number; + params: DefaultParams; +}; -export async function SectionCard({ section, cardNumber, params}: SectionCardProps){ - - const translator = await Translator.getInstance({ +export async function SectionCard({ section, cardNumber, params }: SectionCardProps) { + const translator = await Translator.getInstance({ language: params.lang, namespaces: ['website-evidence'], }); - const p = translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs`, {returnObjects: true}); - let paragraphs: Object[] = []; - for(const paragraph in p){paragraphs.push(paragraph);} - let i = 0; - + const p = translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs`, { returnObjects: true }); + let paragraphs: Object[] = []; + for (const paragraph in p) { + paragraphs.push(paragraph); + } + let i = 0; return ( - - {translator.t(`section-${section}.cards.card-${cardNumber}.title`)} - {translator.t(`section-${section}.cards.card-${cardNumber}.description`)} + + + {translator.t(`section-${section}.cards.card-${cardNumber}.title`)} + + {translator.t(`section-${section}.cards.card-${cardNumber}.description`)} - + - {translator.t(`section-${section}.cards.card-${cardNumber}.title`)} + + {translator.t(`section-${section}.cards.card-${cardNumber}.title`)} + - { - paragraphs.map((paragraph, key)=>{ - i++; return( -
- -
- ) - }) - } -
+ {paragraphs.map((paragraph, key) => { + i++; + return ( +
+ +
+ ); + })} +
-
); diff --git a/website/src/app/[lang]/[country]/(website)/evidence/section-paragraph.tsx b/website/src/app/[lang]/[country]/(website)/evidence/section-paragraph.tsx index 6d1f19845..bd4ece73d 100644 --- a/website/src/app/[lang]/[country]/(website)/evidence/section-paragraph.tsx +++ b/website/src/app/[lang]/[country]/(website)/evidence/section-paragraph.tsx @@ -1,38 +1,53 @@ -import { Translator } from "@socialincome/shared/src/utils/i18n"; -import { DefaultParams } from "../.."; -import { Typography } from "@socialincome/ui"; -import Link from "next/link"; +import { Translator } from '@socialincome/shared/src/utils/i18n'; +import { Typography } from '@socialincome/ui'; +import Link from 'next/link'; +import { DefaultParams } from '../..'; type SectionParagraphProps = { - section: number; - cardNumber: number; - paragraphNumber: number; - params: DefaultParams -} + section: number; + cardNumber: number; + paragraphNumber: number; + params: DefaultParams; +}; -export async function SectionParagraph({section, cardNumber, paragraphNumber, params}: SectionParagraphProps){ - const translator = await Translator.getInstance({ +export async function SectionParagraph({ section, cardNumber, paragraphNumber, params }: SectionParagraphProps) { + const translator = await Translator.getInstance({ language: params.lang, namespaces: ['website-evidence'], }); - const pt = translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}`, {returnObjects: true}); - let parts: Object[] = []; - for(const part in pt){parts.push(part);} - let i = 0; - return( -
- { - parts.map((part, key)=> { - i++; - return ( - - {translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}.part-${i}.text`)} - - {translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}.part-${i}.text-blue`) } - - - );} - )} -
- ) -} \ No newline at end of file + const pt = translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}`, { + returnObjects: true, + }); + let parts: Object[] = []; + for (const part in pt) { + parts.push(part); + } + let i = 0; + return ( +
+ {parts.map((part, key) => { + i++; + return ( + + + {translator.t( + `section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}.part-${i}.text`, + )} + + + + {translator.t( + `section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}.part-${i}.text-blue`, + )} + + + + ); + })} +
+ ); +}