Fixing admin wizard translations (#6038)

This commit is contained in:
Leo Giovanetti authored and GitHub committed 2022-12-15 15:03:57 +00:00
1 parent a638708871
commit 3ee294ffc5
2 files changed
+8 -3

No files matched your search

+4 -1
View File
@@ -1,5 +1,7 @@
import Link from "next/link"; import Link from "next/link";
import { useLocale } from "@calcom/lib/hooks/useLocale";
type DefaultStep = { type DefaultStep = {
title: string; title: string;
}; };
@@ -10,13 +12,14 @@ function Stepper<T extends DefaultStep>(props: {
steps: T[]; steps: T[];
disableSteps?: boolean; disableSteps?: boolean;
}) { }) {
const { t } = useLocale();
const { href, steps } = props; const { href, steps } = props;
return ( return (
<> <>
{steps.length > 1 && ( {steps.length > 1 && (
<nav className="flex items-center justify-center" aria-label="Progress"> <nav className="flex items-center justify-center" aria-label="Progress">
<p className="text-sm font-medium"> <p className="text-sm font-medium">
Step {props.step} of {steps.length} {t("current_step_of_total", { currentStep: props.step, maxSteps: steps.length })}
</p> </p>
<ol role="list" className="ml-8 flex items-center space-x-5"> <ol role="list" className="ml-8 flex items-center space-x-5">
{steps.map((mapStep, index) => ( {steps.map((mapStep, index) => (
+4 -2
View File
@@ -1,6 +1,7 @@
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import classNames from "@calcom/lib/classNames"; import classNames from "@calcom/lib/classNames";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Button, Stepper } from "../.."; import { Button, Stepper } from "../..";
@@ -19,6 +20,7 @@ function WizardForm<T extends DefaultStep>(props: {
containerClassname?: string; containerClassname?: string;
}) { }) {
const { href, steps } = props; const { href, steps } = props;
const { t } = useLocale();
const router = useRouter(); const router = useRouter();
const step = parseInt((router.query.step as string) || "1"); const step = parseInt((router.query.step as string) || "1");
const currentStep = steps[step - 1]; const currentStep = steps[step - 1];
@@ -51,7 +53,7 @@ function WizardForm<T extends DefaultStep>(props: {
onClick={() => { onClick={() => {
setStep(step - 1); setStep(step - 1);
}}> }}>
Back {t("prev_step")}
</Button> </Button>
)} )}
@@ -65,7 +67,7 @@ function WizardForm<T extends DefaultStep>(props: {
onClick={() => { onClick={() => {
setStep(step + 1); setStep(step + 1);
}}> }}>
{step < steps.length ? "Next" : "Finish"} {step < steps.length ? t("next_step_text") : t("finish")}
</Button> </Button>
</div> </div>
)} )}