From cdccfc9180aab1cc0c3e7ce96d775ae1ba709e60 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Tue, 9 Aug 2022 08:58:11 +0100 Subject: [PATCH] Add missing translations (#278) --- public/locales/en/app.json | 3 +++ src/components/poll/mobile-poll.tsx | 8 ++++---- src/components/poll/mobile-poll/poll-option.tsx | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/public/locales/en/app.json b/public/locales/en/app.json index 93cacd522..a8eccd1ac 100644 --- a/public/locales/en/app.json +++ b/public/locales/en/app.json @@ -31,6 +31,7 @@ "description": "Description", "descriptionPlaceholder": "Hey everyone, please choose the dates that work for you!", "donate": "Donate", + "edit": "Edit", "editDetails": "Edit details", "editOptions": "Edit options", "email": "Email", @@ -71,6 +72,7 @@ "monthView": "Month view", "name": "Name", "namePlaceholder": "Jessie Smith", + "new": "New", "newPoll": "New poll", "next": "Next", "nextMonth": "Next month", @@ -81,6 +83,7 @@ "notificationsOn": "Notifications are on", "notificationsOnDescription": "An email will be sent to {{email}} when there is activity on this poll.", "notificationsVerifyEmail": "You need to verify your email to turn on notifications", + "noVotes": "No one has voted for this option", "ok": "Ok", "options": "Options", "participant": "Participant", diff --git a/src/components/poll/mobile-poll.tsx b/src/components/poll/mobile-poll.tsx index f9ad63b40..a96b28e87 100644 --- a/src/components/poll/mobile-poll.tsx +++ b/src/components/poll/mobile-poll.tsx @@ -205,7 +205,7 @@ const MobilePoll: React.VoidFunctionComponent = () => { reset(); }} > - Cancel + {t("cancel")} ) : selectedParticipant ? (
@@ -232,7 +232,7 @@ const MobilePoll: React.VoidFunctionComponent = () => { }); }} > - Edit + {t("edit")} )}
@@ -317,7 +317,7 @@ const MobilePoll: React.VoidFunctionComponent = () => { type="primary" loading={formState.isSubmitting} > - Save + {t("save")} diff --git a/src/components/poll/mobile-poll/poll-option.tsx b/src/components/poll/mobile-poll/poll-option.tsx index 1cd0731be..aa52a43e9 100644 --- a/src/components/poll/mobile-poll/poll-option.tsx +++ b/src/components/poll/mobile-poll/poll-option.tsx @@ -1,6 +1,7 @@ import { Participant, VoteType } from "@prisma/client"; import clsx from "clsx"; import { AnimatePresence, motion } from "framer-motion"; +import { useTranslation } from "next-i18next"; import * as React from "react"; import ChevronDown from "@/components/icons/chevron-down.svg"; @@ -72,6 +73,7 @@ const PopInOut: React.VoidFunctionComponent<{ const PollOptionVoteSummary: React.VoidFunctionComponent<{ optionId: string }> = ({ optionId }) => { + const { t } = useTranslation("app"); const { getParticipants } = useParticipants(); const participantsWhoVotedYes = getParticipants(optionId, "yes"); const participantsWhoVotedIfNeedBe = getParticipants(optionId, "ifNeedBe"); @@ -92,7 +94,7 @@ const PollOptionVoteSummary: React.VoidFunctionComponent<{ optionId: string }> =
{noVotes ? (
- No one has voted for this option + {t("noVotes")}
) : (