Login Translate

This commit is contained in:
Sedat ÖZTÜRK 2025-05-29 10:56:27 +03:00
parent 3bf7d70dea
commit cd0b9d3b71
9 changed files with 266 additions and 68 deletions

View file

@ -1416,6 +1416,66 @@
"en": "Enable self registration Description",
"tr": "Kendi kendine kaydı etkinleştir Açıklaması"
},
{
"resourceName": "Platform",
"key": "Abp.Account.WelcomeBack",
"en": "Welcome back!",
"tr": "Tekrar hoşgeldiniz!"
},
{
"resourceName": "Platform",
"key": "Abp.Account.WelcomeBack.Message",
"en": "Please enter your credentials to sign in!",
"tr": "Giriş yapmak için lütfen kimlik bilgilerinizi girin!"
},
{
"resourceName": "Platform",
"key": "Abp.Account.SignUp",
"en": "Sign up",
"tr": "Yeni Üye"
},
{
"resourceName": "Platform",
"key": "Abp.Account.SignUp.Message",
"en": "Don't have an account yet?",
"tr": "Henüz bir hesabınız yok mu?"
},
{
"resourceName": "Platform",
"key": "Abp.Account.EmailAddress",
"en": "Email Address",
"tr": "Email Adresi"
},
{
"resourceName": "Platform",
"key": "Abp.Account.Password",
"en": "Password",
"tr": "Parola"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ConfirmPassword",
"en": "Confirm Password",
"tr": "Şifreyi Onayla"
},
{
"resourceName": "Platform",
"key": "Abp.Account.2FACode",
"en": "2FA Code",
"tr": "İki Faktör"
},
{
"resourceName": "Platform",
"key": "Abp.Account.RememberMe",
"en": "Remember Me",
"tr": "Beni Hatırla"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ForgotPassword",
"en": "Forgot password?",
"tr": "Şifremi Unuttum?"
},
{
"resourceName": "Platform",
"key": "Abp.Account.TwoFactor",
@ -1494,6 +1554,132 @@
"en": "Private Key Description",
"tr": "Özel Anahtarııklaması"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ExtendLogin.Title",
"en": "Extension request received",
"tr": "Uzatma talebi alındı"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ExtendLogin.Description",
"en": "If your account is opened after your request is reviewed, you will also be sent an e-mail.",
"tr": "Talebiniz incelendikten sonra hesabınız açılırsa size ayrıca mail gönderilecektir."
},
{
"resourceName": "Platform",
"key": "Abp.Account.Backto",
"en": "Back to ",
"tr": "Geri dön "
},
{
"resourceName": "Platform",
"key": "Abp.Account.SignIn",
"en": "Sign in",
"tr": "Oturum Aç"
},
{
"resourceName": "Platform",
"key": "Abp.Account.Register",
"en": "New register",
"tr": "Yeni Üyelik"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ExtendLogin",
"en": "Extend My Login",
"tr": "Oturumu Uzat"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ForgotPassword.Checkyouremail",
"en": "Check your email",
"tr": "E-postanızı kontrol edin"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ForgotPassword.Checkyouremail.Message",
"en": "We have sent a password recovery instruction to your email",
"tr": "E-postanıza bir şifre kurtarma talimatı gönderdik"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ForgotPassword.Message",
"en": "Please enter your email address to receive a verification code",
"tr": "Doğrulama kodunu almak için lütfen e-posta adresinizi girin"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ResetPassword.ResetDone",
"en": "Reset Done",
"tr": "Sıfırlama tamamlandı"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ResetPassword.ResetDone.Message",
"en": "Your password has been successfully reset",
"tr": "Şifreniz başarıyla sıfırlandı"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ResetPassword.SetNewPassword",
"en": "Set new password",
"tr": "Yeni şifre belirle"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ResetPassword.SetNewPassword.Message",
"en": "Your new password must different to previous password",
"tr": "Yeni şifreniz önceki şifrenizden farklı olmalıdır"
},
{
"resourceName": "Platform",
"key": "Abp.Account.ResetPassword.Continue",
"en": "Continue",
"tr": "Devam"
},
{
"resourceName": "Platform",
"key": "Abp.Account.SendConfirmationCode",
"en": "Confirm Email",
"tr": "E-posta Onayla"
},
{
"resourceName": "Platform",
"key": "Abp.Account.SendConfirmationCode.Message",
"en": "Please enter your email to receive new confirmation code",
"tr": "Yeni onay kodunu almak için lütfen e-postanızı girin"
},
{
"resourceName": "Platform",
"key": "Abp.Account.VerifyConfirmationCode",
"en": "Request New Confirmation Code",
"tr": "Yeni Onay Kodu İsteyin"
},
{
"resourceName": "Platform",
"key": "Abp.Account.Register.Title",
"en": "Sign Up",
"tr": "Üye Ol"
},
{
"resourceName": "Platform",
"key": "Abp.Account.Register.Message",
"en": "And let's get started with your free trial",
"tr": "Ve ücretsiz denemenize başlayalım"
},
{
"resourceName": "Platform",
"key": "Abp.Account.Register.AlreadyHaveAnAccount",
"en": "Already have an account? ",
"tr": "Zaten bir hesabınız var mı?"
},
{
"resourceName": "Platform",
"key": "Abp.Account.Register.ResultMessage",
"en": "Success. Please confirm your account by clicking the link.",
"tr": "Başarılı. Lütfen bağlantıya tıklayarak hesabınızı onaylayın."
},
{
"resourceName": "Platform",
"key": "Abp.Identity",

View file

@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812"
}, {
"url": "index.html",
"revision": "0.8b8tnlffsvo"
"revision": "0.952ffulqdco"
}], {});
workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

View file

@ -7,6 +7,7 @@ import Input from '@/components/ui/Input'
import { ROUTES_ENUM } from '@/constants/route.constant'
import { sendExtendLoginRequest } from '@/proxy/account/account.service'
import { store } from '@/store'
import { useLocalization } from '@/utils/hooks/useLocalization'
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
import { Field, Form, Formik } from 'formik'
import { useState } from 'react'
@ -18,7 +19,7 @@ type ExtendLoginFormSchema = {
}
const validationSchema = Yup.object().shape({
email: Yup.string().required('Please enter your email'),
email: Yup.string().required(),
captchaResponse: Yup.string().required(),
})
@ -30,6 +31,7 @@ const ExtendLogin = () => {
const [emailSent, setEmailSent] = useState(false)
const [message, setMessage] = useTimeOutMessage(10000)
const { translate } = useLocalization()
const onSendMail = async (
values: ExtendLoginFormSchema,
@ -51,17 +53,17 @@ const ExtendLogin = () => {
return emailSent ? (
<>
<h3 className="mb-1">Uzatma talebi alındı</h3>
<p>Talebiniz incelendikten sonra hesabınız ılırsa size ayrıca mail gönderilecektir.</p>
<h3 className="mb-1">{ translate('::Abp.Account.ExtendLogin.Title')}</h3>
<p>{ translate('::Abp.Account.ExtendLogin.Description')}</p>
<div className="mt-4 text-center">
<span>Back to </span>
<ActionLink to={signInUrl}>Sign in</ActionLink>
<span>{translate('::Abp.Account.Backto')} </span>
<ActionLink to={signInUrl}>{ translate('::Abp.Account.SignIn')}</ActionLink>
</div>{' '}
</>
) : (
<div>
<div className="mb-6">
<h3 className="mb-1">Extend My Login</h3>
<h3 className="mb-1">{ translate('::Abp.Account.ExtendLogin')}</h3>
</div>
{message && (
<Alert showIcon className="mb-4" type="danger">
@ -91,7 +93,7 @@ const ExtendLogin = () => {
type="email"
autoComplete="off"
name="email"
placeholder="Email"
placeholder={translate('::Abp.Account.EmailAddress')}
component={Input}
/>
</FormItem>
@ -105,8 +107,8 @@ const ExtendLogin = () => {
{emailSent ? 'Resend Email' : 'Send Email'}
</Button>
<div className="mt-4 text-center">
<span>Back to </span>
<ActionLink to={signInUrl}>Sign in</ActionLink>
<span>{translate('::Abp.Account.Backto')} </span>
<ActionLink to={signInUrl}>{ translate('::Abp.Account.SignIn')}</ActionLink>
</div>
</FormContainer>
</Form>

View file

@ -7,6 +7,7 @@ import Input from '@/components/ui/Input'
import { ROUTES_ENUM } from '@/constants/route.constant'
import { sendPasswordResetCode } from '@/proxy/account/account.service'
import { store } from '@/store'
import { useLocalization } from '@/utils/hooks/useLocalization'
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
import type { AxiosError } from 'axios'
import { Field, Form, Formik } from 'formik'
@ -32,6 +33,7 @@ const ForgotPassword = () => {
const [emailSent, setEmailSent] = useState(false)
const [message, setMessage] = useTimeOutMessage()
const { translate } = useLocalization()
const onSendMail = async (
values: ForgotPasswordFormSchema,
@ -62,13 +64,13 @@ const ForgotPassword = () => {
<div className="mb-6">
{emailSent ? (
<>
<h3 className="mb-1">Check your email</h3>
<p>We have sent a password recovery instruction to your email</p>
<h3 className="mb-1">{translate('::Abp.Account.ForgotPassword.Checkyouremail')}</h3>
<p>{translate('::Abp.Account.ForgotPassword.Checkyouremail.Message')}</p>
</>
) : (
<>
<h3 className="mb-1">Forgot Password</h3>
<p>Please enter your email address to receive a verification code</p>
<h3 className="mb-1">{ translate('::Abp.Account.ForgotPassword')}</h3>
<p>{ translate('::Abp.Account.ForgotPassword.Message')}</p>
</>
)}
</div>
@ -100,7 +102,7 @@ const ForgotPassword = () => {
type="email"
autoComplete="off"
name="email"
placeholder="Email"
placeholder={translate('::Abp.Account.EmailAddress')}
component={Input}
/>
</FormItem>
@ -114,8 +116,8 @@ const ForgotPassword = () => {
{emailSent ? 'Resend Email' : 'Send Email'}
</Button>
<div className="mt-4 text-center">
<span>Back to </span>
<ActionLink to={signInUrl}>Sign in</ActionLink>
<span>{translate('::Abp.Account.Backto')} </span>
<ActionLink to={signInUrl}>{ translate('::Abp.Account.SignIn')}</ActionLink>
</div>
</FormContainer>
</Form>

View file

@ -202,13 +202,13 @@ const Login = () => {
transition={{ duration: 0.5, origin: 1 }}
>
<div className="mb-8">
<h3 className="mb-1">Welcome back!</h3>
<p>Please enter your credentials to sign in!</p>
<h3 className="mb-1">{translate('::Abp.Account.WelcomeBack')}</h3>
<p>{translate('::Abp.Account.WelcomeBack.Message')}</p>
</div>
{isMultiTenant && (
<>
<label className="form-label mb-2" style={tenantStyle}>
Company
{ translate('::Sirket')}
</label>
<div className="mb-4">
<Input
@ -238,7 +238,7 @@ const Login = () => {
<FormContainer>
{!twoFactor && (
<FormItem
label="Email"
label={translate('::Abp.Account.EmailAddress')}
invalid={errors.userName && touched.userName}
errorMessage={errors.userName}
>
@ -246,35 +246,35 @@ const Login = () => {
type="text"
autoComplete="off"
name="userName"
placeholder="Email"
placeholder={translate('::Abp.Account.EmailAddress')}
component={Input}
/>
</FormItem>
)}
{!twoFactor && (
<FormItem
label="Password"
label={translate('::Abp.Account.Password')}
invalid={errors.password && touched.password}
errorMessage={errors.password}
>
<Field
autoComplete="off"
name="password"
placeholder="Password"
placeholder={translate('::Abp.Account.Password')}
component={PasswordInput}
/>
</FormItem>
)}
{twoFactor && (
<FormItem
label="2FA Code"
label={translate('::Abp.Account.2FACode')}
invalid={errors.twoFactorCode && touched.twoFactorCode}
errorMessage={errors.twoFactorCode}
>
<Field
autoComplete="off"
name="twoFactorCode"
placeholder="2FA Code"
placeholder={translate('::Abp.Account.2FACode')}
component={Input}
/>
</FormItem>
@ -282,9 +282,9 @@ const Login = () => {
<div className="flex justify-between mb-6">
<Field className="mb-0" name="rememberMe" component={Checkbox}>
Remember Me
{translate('::Abp.Account.RememberMe')}
</Field>
<ActionLink to={ROUTES_ENUM.account.forgotPassword}>Forgot Password?</ActionLink>
<ActionLink to={ROUTES_ENUM.account.forgotPassword}>{translate('::Abp.Account.ForgotPassword')}</ActionLink>
</div>
{showCaptcha && (
<Captcha
@ -310,8 +310,8 @@ const Login = () => {
{isSubmitting ? 'Signing in...' : 'Sign In'}
</Button>
<div className="mt-4 text-center">
<span>Dont have an account yet? </span>
<ActionLink to={ROUTES_ENUM.account.register}>Sign up</ActionLink>
<span>{translate('::Abp.Account.SignUp.Message')} </span>
<ActionLink to={ROUTES_ENUM.account.register}>{translate('::Abp.Account.Register')}</ActionLink>
</div>
</FormContainer>
</Form>

View file

@ -11,6 +11,7 @@ import Captcha from '@/components/shared/Captcha'
import { Field, Form, Formik } from 'formik'
import { useState } from 'react'
import * as Yup from 'yup'
import { useLocalization } from '@/utils/hooks/useLocalization'
type SignUpFormSchema = {
password: string
@ -21,11 +22,11 @@ type SignUpFormSchema = {
}
const validationSchema = Yup.object().shape({
email: Yup.string().email('Invalid email').required('Please enter your email'),
password: Yup.string().required('Please enter your password'),
email: Yup.string().email().required(),
password: Yup.string().required(),
confirmPassword: Yup.string().oneOf([Yup.ref('password')], 'Your passwords do not match'),
name: Yup.string().required('Name is required'),
surname: Yup.string().required('Surname is required'),
name: Yup.string().required(),
surname: Yup.string().required(),
})
const Register = () => {
@ -33,6 +34,7 @@ const Register = () => {
const signInUrl = ROUTES_ENUM.account.login
const { signUp } = useAuth()
const { translate } = useLocalization()
const [message, setMessage] = useState('')
const [error, setError] = useTimeOutMessage(10000)
@ -48,7 +50,7 @@ const Register = () => {
setError(result.message)
setMessage('')
} else {
setMessage('Success. Please confirm your account by clicking the link.')
setMessage(translate('::Abp.Account.Register.ResultMessage'))
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
setError('')
}
@ -59,8 +61,8 @@ const Register = () => {
return (
<>
<div className="mb-8">
<h3 className="mb-1">Sign Up</h3>
<p>And lets get started with your free trial</p>
<h3 className="mb-1">{translate('::Abp.Account.Register.Title')}</h3>
<p>{translate('::Abp.Account.Register.Message')}</p>
</div>
<div>
{message && (
@ -95,7 +97,7 @@ const Register = () => {
<Form>
<FormContainer>
<FormItem
label="Email"
label={translate('::Abp.Account.EmailAddress')}
invalid={errors.email && touched.email}
errorMessage={errors.email}
>
@ -103,36 +105,36 @@ const Register = () => {
type="email"
autoComplete="off"
name="email"
placeholder="Email"
placeholder={translate('::Abp.Account.EmailAddress')}
component={Input}
/>
</FormItem>
<FormItem
label="Password"
label={translate('::Abp.Account.Password')}
invalid={errors.password && touched.password}
errorMessage={errors.password}
>
<Field
autoComplete="off"
name="password"
placeholder="Password"
placeholder={translate('::Abp.Account.Password')}
component={PasswordInput}
/>
</FormItem>
<FormItem
label="Confirm Password"
label={translate('::Abp.Account.ConfirmPassword')}
invalid={errors.confirmPassword && touched.confirmPassword}
errorMessage={errors.confirmPassword}
>
<Field
autoComplete="off"
name="confirmPassword"
placeholder="Confirm Password"
placeholder={translate('::Abp.Account.ConfirmPassword')}
component={PasswordInput}
/>
</FormItem>
<FormItem
label="Name"
label={translate('::Abp.Identity.User.UserInformation.Name')}
invalid={errors.name && touched.name}
errorMessage={errors.name}
>
@ -140,12 +142,12 @@ const Register = () => {
type="name"
autoComplete="off"
name="name"
placeholder="Name"
placeholder={translate('::Abp.Identity.User.UserInformation.Name')}
component={Input}
/>
</FormItem>
<FormItem
label="Surname"
label={translate('::Abp.Identity.User.UserInformation.Surname')}
invalid={errors.surname && touched.surname}
errorMessage={errors.surname}
>
@ -153,7 +155,7 @@ const Register = () => {
type="surname"
autoComplete="off"
name="surname"
placeholder="Surname"
placeholder={translate('::Abp.Identity.User.UserInformation.Surname')}
component={Input}
/>
</FormItem>
@ -166,8 +168,8 @@ const Register = () => {
{isSubmitting ? 'Creating Account...' : 'Sign Up'}
</Button>
<div className="mt-4 text-center">
<span>Already have an account? </span>
<ActionLink to={signInUrl}>Sign in</ActionLink>
<span>{translate('::Abp.Account.Register.AlreadyHaveAnAccount')} </span>
<ActionLink to={signInUrl}>{translate('::Abp.Account.SignIn')}</ActionLink>
</div>
</FormContainer>
</Form>

View file

@ -5,6 +5,7 @@ import Button from '@/components/ui/Button'
import { FormContainer, FormItem } from '@/components/ui/Form'
import { ROUTES_ENUM } from '@/constants/route.constant'
import { resetPassword } from '@/proxy/account/account.service'
import { useLocalization } from '@/utils/hooks/useLocalization'
import useTimeOutMessage from '@/utils/hooks/useTimeOutMessage'
import type { AxiosError } from 'axios'
import { Field, Form, Formik } from 'formik'
@ -29,6 +30,7 @@ const ResetPassword = () => {
const [searchParams] = useSearchParams()
const userId = searchParams.get('userId')
const resetToken = searchParams.get('resetToken')
const { translate } = useLocalization()
// bu olmadan da oluyor sanırım
// const result = useQuery({
@ -78,13 +80,13 @@ const ResetPassword = () => {
<div className="mb-6">
{resetComplete ? (
<>
<h3 className="mb-1">Reset done</h3>
<p>Your password has been successfully reset</p>
<h3 className="mb-1">{translate('::Abp.Account.ResetPassword.ResetDone')}</h3>
<p>{translate('::Abp.Account.ResetPassword.ResetDone.Message')}</p>
</>
) : (
<>
<h3 className="mb-1">Set new password</h3>
<p>Your new password must different to previos password</p>
<h3 className="mb-1">{translate('::Abp.Account.ResetPassword.SetNewPassword')}</h3>
<p>{translate('::Abp.Account.ResetPassword.SetNewPassword.Message')}</p>
</>
)}
</div>
@ -113,26 +115,26 @@ const ResetPassword = () => {
{!resetComplete ? (
<>
<FormItem
label="Password"
label={translate('::Abp.Account.Password')}
invalid={errors.password && touched.password}
errorMessage={errors.password}
>
<Field
autoComplete="off"
name="password"
placeholder="Password"
placeholder={translate('::Abp.Account.Password')}
component={PasswordInput}
/>
</FormItem>
<FormItem
label="Confirm Password"
label={translate('::Abp.Identity.Password.ConfirmPassword')}
invalid={errors.confirmPassword && touched.confirmPassword}
errorMessage={errors.confirmPassword}
>
<Field
autoComplete="off"
name="confirmPassword"
placeholder="Confirm Password"
placeholder={translate('::Abp.Identity.Password.ConfirmPassword')}
component={PasswordInput}
/>
</FormItem>
@ -142,13 +144,13 @@ const ResetPassword = () => {
</>
) : (
<Button block variant="solid" type="button" onClick={onContinue}>
Continue
{translate('::Abp.Account.ResetPassword.Continue')}
</Button>
)}
<div className="mt-4 text-center">
<span>Back to </span>
<ActionLink to={signInUrl}>Sign in</ActionLink>
<span>{translate('::Abp.Account.Backto')} </span>
<ActionLink to={signInUrl}>{translate('::Abp.Account.SignIn')}</ActionLink>
</div>
</FormContainer>
</Form>

View file

@ -6,6 +6,7 @@ import { ActionLink } from '@/components/shared'
import { ROUTES_ENUM } from '@/constants/route.constant'
import { store } from '@/store'
import Captcha from '@/components/shared/Captcha'
import { useLocalization } from '@/utils/hooks/useLocalization'
type FormSchema = {
email: string
@ -13,12 +14,13 @@ type FormSchema = {
}
const validationSchema = Yup.object().shape({
email: Yup.string().required('Please enter your user email'),
email: Yup.string().required(),
captchaResponse: Yup.string().required(),
})
const SendConfirmationCode = () => {
const { userName } = store.getState().auth.user
const { translate } = useLocalization()
const { message, error, sendConfirmationCode } = useAccount()
@ -33,8 +35,8 @@ const SendConfirmationCode = () => {
return (
<>
<div className="mb-8">
<h3 className="mb-1">Confirm Email</h3>
<p>Please enter your email to receive new confirmation code</p>
<h3 className="mb-1">{translate('::Abp.Account.SendConfirmationCode')}</h3>
<p>{translate('::Abp.Account.SendConfirmationCode.Message')}</p>
</div>
<div>
{message && (
@ -61,7 +63,7 @@ const SendConfirmationCode = () => {
<Form>
<FormContainer>
<FormItem
label="Email"
label={translate('::Abp.Account.EmailAddress')}
invalid={errors.email && touched.email}
errorMessage={errors.email}
>
@ -69,7 +71,7 @@ const SendConfirmationCode = () => {
type="email"
autoComplete="off"
name="email"
placeholder="Email"
placeholder={translate('::Abp.Account.EmailAddress')}
component={Input}
/>
</FormItem>
@ -82,8 +84,8 @@ const SendConfirmationCode = () => {
{isSubmitting ? 'Sending code...' : 'Send Code'}
</Button>
<div className="mt-4 text-center">
<span>Back to </span>
<ActionLink to={ROUTES_ENUM.account.login}>Login</ActionLink>
<span>{translate('::Abp.Account.Backto')} </span>
<ActionLink to={ROUTES_ENUM.account.login}>{translate('::Abp.Account.SignIn')}</ActionLink>
</div>
</FormContainer>
</Form>

View file

@ -2,11 +2,13 @@ import { useQuery } from '@tanstack/react-query'
import { Alert, Button } from '@/components/ui'
import { useNavigate, useParams } from 'react-router-dom'
import useAccount from '@/utils/hooks/useAccount'
import { useLocalization } from '@/utils/hooks/useLocalization'
const VerifyConfirmationCode = () => {
const { userId, token } = useParams()
const { message, error, verifyConfirmationCode } = useAccount()
const navigate = useNavigate()
const { translate } = useLocalization()
useQuery({
queryKey: ['verifyConfirmationCode', userId, token],
@ -29,7 +31,7 @@ const VerifyConfirmationCode = () => {
{error}
</Alert>
<Button block variant="solid" onClick={() => navigate('/account/confirm')}>
Request New Confirmation Code
{translate('::Abp.Account.VerifyConfirmationCode')}
</Button>
</div>
)}