From bee41b242bc16654a3180fdba4259d8a484cdc40 Mon Sep 17 00:00:00 2001 From: Mihai C <34626017+mihaic195@users.noreply.github.com> Date: Wed, 13 Oct 2021 12:34:55 +0300 Subject: [PATCH] chore: extract more strings (#933) --- components/SettingsShell.tsx | 14 ++-- components/security/TwoFactorAuthSection.tsx | 4 +- pages/settings/billing.tsx | 27 +++++--- pages/settings/embed.tsx | 63 ++++++++++-------- pages/settings/profile.tsx | 70 +++++++++----------- pages/settings/security.tsx | 1 - pages/settings/teams.tsx | 20 +++--- public/static/locales/en/common.json | 46 ++++++++++--- 8 files changed, 146 insertions(+), 99 deletions(-) diff --git a/components/SettingsShell.tsx b/components/SettingsShell.tsx index 04c91170..eb6f2945 100644 --- a/components/SettingsShell.tsx +++ b/components/SettingsShell.tsx @@ -1,28 +1,32 @@ import { CodeIcon, CreditCardIcon, KeyIcon, UserGroupIcon, UserIcon } from "@heroicons/react/solid"; import React from "react"; +import { useLocale } from "@lib/hooks/useLocale"; + import NavTabs from "./NavTabs"; export default function SettingsShell({ children }: { children: React.ReactNode }) { + const { t } = useLocale(); + const tabs = [ { - name: "Profile", + name: t("profile"), href: "/settings/profile", icon: UserIcon, }, { - name: "Security", + name: t("security"), href: "/settings/security", icon: KeyIcon, }, - { name: "Embed & Webhooks", href: "/settings/embed", icon: CodeIcon }, + { name: t("embed_and_webhooks"), href: "/settings/embed", icon: CodeIcon }, { - name: "Teams", + name: t("teams"), href: "/settings/teams", icon: UserGroupIcon, }, { - name: "Billing", + name: t("billing"), href: "/settings/billing", icon: CreditCardIcon, }, diff --git a/components/security/TwoFactorAuthSection.tsx b/components/security/TwoFactorAuthSection.tsx index cc16c424..888d3d2e 100644 --- a/components/security/TwoFactorAuthSection.tsx +++ b/components/security/TwoFactorAuthSection.tsx @@ -19,7 +19,7 @@ const TwoFactorAuthSection = ({ twoFactorEnabled }: { twoFactorEnabled: boolean
{t("add_an_extra_layer_of_security")}
@@ -28,7 +28,7 @@ const TwoFactorAuthSection = ({ twoFactorEnabled }: { twoFactorEnabled: boolean className="mt-6" type="submit" onClick={() => (enabled ? setDisableModalOpen(true) : setEnableModalOpen(true))}> - {enabled ? "Disable" : "Enable"} {t("2fa")} + {enabled ? t("disable") : t("enable")} {t("2fa")} {enableModalOpen && ( diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsx index 02b9a0cb..a6ce3664 100644 --- a/pages/settings/billing.tsx +++ b/pages/settings/billing.tsx @@ -1,7 +1,10 @@ import { ExternalLinkIcon } from "@heroicons/react/solid"; import { GetServerSidePropsContext } from "next"; +import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { getSession } from "@lib/auth"; +import { getOrSetUserLocaleFromHeaders } from "@lib/core/i18n/i18n.utils"; +import { useLocale } from "@lib/hooks/useLocale"; import prisma from "@lib/prisma"; import SettingsShell from "@components/SettingsShell"; @@ -9,24 +12,26 @@ import Shell from "@components/Shell"; import Button from "@components/ui/Button"; export default function Billing() { + const { t } = useLocale(); + return ( -View and edit your billing details, as well as cancel your subscription.
+{t("view_and_edit_billing_details")}
If you need any further help with billing, our support team are here to help.
+{t("further_billing_help")}
The easiest way to embed Cal.com on your website.
+{t("embed_calcom")}
- Receive Cal meeting data at a specified URL, in real-time, when an event is scheduled or - cancelled.{" "} -
+{t("receive_cal_meeting_data")}