🐛 Use single curly braces for i18n string vars (#1805)

This commit is contained in:
Luke Vella 2025-07-09 15:59:26 +03:00 committed by GitHub
parent 8efff1e659
commit a1926a30b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 24 additions and 24 deletions

View file

@ -92,7 +92,7 @@
"polls": "Sondaggi", "polls": "Sondaggi",
"timeZoneSelect__noOption": "Nessuna opzione trovata", "timeZoneSelect__noOption": "Nessuna opzione trovata",
"timeZoneSelect__inputPlaceholder": "Ricerca…", "timeZoneSelect__inputPlaceholder": "Ricerca…",
"poweredByRallly": "Powered by <a>{{name}}</a>", "poweredByRallly": "Powered by <a>{name}</a>",
"participants": "Partecipanti", "participants": "Partecipanti",
"language": "Lingua", "language": "Lingua",
"languageDescription": "Cambia la tua lingua preferita", "languageDescription": "Cambia la tua lingua preferita",

View file

@ -26,13 +26,13 @@ export function SubscriptionPrice({
{interval === "month" ? ( {interval === "month" ? (
<Trans <Trans
i18nKey="subscriptionPriceMonthly" i18nKey="subscriptionPriceMonthly"
defaults="{{price}} per month" defaults="{price} per month"
values={{ price: formattedAmount }} values={{ price: formattedAmount }}
/> />
) : ( ) : (
<Trans <Trans
i18nKey="subscriptionPriceYearly" i18nKey="subscriptionPriceYearly"
defaults="{{price}} per year" defaults="{price} per year"
values={{ price: formattedAmount }} values={{ price: formattedAmount }}
/> />
)} )}

View file

@ -58,7 +58,7 @@ export const EmailLayout = ({
t={ctx.t} t={ctx.t}
i18nKey="common_poweredBy" i18nKey="common_poweredBy"
ns="emails" ns="emails"
defaults="Powered by <a>{{domain}}</a>" defaults="Powered by <a>{domain}</a>"
values={{ domain: "rallly.co" }} values={{ domain: "rallly.co" }}
components={{ components={{
a: ( a: (

View file

@ -31,7 +31,7 @@ export const NotificationEmail = ({
<Button href={pollUrl}> <Button href={pollUrl}>
{ctx.t("common_viewOn", { {ctx.t("common_viewOn", {
ns: "emails", ns: "emails",
defaultValue: "View on {{domain}}", defaultValue: "View on {domain}",
domain, domain,
})} })}
</Button> </Button>

View file

@ -26,7 +26,7 @@ export const AbandonedCheckoutEmail = ({
poweredBy={false} poweredBy={false}
preview={ctx.t("abandoned_checkout_preview", { preview={ctx.t("abandoned_checkout_preview", {
defaultValue: defaultValue:
"Exclusive offer: Get {{discount}}% off your first year of Rallly Pro!", "Exclusive offer: Get {discount}% off your first year of Rallly Pro!",
discount, discount,
ns: "emails", ns: "emails",
})} })}
@ -37,7 +37,7 @@ export const AbandonedCheckoutEmail = ({
t={ctx.t} t={ctx.t}
i18n={ctx.i18n} i18n={ctx.i18n}
i18nKey="abandoned_checkout_name" i18nKey="abandoned_checkout_name"
defaults="Hey {{name}}," defaults="Hey {name},"
values={{ name }} values={{ name }}
ns="emails" ns="emails"
/> />
@ -70,7 +70,7 @@ export const AbandonedCheckoutEmail = ({
t={ctx.t} t={ctx.t}
i18n={ctx.i18n} i18n={ctx.i18n}
i18nKey="abandoned_checkout_offer" i18nKey="abandoned_checkout_offer"
defaults="To help you get started, I'd like to offer you <b>{{discount}}% off your first year</b> with Rallly Pro. Simply use this code during checkout:" defaults="To help you get started, I'd like to offer you <b>{discount}% off your first year</b> with Rallly Pro. Simply use this code during checkout:"
ns="emails" ns="emails"
values={{ values={{
discount, discount,
@ -134,7 +134,7 @@ AbandonedCheckoutEmail.getSubject = (
ctx: EmailContext, ctx: EmailContext,
) => { ) => {
return `🎉 ${ctx.t("abandoned_checkout_subject", { return `🎉 ${ctx.t("abandoned_checkout_subject", {
defaultValue: "Get {{discount}}% off your first year of Rallly Pro", defaultValue: "Get {discount}% off your first year of Rallly Pro",
discount: props.discount, discount: props.discount,
ns: "emails", ns: "emails",
})}`; })}`;

View file

@ -38,7 +38,7 @@ export const ChangeEmailRequest = ({
t={ctx.t} t={ctx.t}
i18nKey="changeEmailRequest_text1" i18nKey="changeEmailRequest_text1"
ns="emails" ns="emails"
defaults="We've received a request to change the email address for your account from <b>{{fromEmail}}</b> to <b>{{toEmail}}</b>." defaults="We've received a request to change the email address for your account from <b>{fromEmail}</b> to <b>{toEmail}</b>."
values={{ fromEmail, toEmail }} values={{ fromEmail, toEmail }}
components={{ b: <b /> }} components={{ b: <b /> }}
/> />

View file

@ -58,7 +58,7 @@ const FinalizeHostEmail = ({
components={{ components={{
b: <strong />, b: <strong />,
}} }}
defaults="<b>{{title}}</b> has been booked for:" defaults="<b>{title}</b> has been booked for:"
/> />
</Text> </Text>
<Section> <Section>

View file

@ -62,7 +62,7 @@ export const LoginEmail = ({ code, magicLink, ctx }: LoginEmailProps) => {
i18n={ctx.i18n} i18n={ctx.i18n}
t={ctx.t} t={ctx.t}
i18nKey="login_button" i18nKey="login_button"
defaults="Log in to {{domain}}" defaults="Log in to {domain}"
values={{ domain: ctx.domain }} values={{ domain: ctx.domain }}
ns="emails" ns="emails"
/> />
@ -73,7 +73,7 @@ export const LoginEmail = ({ code, magicLink, ctx }: LoginEmailProps) => {
i18n={ctx.i18n} i18n={ctx.i18n}
t={ctx.t} t={ctx.t}
i18nKey="login_content2" i18nKey="login_content2"
defaults="You're receiving this email because a request was made to login to <domain />. If this wasn't you contact <a>{{supportEmail}}</a>." defaults="You're receiving this email because a request was made to login to <domain />. If this wasn't you contact <a>{supportEmail}</a>."
values={{ supportEmail: ctx.supportEmail }} values={{ supportEmail: ctx.supportEmail }}
components={{ components={{
domain: <Domain ctx={ctx} />, domain: <Domain ctx={ctx} />,
@ -88,7 +88,7 @@ export const LoginEmail = ({ code, magicLink, ctx }: LoginEmailProps) => {
LoginEmail.getSubject = (props: LoginEmailProps, ctx: EmailContext) => { LoginEmail.getSubject = (props: LoginEmailProps, ctx: EmailContext) => {
return ctx.t("login_subject", { return ctx.t("login_subject", {
defaultValue: "{{code}} is your 6-digit code", defaultValue: "{code} is your 6-digit code",
code: props.code, code: props.code,
ns: "emails", ns: "emails",
}); });

View file

@ -40,7 +40,7 @@ const NewCommentEmail = ({
i18n={ctx.i18n} i18n={ctx.i18n}
ns="emails" ns="emails"
i18nKey="newComment_content" i18nKey="newComment_content"
defaults="<b>{{authorName}}</b> has commented on <b>{{title}}</b>." defaults="<b>{authorName}</b> has commented on <b>{title}</b>."
components={{ components={{
b: <strong />, b: <strong />,
}} }}
@ -60,7 +60,7 @@ NewCommentEmail.getSubject = (
) => { ) => {
return ctx.t("newComment_subject", { return ctx.t("newComment_subject", {
ns: "emails", ns: "emails",
defaultValue: "{{authorName}} has commented on {{title}}", defaultValue: "{authorName} has commented on {title}",
authorName: props.authorName, authorName: props.authorName,
title: props.title, title: props.title,
}); });

View file

@ -41,7 +41,7 @@ const NewParticipantConfirmationEmail = ({
i18n={ctx.i18n} i18n={ctx.i18n}
t={ctx.t} t={ctx.t}
i18nKey="newParticipantConfirmation_content" i18nKey="newParticipantConfirmation_content"
defaults="Your response to <b>{{title}}</b> has been submitted." defaults="Your response to <b>{title}</b> has been submitted."
components={{ components={{
b: <strong />, b: <strong />,
}} }}
@ -64,7 +64,7 @@ const NewParticipantConfirmationEmail = ({
i18n={ctx.i18n} i18n={ctx.i18n}
t={ctx.t} t={ctx.t}
i18nKey="newParticipantConfirmation_button" i18nKey="newParticipantConfirmation_button"
defaults="Review response on {{domain}}" defaults="Review response on {domain}"
values={{ domain }} values={{ domain }}
ns="emails" ns="emails"
/> />
@ -91,7 +91,7 @@ NewParticipantConfirmationEmail.getSubject = (
ctx: EmailContext, ctx: EmailContext,
) => { ) => {
return ctx.t("newParticipantConfirmation_subject", { return ctx.t("newParticipantConfirmation_subject", {
defaultValue: "Thanks for responding to {{title}}", defaultValue: "Thanks for responding to {title}",
title: props.title, title: props.title,
ns: "emails", ns: "emails",
}); });

View file

@ -39,7 +39,7 @@ const NewParticipantEmail = ({
t={ctx.t} t={ctx.t}
i18nKey="newParticipant_content" i18nKey="newParticipant_content"
ns="emails" ns="emails"
defaults="<b>{{name}}</b> has responded to <b>{{title}}</b>." defaults="<b>{name}</b> has responded to <b>{title}</b>."
components={{ components={{
b: <strong />, b: <strong />,
}} }}
@ -64,7 +64,7 @@ NewParticipantEmail.getSubject = (
ctx: EmailContext, ctx: EmailContext,
) => { ) => {
return ctx.t("newParticipant_subject", { return ctx.t("newParticipant_subject", {
defaultValue: "{{name}} has responded to {{title}}", defaultValue: "{name} has responded to {title}",
name: props.participantName, name: props.participantName,
title: props.title, title: props.title,
ns: "emails", ns: "emails",

View file

@ -49,7 +49,7 @@ export const NewPollEmail = ({
components={{ components={{
b: <strong />, b: <strong />,
}} }}
defaults="Your meeting poll titled <b>{{title}}</b> is ready! Share it using the link below:" defaults="Your meeting poll titled <b>{title}</b> is ready! Share it using the link below:"
/> />
</Text> </Text>
<Card style={{ textAlign: "center" }}> <Card style={{ textAlign: "center" }}>
@ -69,7 +69,7 @@ export const NewPollEmail = ({
NewPollEmail.getSubject = (props: NewPollEmailProps, ctx: EmailContext) => { NewPollEmail.getSubject = (props: NewPollEmailProps, ctx: EmailContext) => {
return ctx.t("newPoll_subject", { return ctx.t("newPoll_subject", {
defaultValue: "Let's find a date for {{title}}!", defaultValue: "Let's find a date for {title}!",
title: props.title, title: props.title,
ns: "emails", ns: "emails",
}); });

View file

@ -22,7 +22,7 @@ export const RegisterEmail = ({ code, ctx }: RegisterEmailProps) => {
ctx={ctx} ctx={ctx}
preview={ctx.t("register_preview", { preview={ctx.t("register_preview", {
ns: "emails", ns: "emails",
defaultValue: "Your 6-digit code is: {{code}}", defaultValue: "Your 6-digit code is: {code}",
code, code,
})} })}
> >