feat(i18n): loginpage translate
This commit is contained in:
@@ -7,6 +7,7 @@ import { AuthError } from "@/types/auth";
|
||||
import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
import { ERROR_MESSAGES } from "@/constants/errorMessages";
|
||||
import { ErrorMessage } from "@/components/ui/ErrorMessage";
|
||||
import { useTranslate } from "@/hooks/useTranslate";
|
||||
|
||||
interface RegisterFormProps {
|
||||
from?: string;
|
||||
@@ -16,6 +17,7 @@ export function RegisterForm({ from }: RegisterFormProps) {
|
||||
const router = useRouter();
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<AuthError | null>(null);
|
||||
const { t } = useTranslate();
|
||||
|
||||
const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
@@ -54,7 +56,7 @@ export function RegisterForm({ from }: RegisterFormProps) {
|
||||
htmlFor="email"
|
||||
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||
>
|
||||
Email
|
||||
{t("login.form.email")}
|
||||
</label>
|
||||
<input
|
||||
id="email"
|
||||
@@ -70,7 +72,7 @@ export function RegisterForm({ from }: RegisterFormProps) {
|
||||
htmlFor="password"
|
||||
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||
>
|
||||
Mot de passe
|
||||
{t("login.form.password")}
|
||||
</label>
|
||||
<input
|
||||
id="password"
|
||||
@@ -86,7 +88,7 @@ export function RegisterForm({ from }: RegisterFormProps) {
|
||||
htmlFor="confirmPassword"
|
||||
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
||||
>
|
||||
Confirmer le mot de passe
|
||||
{t("login.form.confirmPassword")}
|
||||
</label>
|
||||
<input
|
||||
id="confirmPassword"
|
||||
@@ -103,7 +105,7 @@ export function RegisterForm({ from }: RegisterFormProps) {
|
||||
disabled={isLoading}
|
||||
className="inline-flex w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
|
||||
>
|
||||
{isLoading ? "Inscription en cours..." : "S'inscrire"}
|
||||
{isLoading ? t("login.form.submit.loading.register") : t("login.form.submit.register")}
|
||||
</button>
|
||||
</form>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user