Remove l11n unsafe direct string manipulation
This commit is contained in:
parent
01e6e79819
commit
7c0ab6dd8a
3 changed files with 3 additions and 10 deletions
|
@ -24,7 +24,6 @@ import {
|
|||
planForSubscription,
|
||||
updateSubscription,
|
||||
} from "utils/billing";
|
||||
import { reverseString } from "utils/common";
|
||||
import { getLocalUserDetails } from "utils/user";
|
||||
import { getTotalFamilyUsage, isPartOfFamily } from "utils/user/family";
|
||||
import FreeSubscriptionPlanSelectorCard from "./free";
|
||||
|
@ -130,9 +129,7 @@ function PlanSelectorCard(props: Props) {
|
|||
}
|
||||
} else if (hasStripeSubscription(subscription)) {
|
||||
appContext.setDialogMessage({
|
||||
title: `${t("CONFIRM")} ${reverseString(
|
||||
t("UPDATE_SUBSCRIPTION"),
|
||||
)}`,
|
||||
title: t("update_subscription_title"),
|
||||
content: t("UPDATE_SUBSCRIPTION_MESSAGE"),
|
||||
proceed: {
|
||||
text: t("UPDATE_SUBSCRIPTION"),
|
||||
|
|
|
@ -13,12 +13,6 @@ export function downloadApp() {
|
|||
openLink(APP_DOWNLOAD_URL, true);
|
||||
}
|
||||
|
||||
export function reverseString(title: string) {
|
||||
return title
|
||||
?.split(" ")
|
||||
.reduce((reversedString, currWord) => `${currWord} ${reversedString}`);
|
||||
}
|
||||
|
||||
export function initiateEmail(email: string) {
|
||||
const a = document.createElement("a");
|
||||
a.href = "mailto:" + email;
|
||||
|
@ -33,6 +27,7 @@ export const preloadImage = (imgBasePath: string) => {
|
|||
}
|
||||
new Image().srcset = srcSet.join(",");
|
||||
};
|
||||
|
||||
export function openLink(href: string, newTab?: boolean) {
|
||||
const a = document.createElement("a");
|
||||
a.href = href;
|
||||
|
|
|
@ -168,6 +168,7 @@
|
|||
"UPDATE_PAYMENT_METHOD": "Update payment method",
|
||||
"MONTHLY": "Monthly",
|
||||
"YEARLY": "Yearly",
|
||||
"update_subscription_title": "Confirm plan change",
|
||||
"UPDATE_SUBSCRIPTION_MESSAGE": "Are you sure you want to change your plan?",
|
||||
"UPDATE_SUBSCRIPTION": "Change plan",
|
||||
"CANCEL_SUBSCRIPTION": "Cancel subscription",
|
||||
|
|
Loading…
Add table
Reference in a new issue