From 800af201328c8a131168b81bfe3a1c2097b2dde4 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Mon, 18 Jul 2022 11:24:12 +0100 Subject: [PATCH] Add missing translation (#227) * Add missing translation * Add more missing translations --- public/locales/en/app.json | 14 +++++++++++--- src/components/login-form.tsx | 19 +++++++++++-------- src/components/poll/manage-poll.tsx | 2 +- src/components/standard-layout.tsx | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/public/locales/en/app.json b/public/locales/en/app.json index 3ebaf8d7e..9602c47c8 100644 --- a/public/locales/en/app.json +++ b/public/locales/en/app.json @@ -1,7 +1,9 @@ { "12h": "12-hour", "24h": "24-hour", + "addTimeOption": "Add time option", "admin": "Admin", + "applyToAllDates": "Apply to all dates", "areYouSure": "Are you sure?", "back": "Back", "blog": "Blog", @@ -9,10 +11,7 @@ "calendarHelpTitle": "Forget something?", "cancel": "Cancel", "comment": "Comment", - "applyToAllDates": "Apply to all dates", "commentPlaceholder": "Leave a comment on this poll (visible to everyone)", - "deleteDate": "Delete date", - "addTimeOption": "Add time option", "comments": "Comments", "continue": "Continue", "copied": "Copied", @@ -22,6 +21,7 @@ "creatingDemo": "Creating demo poll…", "delete": "Delete", "deleteComment": "Delete comment", + "deleteDate": "Delete date", "deletedPoll": "Deleted poll", "deletedPollInfo": "this poll doesn't exist anymore.", "deletePoll": "Delete poll", @@ -55,7 +55,14 @@ "locationPlaceholder": "Joe's Coffee Shop", "lockPoll": "Lock poll", "login": "Login", + "loginCheckInbox": "Please check your inbox.", + "loginMagicLinkSent": "A magic link has been sent to:", + "loginSendMagicLink": "Send me a magic link", + "loginViaMagicLink": "Login via magic link", + "loginViaMagicLinkDescription": "We'll send you an email with a magic link that you can use to login.", + "loginWithValidEmail": "Please enter a valid email address", "logout": "Logout", + "manage": "Manage", "menu": "Menu", "mixedOptionsDescription": "You can't have both time and date options in the same poll. Which would you like to keep?", "mixedOptionsKeepDates": "Keep date options", @@ -113,6 +120,7 @@ "voteCount": "{{count}} vote", "weekStartsOn": "Week starts on", "weekView": "Week view", + "whatsThis": "What's this?", "yes": "Yes", "yourDetails": "Your details", "yourPolls": "Your polls" diff --git a/src/components/login-form.tsx b/src/components/login-form.tsx index b8f49f464..72991206f 100644 --- a/src/components/login-form.tsx +++ b/src/components/login-form.tsx @@ -1,5 +1,6 @@ import clsx from "clsx"; import { useRouter } from "next/router"; +import { useTranslation } from "next-i18next"; import { usePlausible } from "next-plausible"; import * as React from "react"; import { useForm } from "react-hook-form"; @@ -11,6 +12,7 @@ import { validEmail } from "@/utils/form-validation"; import { trpc } from "../utils/trpc"; const LoginForm: React.VoidFunctionComponent = () => { + const { t } = useTranslation("app"); const { register, formState, handleSubmit, getValues } = useForm<{ email: string }>(); @@ -24,7 +26,9 @@ const LoginForm: React.VoidFunctionComponent = () => {
-
Login via magic link
+
+ {t("loginViaMagicLink")} +
{!formState.isSubmitSuccessful ? (
{ @@ -33,8 +37,7 @@ const LoginForm: React.VoidFunctionComponent = () => { })} >
- We'll send you an email with a magic link that you can use to - login. + {t("loginViaMagicLinkDescription")}
{ /> {formState.errors.email ? (
- Please enter a valid email address + {t("loginWithValidEmail")}
) : null}
@@ -58,17 +61,17 @@ const LoginForm: React.VoidFunctionComponent = () => { loading={formState.isSubmitting} type="primary" > - Send me a magic link + {t("loginSendMagicLink")}
) : (
-
A magic link has been sent to:
-
+
{t("loginMagicLinkSent")}
+
{getValues("email")}
-
Please check you inbox.
+
{t("loginCheckInbox")}
)}
diff --git a/src/components/poll/manage-poll.tsx b/src/components/poll/manage-poll.tsx index 212d8faaf..9672d20a9 100644 --- a/src/components/poll/manage-poll.tsx +++ b/src/components/poll/manage-poll.tsx @@ -177,7 +177,7 @@ const ManagePoll: React.VoidFunctionComponent<{ {changePollDetailsModalContextHolder} }>Manage} + trigger={} > { modalContext.render({ showClose: true,