Front/translate refactor (#110)
* Front: i18n: Create component * Front: Use new translation component * Front: Translation COmpoent: Change props name * Front: Fix merge
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// a form for sign in
|
||||
|
||||
import React from "react";
|
||||
import { translate } from "../../i18n/i18n";
|
||||
import { Translate, translate } from "../../i18n/i18n";
|
||||
import { string } from "yup";
|
||||
import {
|
||||
FormControl,
|
||||
@@ -51,7 +51,9 @@ const LoginForm = ({ onSubmit }: SigninFormProps) => {
|
||||
formData.password.error !== null
|
||||
}
|
||||
>
|
||||
<FormControl.Label>{translate("username")}</FormControl.Label>
|
||||
<FormControl.Label>
|
||||
<Translate translationKey='username'/>
|
||||
</FormControl.Label>
|
||||
<Input
|
||||
isRequired
|
||||
type="text"
|
||||
@@ -72,7 +74,9 @@ const LoginForm = ({ onSubmit }: SigninFormProps) => {
|
||||
>
|
||||
{formData.username.error}
|
||||
</FormControl.ErrorMessage>
|
||||
<FormControl.Label>{translate("password")}</FormControl.Label>
|
||||
<FormControl.Label>
|
||||
<Translate translationKey='password'/>
|
||||
</FormControl.Label>
|
||||
<Input
|
||||
isRequired
|
||||
type="password"
|
||||
@@ -117,7 +121,7 @@ const LoginForm = ({ onSubmit }: SigninFormProps) => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
{translate("login")}
|
||||
<Translate translationKey='login'/>
|
||||
</Button>
|
||||
</FormControl>
|
||||
</Stack>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// a form for sign up
|
||||
|
||||
import React from "react";
|
||||
import { translate } from "../../i18n/i18n";
|
||||
import { Translate, translate } from "../../i18n/i18n";
|
||||
import { string } from "yup";
|
||||
import {
|
||||
FormControl,
|
||||
@@ -74,7 +74,9 @@ const LoginForm = ({ onSubmit }: SignupFormProps) => {
|
||||
formData.email.error !== null
|
||||
}
|
||||
>
|
||||
<FormControl.Label>{translate("username")}</FormControl.Label>
|
||||
<FormControl.Label>
|
||||
<Translate translationKey='username'/>
|
||||
</FormControl.Label>
|
||||
<Input
|
||||
isRequired
|
||||
type="text"
|
||||
@@ -95,7 +97,9 @@ const LoginForm = ({ onSubmit }: SignupFormProps) => {
|
||||
>
|
||||
{formData.username.error}
|
||||
</FormControl.ErrorMessage>
|
||||
<FormControl.Label>{translate("email")}</FormControl.Label>
|
||||
<FormControl.Label>
|
||||
<Translate translationKey='email'/>
|
||||
</FormControl.Label>
|
||||
<Input
|
||||
isRequired
|
||||
type="text"
|
||||
@@ -116,7 +120,9 @@ const LoginForm = ({ onSubmit }: SignupFormProps) => {
|
||||
>
|
||||
{formData.email.error}
|
||||
</FormControl.ErrorMessage>
|
||||
<FormControl.Label>{translate("password")}</FormControl.Label>
|
||||
<FormControl.Label>
|
||||
<Translate translationKey='password'/>
|
||||
</FormControl.Label>
|
||||
<Input
|
||||
isRequired
|
||||
type="password"
|
||||
@@ -137,7 +143,9 @@ const LoginForm = ({ onSubmit }: SignupFormProps) => {
|
||||
>
|
||||
{formData.password.error}
|
||||
</FormControl.ErrorMessage>
|
||||
<FormControl.Label>{translate("repeatPassword")}</FormControl.Label>
|
||||
<FormControl.Label>
|
||||
<Translate translationKey='repeatPassword'/>
|
||||
</FormControl.Label>
|
||||
<Input
|
||||
isRequired
|
||||
type="password"
|
||||
@@ -193,7 +201,7 @@ const LoginForm = ({ onSubmit }: SignupFormProps) => {
|
||||
}
|
||||
}}
|
||||
>
|
||||
{translate("signUp")}
|
||||
<Translate translationKey='signUp'/>
|
||||
</Button>
|
||||
</FormControl>
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user