Skip to content

Commit

Permalink
Locale update patch (lukevella#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevella authored Jul 21, 2022
1 parent e0a5cfe commit f46c9b0
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 100 deletions.
3 changes: 0 additions & 3 deletions public/locales/de/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"applyToAllDates": "Auf alle Termine anwenden",
"areYouSure": "Bist du sicher?",
"back": "Zurück",
"blog": "Blog",
"calendarHelp": "Du kannst keine Umfrage ohne Optionen erstellen. Füge mindestens eine Option hinzu, um fortzufahren.",
"calendarHelpTitle": "Irgendwas vergessen?",
"cancel": "Abbrechen",
Expand All @@ -29,7 +28,6 @@
"demoPollNotice": "Demo-Umfragen werden automatisch nach einem Tag gelöscht",
"description": "Beschreibung",
"descriptionPlaceholder": "Hallo ihr, bitte wählt alle Termine aus, die für euch passen!",
"discussions": "Diskussion",
"donate": "Spenden",
"editDetails": "Details bearbeiten",
"editOptions": "Optionen bearbeiten",
Expand Down Expand Up @@ -107,7 +105,6 @@
"specifyTimesDescription": "Start- und Endzeit für jede Option angeben",
"stepSummary": "Schritt {{current}} von {{total}}",
"sunday": "Sonntag",
"support": "Hilfe",
"timeAndDate": "Datum & Uhrzeit",
"timeFormat": "Uhrzeitformat:",
"timeZone": "Zeitzone:",
Expand Down
18 changes: 11 additions & 7 deletions public/locales/de/common.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"language": "Sprache",
"blog": "Blog",
"discussions": "Diskussion",
"donate": "Spenden",
"english": "Englisch",
"footerCredit": "Made by <a>@imlukevella</a>",
"footerSponsor": "This project is user-funded. Please consider supporting it by <a>donating</a>.",
"german": "Deutsch",
"home": "Home",
"blog": "Blog",
"support": "Support",
"donate": "Donate",
"volunteerTranslator": "Help translate this site",
"language": "Sprache",
"links": "Links",
"poweredBy": "Unterstützt von",
"privacyPolicy": "Datenschutzerklärung",
"starOnGithub": "Star us on Github",
"footerCredit": "Made by <a>@imlukevella</a>",
"footerSponsor": "This project is user-funded. Please consider supporting it by <a>donating</a>."
"support": "Hilfe",
"volunteerTranslator": "Help translate this site"
}
7 changes: 0 additions & 7 deletions public/locales/de/homepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
"3Ls": "Ja – mit 3 <e>L</e>s",
"adFree": "Ohne Werbung",
"adFreeDescription": "Gönn deinem Adblocker eine Pause - du brauchst ihn hier nicht.",
"blog": "Blog",
"comments": "Kommentare",
"commentsDescription": "Teilnehmer können deine Umfrage kommentieren, die Kommentare sind für alle sichtbar.",
"discussions": "Diskussion",
"features": "Funktionen",
"featuresSubheading": "Terminfindung leicht gemacht",
"follow": "Folgen",
Expand All @@ -30,15 +28,10 @@
"social": "Social",
"participantCount": "{{count}} Teilnehmer",
"perfect": "Perfekt!",
"poweredBy": "Unterstützt von",
"principles": "Grundsätze",
"principlesSubheading": "Wir sind nicht wie die anderen",
"privacyPolicy": "Datenschutzrichtlinie",
"selfHostable": "Selfhosting möglich",
"selfHostableDescription": "Betreibe es auf deinem eigenen Server, um die volle Kontrolle über deine Daten zu haben",
"sponsorThisProject": "Dieses Projekt unterstützen",
"star": "Star",
"support": "Hilfe",
"timeSlots": "Zeitfenster",
"timeSlotsDescription": "Wähle individuelle Start- und Endzeiten für jede Option in deiner Umfrage. Die Zeiten können automatisch an die Zeitzone jedes Teilnehmers angepasst werden oder so eingestellt werden, dass Zeitzonen komplett ignoriert werden."
}
3 changes: 0 additions & 3 deletions public/locales/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"applyToAllDates": "Apply to all dates",
"areYouSure": "Are you sure?",
"back": "Back",
"blog": "Blog",
"calendarHelp": "You can't create a poll without any options. Add at least one option to continue.",
"calendarHelpTitle": "Forget something?",
"cancel": "Cancel",
Expand All @@ -29,7 +28,6 @@
"demoPollNotice": "Demo polls are automatically deleted after 1 day",
"description": "Description",
"descriptionPlaceholder": "Hey everyone, please choose the dates that work for you!",
"discussions": "Discussions",
"donate": "Donate",
"editDetails": "Edit details",
"editOptions": "Edit options",
Expand Down Expand Up @@ -107,7 +105,6 @@
"specifyTimesDescription": "Include start and end times for each option",
"stepSummary": "Step {{current}} of {{total}}",
"sunday": "Sunday",
"support": "Support",
"timeAndDate": "Time & date",
"timeFormat": "Time format:",
"timeZone": "Time Zone:",
Expand Down
18 changes: 11 additions & 7 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"language": "Language",
"blog": "Blog",
"discussions": "Discussions",
"donate": "Donate",
"english": "English",
"footerCredit": "Made by <a>@imlukevella</a>",
"footerSponsor": "This project is user-funded. Please consider supporting it by <a>donating</a>.",
"german": "German",
"home": "Home",
"blog": "Blog",
"support": "Support",
"donate": "Donate",
"volunteerTranslator": "Help translate this site",
"language": "Language",
"links": "Links",
"poweredBy": "Powered by",
"privacyPolicy": "Privacy Policy",
"starOnGithub": "Star us on Github",
"footerCredit": "Made by <a>@imlukevella</a>",
"footerSponsor": "This project is user-funded. Please consider supporting it by <a>donating</a>."
"support": "Support",
"volunteerTranslator": "Help translate this site"
}
7 changes: 0 additions & 7 deletions public/locales/en/homepage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
"3Ls": "Yes—with 3 <e>L</e>s",
"adFree": "Ad-free",
"adFreeDescription": "You can give your ad-blocker a rest — You won't need it here.",
"blog": "Blog",
"comments": "Comments",
"commentsDescription": "Participants can comment on your poll and the comments will be visible to everyone.",
"discussions": "Discussions",
"features": "Features",
"featuresSubheading": "Scheduling, the smart way",
"follow": "Follow",
Expand All @@ -30,15 +28,10 @@
"social": "Social",
"participantCount": "{{count}} participant",
"perfect": "Perfect!",
"poweredBy": "Powered by",
"principles": "Principles",
"principlesSubheading": "We're not like the others",
"privacyPolicy": "Privacy policy",
"selfHostable": "Self-hostable",
"selfHostableDescription": "Run it on your own server to take full control of your data",
"sponsorThisProject": "Sponsor this project",
"star": "Star",
"support": "Support",
"timeSlots": "Time slots",
"timeSlotsDescription": "Set individual start and end times for each option in your poll. Times can be automatically adjusted to each participant's timezone or they can be set to ignore timezones completely."
}
24 changes: 12 additions & 12 deletions src/components/page-layout/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Vercel from "~/public/vercel-logotype-dark.svg";
import { LanguageSelect } from "../poll/language-selector";

const Footer: React.VoidFunctionComponent = () => {
const { t } = useTranslation(["common", "homepage"]);
const { t } = useTranslation("common");
const router = useRouter();
return (
<div className="mt-16 bg-slate-50/70">
Expand All @@ -26,7 +26,7 @@ const Footer: React.VoidFunctionComponent = () => {
<p>
<Trans
t={t}
i18nKey="common:footerSponsor"
i18nKey="footerSponsor"
components={{
a: (
<a
Expand All @@ -40,7 +40,7 @@ const Footer: React.VoidFunctionComponent = () => {
<div>
<Trans
t={t}
i18nKey="common:footerCredit"
i18nKey="footerCredit"
components={{
a: (
<a
Expand Down Expand Up @@ -70,25 +70,25 @@ const Footer: React.VoidFunctionComponent = () => {
className="inline-flex h-8 items-center rounded-full bg-slate-100 pl-2 pr-3 text-sm text-slate-400 transition-colors hover:bg-primary-500 hover:text-white hover:no-underline focus:ring-2 focus:ring-primary-500 focus:ring-offset-1 active:bg-primary-600"
>
<Star className="mr-2 inline-block w-5" />
<span>{t("common:starOnGithub")}</span>
<span>{t("starOnGithub")}</span>
</a>
</div>
</div>
<div className="lg:col-span-2">
<div className="mb-4 font-medium">{t("homepage:links")}</div>
<div className="mb-4 font-medium">{t("links")}</div>
<ul>
<li>
<a
className="font-normal leading-loose text-slate-400 hover:text-slate-800 hover:no-underline"
href="https://github.com/lukevella/rallly/discussions"
>
{t("homepage:discussions")}
{t("discussions")}
</a>
</li>
<li>
<Link href="https://blog.rallly.co">
<a className="font-normal leading-loose text-slate-400 hover:text-slate-800 hover:no-underline">
{t("homepage:blog")}
{t("blog")}
</a>
</Link>
</li>
Expand All @@ -97,20 +97,20 @@ const Footer: React.VoidFunctionComponent = () => {
href="https://support.rallly.co"
className="font-normal leading-loose text-slate-400 hover:text-slate-800 hover:no-underline"
>
{t("homepage:support")}
{t("support")}
</a>
</li>
<li>
<Link href="/privacy-policy">
<a className="font-normal leading-loose text-slate-400 hover:text-slate-800 hover:no-underline">
{t("homepage:privacyPolicy")}
{t("privacyPolicy")}
</a>
</Link>
</li>
</ul>
</div>
<div className="lg:col-span-3">
<div className="mb-4 font-medium">{t("homepage:poweredBy")}</div>
<div className="mb-4 font-medium">{t("poweredBy")}</div>
<div className="block space-y-4">
<div>
<a
Expand All @@ -133,7 +133,7 @@ const Footer: React.VoidFunctionComponent = () => {
</div>
</div>
<div className="lg:col-span-3">
<div className="mb-4 font-medium">{t("common:language")}</div>
<div className="mb-4 font-medium">{t("language")}</div>
<LanguageSelect
className="mb-4 w-full"
onChange={(locale) => {
Expand All @@ -145,7 +145,7 @@ const Footer: React.VoidFunctionComponent = () => {
className="inline-flex items-center rounded-md border px-3 py-2 text-xs text-slate-500"
>
<Translate className="mr-2 h-5 w-5" />
{t("common:volunteerTranslator")} &rarr;
{t("volunteerTranslator")} &rarr;
</a>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/poll/desktop-poll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ const Poll: React.VoidFunctionComponent = () => {
Math.floor((width - (minSidebarWidth + actionColumnWidth)) / columnWidth),
);

const sidebarWidth =
width - (numberOfVisibleColumns * columnWidth + actionColumnWidth);
const sidebarWidth = Math.min(
width - (numberOfVisibleColumns * columnWidth + actionColumnWidth),
300,
);

const availableSpace = Math.min(
numberOfVisibleColumns * columnWidth,
Expand Down
50 changes: 26 additions & 24 deletions src/components/poll/desktop-poll/participant-row-form.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import clsx from "clsx";
import { AnimatePresence, motion } from "framer-motion";
import { useTranslation } from "next-i18next";
import * as React from "react";
import { Controller, useForm } from "react-hook-form";

import ArrowLeft from "@/components/icons/arrow-left.svg";
import ArrowRight from "@/components/icons/arrow-right.svg";

import { requiredString } from "../../../utils/form-validation";
Expand All @@ -16,7 +16,6 @@ import { VoteSelector } from "../vote-selector";
import ControlledScrollArea from "./controlled-scroll-area";
import { usePollContext } from "./poll-context";

const MotionButton = motion(Button);
export interface ParticipantRowFormProps {
defaultValues?: Partial<ParticipantForm>;
onSubmit: (data: ParticipantFormSubmitted) => Promise<void>;
Expand All @@ -35,6 +34,7 @@ const ParticipantRowForm: React.ForwardRefRenderFunction<
sidebarWidth,
numberOfColumns,
goToNextPage,
goToPreviousPage,
maxScrollPosition,
setScrollPosition,
} = usePollContext();
Expand Down Expand Up @@ -161,28 +161,30 @@ const ParticipantRowForm: React.ForwardRefRenderFunction<
);
}}
/>

<div className="flex items-center space-x-2 px-2 transition-all">
{scrollPosition < maxScrollPosition ? (
<AnimatePresence initial={false}>
{scrollPosition < maxScrollPosition ? (
<MotionButton
transition={{ duration: 0.1 }}
initial={{ opacity: 0, scale: 0.9 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.8 }}
className="text-xs"
rounded={true}
onClick={() => {
goToNextPage();
}}
>
<ArrowRight className="h-4 w-4" />
</MotionButton>
) : null}
</AnimatePresence>
) : null}
</div>
{maxScrollPosition > 0 ? (
<div className="flex items-center space-x-2 px-2 transition-all">
<Button
disabled={scrollPosition === 0}
className="text-xs"
rounded={true}
onClick={() => {
goToPreviousPage();
}}
>
<ArrowLeft className="h-4 w-4" />
</Button>
<Button
disabled={scrollPosition >= maxScrollPosition}
className="text-xs"
rounded={true}
onClick={() => {
goToNextPage();
}}
>
<ArrowRight className="h-4 w-4" />
</Button>
</div>
) : null}
</form>
);
};
Expand Down
Loading

0 comments on commit f46c9b0

Please sign in to comment.