Skip to content

Commit

Permalink
[web] Translations cleanup (#3973)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnvr authored Nov 8, 2024
2 parents bd15152 + 053a97a commit 02be77d
Show file tree
Hide file tree
Showing 43 changed files with 1,612 additions and 1,616 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default function ManageEmailShare({
<EnteMenuItem
fontWeight="normal"
onClick={() => {}}
label={isOwner ? t("YOU") : ownerEmail}
label={isOwner ? t("you") : ownerEmail}
startIcon={<Avatar email={ownerEmail} />}
/>
</MenuItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function SharingDetails({ collection, type }) {
<EnteMenuItem
fontWeight="normal"
onClick={() => {}}
label={isOwner ? t("YOU") : ownerEmail}
label={isOwner ? t("you") : ownerEmail}
startIcon={<Avatar email={ownerEmail} />}
/>
</MenuItemGroup>
Expand All @@ -65,7 +65,7 @@ export default function SharingDetails({ collection, type }) {
fontWeight="normal"
key={item}
onClick={() => {}}
label={isMe(item) ? t("YOU") : item}
label={isMe(item) ? t("you") : item}
startIcon={<Avatar email={item} />}
/>
{index !== collaborators.length - 1 && (
Expand All @@ -86,7 +86,7 @@ export default function SharingDetails({ collection, type }) {
fontWeight="normal"
key={item}
onClick={() => {}}
label={isMe(item) ? t("YOU") : item}
label={isMe(item) ? t("you") : item}
startIcon={<Avatar email={item} />}
/>
{index !== viewers.length - 1 && (
Expand Down
14 changes: 7 additions & 7 deletions web/apps/photos/src/components/Sidebar/SubscriptionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,24 +146,24 @@ const StorageSection: React.FC<StorageSectionProps> = ({ usage, storage }) => {
return (
<Box width="100%">
<Typography variant="small" color={"text.muted"}>
{t("STORAGE")}
{t("storage")}
</Typography>
<DefaultBox>
<Typography
fontWeight={"bold"}
sx={{ fontSize: "24px", lineHeight: "30px" }}
>
{`${formattedStorageByteSize(usage, { round: true })} ${t(
"OF",
)} ${formattedStorageByteSize(storage)} ${t("USED")}`}
"of",
)} ${formattedStorageByteSize(storage)} ${t("used")}`}
</Typography>
</DefaultBox>
<MobileSmallBox>
<Typography
fontWeight={"bold"}
sx={{ fontSize: "24px", lineHeight: "30px" }}
>
{`${bytesInGB(usage)} / ${bytesInGB(storage)} ${t("storage_unit.gb")} ${t("USED")}`}
{`${bytesInGB(usage)} / ${bytesInGB(storage)} ${t("storage_unit.gb")} ${t("used")}`}
</Typography>
</MobileSmallBox>
</Box>
Expand Down Expand Up @@ -202,7 +202,7 @@ const IndividualUsageSection: React.FC<IndividualUsageSectionProps> = ({
>
<Typography variant="mini">{`${formattedStorageByteSize(
storage - usage,
)} ${t("FREE")}`}</Typography>
)} ${t("free")}`}</Typography>
<Typography variant="mini" fontWeight={"bold"}>
{t("photos_count", { count: fileCount ?? 0 })}
</Typography>
Expand Down Expand Up @@ -261,8 +261,8 @@ const FamilyUsageSection: React.FC<FamilyUsageSectionProps> = ({
}}
>
<Stack direction={"row"} spacing={1.5}>
<Legend label={t("YOU")} color="text.base" />
<Legend label={t("FAMILY")} color="text.muted" />
<Legend label={t("you")} color="text.base" />
<Legend label={t("family")} color="text.muted" />
</Stack>
<Typography variant="mini" fontWeight={"bold"}>
{t("photos_count", { count: fileCount ?? 0 })}
Expand Down
12 changes: 6 additions & 6 deletions web/apps/photos/src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ function MemberSubscriptionManage({ open, userDetails, onClose }) {

const confirmLeaveFamily = () =>
showMiniDialog({
title: t("LEAVE_FAMILY_PLAN"),
message: t("LEAVE_FAMILY_CONFIRM"),
title: t("leave_family_plan"),
message: t("leave_family_plan_confirm"),
continue: {
text: t("LEAVE"),
text: t("leave"),
color: "critical",
action: leaveFamily,
},
Expand All @@ -343,9 +343,9 @@ function MemberSubscriptionManage({ open, userDetails, onClose }) {
<Dialog {...{ open, onClose, fullScreen }} maxWidth="xs" fullWidth>
<DialogTitleWithCloseButton onClose={onClose}>
<Typography variant="h3" fontWeight={"bold"}>
{t("SUBSCRIPTION")}
{t("subscription")}
</Typography>
<Typography color={"text.muted"}>{t("FAMILY_PLAN")}</Typography>
<Typography color={"text.muted"}>{t("family_plan")}</Typography>
</DialogTitleWithCloseButton>
<DialogContent>
<VerticallyCentered>
Expand All @@ -371,7 +371,7 @@ function MemberSubscriptionManage({ open, userDetails, onClose }) {
color="critical"
onClick={confirmLeaveFamily}
>
{t("LEAVE_FAMILY_PLAN")}
{t("leave_family_plan")}
</Button>
</FlexWrapper>
</VerticallyCentered>
Expand Down
60 changes: 30 additions & 30 deletions web/apps/photos/src/components/pages/gallery/PlanSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const PlanSelectorCard: React.FC<PlanSelectorCardProps> = ({
setLoading(false);
showMiniDialog(
errorDialogAttributes(
t("SUBSCRIPTION_PURCHASE_FAILED"),
t("subscription_purchase_failed"),
),
);
}
Expand All @@ -176,9 +176,9 @@ const PlanSelectorCard: React.FC<PlanSelectorCardProps> = ({
case "updateSubscriptionToPlan":
showMiniDialog({
title: t("update_subscription_title"),
message: t("UPDATE_SUBSCRIPTION_MESSAGE"),
message: t("update_subscription_message"),
continue: {
text: t("UPDATE_SUBSCRIPTION"),
text: t("update_subscription"),
action: () =>
redirectToPaymentsApp(plan.stripeID, "update"),
},
Expand All @@ -187,19 +187,19 @@ const PlanSelectorCard: React.FC<PlanSelectorCardProps> = ({

case "cancelOnMobile":
showMiniDialog({
title: t("CANCEL_SUBSCRIPTION_ON_MOBILE"),
message: t("CANCEL_SUBSCRIPTION_ON_MOBILE_MESSAGE"),
title: t("cancel_subscription_on_mobile"),
message: t("cancel_subscription_on_mobile_message"),
continue: {},
cancel: false,
});
break;

case "contactSupport":
showMiniDialog({
title: t("MANAGE_PLAN"),
title: t("manage_plan"),
message: (
<Trans
i18nKey={"MAIL_TO_MANAGE_SUBSCRIPTION"}
i18nKey={"mail_to_manage_subscription"}
components={{
a: <Link href="mailto:[email protected]" />,
}}
Expand Down Expand Up @@ -300,7 +300,7 @@ function FreeSubscriptionPlanSelectorCard({
return (
<>
<Typography variant="h3" fontWeight={"bold"}>
{t("CHOOSE_PLAN")}
{t("choose_plan")}
</Typography>

<Box>
Expand All @@ -311,7 +311,7 @@ function FreeSubscriptionPlanSelectorCard({
togglePeriod={togglePeriod}
/>
<Typography variant="small" mt={0.5} color="text.muted">
{t("TWO_MONTHS_FREE")}
{t("two_months_free")}
</Typography>
</Box>
{children}
Expand Down Expand Up @@ -348,7 +348,7 @@ function PaidSubscriptionPlanSelectorCard({
<SpaceBetweenFlex>
<Box>
<Typography variant="h3" fontWeight={"bold"}>
{t("SUBSCRIPTION")}
{t("subscription")}
</Typography>
<Typography variant="small" color={"text.muted"}>
{bytesInGB(subscription.storage, 2)}{" "}
Expand All @@ -364,7 +364,7 @@ function PaidSubscriptionPlanSelectorCard({
<Box px={1.5}>
<Typography color={"text.muted"} fontWeight={"bold"}>
<Trans
i18nKey="CURRENT_USAGE"
i18nKey="current_usage"
values={{
usage: `${bytesInGB(usage, 2)} ${t("storage_unit.gb")}`,
}}
Expand All @@ -385,7 +385,7 @@ function PaidSubscriptionPlanSelectorCard({
togglePeriod={togglePeriod}
/>
<Typography variant="small" mt={0.5} color="text.muted">
{t("TWO_MONTHS_FREE")}
{t("two_months_free")}
</Typography>
</Box>
{children}
Expand Down Expand Up @@ -430,10 +430,10 @@ function PeriodToggler({ planPeriod, togglePeriod }) {
color="primary"
>
<CustomToggleButton value={"month"}>
{t("MONTHLY")}
{t("monthly")}
</CustomToggleButton>
<CustomToggleButton value={"year"}>
{t("YEARLY")}
{t("yearly")}
</CustomToggleButton>
</ToggleButtonGroup>
);
Expand Down Expand Up @@ -560,8 +560,8 @@ function PlanRow({
<Typography color="text.muted" variant="small">
{`/ ${
plan.period === "month"
? t("MONTH_SHORT")
: t("YEAR")
? t("month_short")
: t("year")
}`}
</Typography>
</Box>
Expand Down Expand Up @@ -700,7 +700,7 @@ function ManageSubscription({
color="secondary"
onClick={openFamilyPortal}
>
{t("MANAGE_FAMILY_PORTAL")}
{t("manage_family")}
</ManageSubscriptionButton>
</Stack>
);
Expand All @@ -721,12 +721,12 @@ const StripeSubscriptionOptions: React.FC<StripeSubscriptionOptionsProps> = ({

const confirmReactivation = () =>
showMiniDialog({
title: t("REACTIVATE_SUBSCRIPTION"),
message: t("REACTIVATE_SUBSCRIPTION_MESSAGE", {
title: t("reactivate_subscription"),
message: t("reactivate_subscription_message", {
date: subscription.expiryTime,
}),
continue: {
text: t("REACTIVATE_SUBSCRIPTION"),
text: t("reactivate_subscription"),
action: async () => {
await activateStripeSubscription();
onClose();
Expand All @@ -738,7 +738,7 @@ const StripeSubscriptionOptions: React.FC<StripeSubscriptionOptionsProps> = ({
setTimeout(() => {
showMiniDialog({
title: t("success"),
message: t("SUBSCRIPTION_ACTIVATE_SUCCESS"),
message: t("subscription_activate_success"),
continue: { action: onClose },
cancel: false,
});
Expand All @@ -749,28 +749,28 @@ const StripeSubscriptionOptions: React.FC<StripeSubscriptionOptionsProps> = ({

const confirmCancel = () =>
showMiniDialog({
title: t("CANCEL_SUBSCRIPTION"),
title: t("cancel_subscription"),
message: hasAddOnBonus ? (
<Trans i18nKey={"CANCEL_SUBSCRIPTION_WITH_ADDON_MESSAGE"} />
<Trans i18nKey={"cancel_subscription_with_addon_message"} />
) : (
<Trans i18nKey={"CANCEL_SUBSCRIPTION_MESSAGE"} />
<Trans i18nKey={"cancel_subscription_message"} />
),
continue: {
text: t("CANCEL_SUBSCRIPTION"),
text: t("cancel_subscription"),
color: "critical",
action: async () => {
await cancelStripeSubscription();
onClose();
// See: [Note: Chained MiniDialogs]
setTimeout(() => {
showMiniDialog({
message: t("SUBSCRIPTION_CANCEL_SUCCESS"),
message: t("subscription_cancel_success"),
cancel: t("ok"),
});
}, 0);
},
},
cancel: t("NEVERMIND"),
cancel: t("nevermind"),
});

const handleManageClick = useWrapAsyncOperation(redirectToCustomerPortal);
Expand All @@ -782,21 +782,21 @@ const StripeSubscriptionOptions: React.FC<StripeSubscriptionOptionsProps> = ({
color="secondary"
onClick={confirmReactivation}
>
{t("REACTIVATE_SUBSCRIPTION")}
{t("reactivate_subscription")}
</ManageSubscriptionButton>
) : (
<ManageSubscriptionButton
color="secondary"
onClick={confirmCancel}
>
{t("CANCEL_SUBSCRIPTION")}
{t("cancel_subscription")}
</ManageSubscriptionButton>
)}
<ManageSubscriptionButton
color="secondary"
onClick={handleManageClick}
>
{t("MANAGEMENT_PORTAL")}
{t("manage_payment_method")}
</ManageSubscriptionButton>
</>
);
Expand Down
22 changes: 11 additions & 11 deletions web/apps/photos/src/pages/gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1246,10 +1246,10 @@ export async function handleSubscriptionCompletionRedirectIfNeeded(
try {
const subscription = await verifyStripeSubscription(sessionID);
showMiniDialog({
title: t("SUBSCRIPTION_PURCHASE_SUCCESS_TITLE"),
title: t("thank_you"),
message: (
<Trans
i18nKey="SUBSCRIPTION_PURCHASE_SUCCESS"
i18nKey="subscription_purchase_success"
values={{ date: subscription?.expiryTime }}
/>
),
Expand All @@ -1259,25 +1259,25 @@ export async function handleSubscriptionCompletionRedirectIfNeeded(
} catch (e) {
log.error("Subscription verification failed", e);
showMiniDialog(
errorDialogAttributes(t("SUBSCRIPTION_VERIFICATION_ERROR")),
errorDialogAttributes(t("subscription_verification_error")),
);
}
} else if (status == "fail") {
log.error(`Subscription purchase failed: ${reason}`);
switch (reason) {
case "canceled":
showMiniDialog({
message: t("SUBSCRIPTION_PURCHASE_CANCELLED"),
message: t("subscription_purchase_cancelled"),
continue: { text: t("ok"), color: "primary" },
cancel: false,
});
break;
case "requires_payment_method":
showMiniDialog({
title: t("UPDATE_PAYMENT_METHOD"),
message: t("UPDATE_PAYMENT_METHOD_MESSAGE"),
title: t("update_payment_method"),
message: t("update_payment_method_message"),
continue: {
text: t("UPDATE_PAYMENT_METHOD"),
text: t("update_payment_method"),
action: () => {
showLoadingBar();
return redirectToCustomerPortal();
Expand All @@ -1287,10 +1287,10 @@ export async function handleSubscriptionCompletionRedirectIfNeeded(
break;
case "authentication_failed":
showMiniDialog({
title: t("UPDATE_PAYMENT_METHOD"),
message: t("STRIPE_AUTHENTICATION_FAILED"),
title: t("update_payment_method"),
message: t("payment_method_authentication_failed"),
continue: {
text: t("UPDATE_PAYMENT_METHOD"),
text: t("update_payment_method"),
action: () => {
showLoadingBar();
return redirectToCustomerPortal();
Expand All @@ -1300,7 +1300,7 @@ export async function handleSubscriptionCompletionRedirectIfNeeded(
break;
default:
showMiniDialog(
errorDialogAttributes(t("SUBSCRIPTION_PURCHASE_FAILED")),
errorDialogAttributes(t("subscription_purchase_failed")),
);
}
}
Expand Down
Loading

0 comments on commit 02be77d

Please sign in to comment.