Skip to content

Commit 1aba879

Browse files
chore: added i18n to auth pages
1 parent 69af2d0 commit 1aba879

File tree

10 files changed

+196
-59
lines changed

10 files changed

+196
-59
lines changed

lang/en/auth.php

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,74 @@
2222
'welcome_trial' => 'Welcome to TryPost! Your trial has started.',
2323
],
2424

25+
'login' => [
26+
'title' => 'Log in to your account',
27+
'description' => 'Enter your email and password below to log in',
28+
'page_title' => 'Log in',
29+
'email' => 'Email address',
30+
'password' => 'Password',
31+
'forgot_password' => 'Forgot password?',
32+
'remember_me' => 'Remember me',
33+
'submit' => 'Log in',
34+
'no_account' => "Don't have an account?",
35+
'sign_up' => 'Sign up',
36+
],
37+
38+
'register' => [
39+
'title' => 'Create an account',
40+
'description' => 'Enter your details below to create your account',
41+
'page_title' => 'Register',
42+
'name' => 'Name',
43+
'name_placeholder' => 'Full name',
44+
'email' => 'Email address',
45+
'password' => 'Password',
46+
'submit' => 'Create account',
47+
'has_account' => 'Already have an account?',
48+
'log_in' => 'Log in',
49+
],
50+
51+
'forgot_password' => [
52+
'title' => 'Forgot password',
53+
'description' => 'Enter your email to receive a password reset link',
54+
'page_title' => 'Forgot password',
55+
'email' => 'Email address',
56+
'submit' => 'Email password reset link',
57+
'return_to' => 'Or, return to',
58+
'log_in' => 'log in',
59+
],
60+
61+
'reset_password' => [
62+
'title' => 'Reset password',
63+
'description' => 'Please enter your new password below',
64+
'page_title' => 'Reset password',
65+
'email' => 'Email',
66+
'password' => 'Password',
67+
'confirm_password' => 'Confirm Password',
68+
'confirm_placeholder' => 'Confirm password',
69+
'submit' => 'Reset password',
70+
],
71+
72+
'verify_email' => [
73+
'title' => 'Verify email',
74+
'description' => 'Please verify your email address by clicking on the link we just emailed to you.',
75+
'page_title' => 'Email verification',
76+
'link_sent' => 'A new verification link has been sent to the email address you provided during registration.',
77+
'resend' => 'Resend verification email',
78+
'log_out' => 'Log out',
79+
],
80+
81+
'accept_invite' => [
82+
'page_title' => 'Accept Invite',
83+
'title' => "You've been invited!",
84+
'description' => "You've been invited to join the :workspace workspace.",
85+
'workspace' => 'Workspace',
86+
'your_role' => 'Your role',
87+
'email' => 'Email',
88+
'accept' => 'Accept Invite',
89+
'decline' => 'Decline Invite',
90+
'login_prompt' => 'Log in or create an account to accept this invite.',
91+
'log_in' => 'Log in',
92+
'create_account' => 'Create Account',
93+
],
94+
2595
];

lang/php_en.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lang/php_pt-BR.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lang/pt-BR/auth.php

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,74 @@
2222
'welcome_trial' => 'Bem-vindo ao TryPost! Seu período de teste começou.',
2323
],
2424

25+
'login' => [
26+
'title' => 'Entrar na sua conta',
27+
'description' => 'Digite seu email e senha abaixo para entrar',
28+
'page_title' => 'Entrar',
29+
'email' => 'Endereço de email',
30+
'password' => 'Senha',
31+
'forgot_password' => 'Esqueceu a senha?',
32+
'remember_me' => 'Lembrar de mim',
33+
'submit' => 'Entrar',
34+
'no_account' => 'Não tem uma conta?',
35+
'sign_up' => 'Cadastre-se',
36+
],
37+
38+
'register' => [
39+
'title' => 'Criar uma conta',
40+
'description' => 'Digite seus dados abaixo para criar sua conta',
41+
'page_title' => 'Cadastro',
42+
'name' => 'Nome',
43+
'name_placeholder' => 'Nome completo',
44+
'email' => 'Endereço de email',
45+
'password' => 'Senha',
46+
'submit' => 'Criar conta',
47+
'has_account' => 'Já tem uma conta?',
48+
'log_in' => 'Entrar',
49+
],
50+
51+
'forgot_password' => [
52+
'title' => 'Esqueceu a senha',
53+
'description' => 'Digite seu email para receber um link de redefinição de senha',
54+
'page_title' => 'Esqueceu a senha',
55+
'email' => 'Endereço de email',
56+
'submit' => 'Enviar link de redefinição',
57+
'return_to' => 'Ou, volte para',
58+
'log_in' => 'entrar',
59+
],
60+
61+
'reset_password' => [
62+
'title' => 'Redefinir senha',
63+
'description' => 'Por favor, digite sua nova senha abaixo',
64+
'page_title' => 'Redefinir senha',
65+
'email' => 'Email',
66+
'password' => 'Senha',
67+
'confirm_password' => 'Confirmar Senha',
68+
'confirm_placeholder' => 'Confirmar senha',
69+
'submit' => 'Redefinir senha',
70+
],
71+
72+
'verify_email' => [
73+
'title' => 'Verificar email',
74+
'description' => 'Por favor, verifique seu endereço de email clicando no link que acabamos de enviar.',
75+
'page_title' => 'Verificação de email',
76+
'link_sent' => 'Um novo link de verificação foi enviado para o endereço de email que você forneceu durante o cadastro.',
77+
'resend' => 'Reenviar email de verificação',
78+
'log_out' => 'Sair',
79+
],
80+
81+
'accept_invite' => [
82+
'page_title' => 'Aceitar Convite',
83+
'title' => 'Você foi convidado!',
84+
'description' => 'Você foi convidado para participar do workspace :workspace.',
85+
'workspace' => 'Workspace',
86+
'your_role' => 'Seu cargo',
87+
'email' => 'Email',
88+
'accept' => 'Aceitar Convite',
89+
'decline' => 'Recusar Convite',
90+
'login_prompt' => 'Entre ou crie uma conta para aceitar este convite.',
91+
'log_in' => 'Entrar',
92+
'create_account' => 'Criar Conta',
93+
],
94+
2595
];

resources/js/pages/auth/AcceptInvite.vue

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const inviteUrl = computed(() => `/invites/${props.invite.id}`);
3333
<template>
3434
<div class="flex min-h-svh flex-col items-center justify-center gap-6 bg-background p-6 md:p-10">
3535

36-
<Head title="Accept Invite" />
36+
<Head :title="$t('auth.accept_invite.page_title')" />
3737

3838
<div class="w-full max-w-md">
3939
<div class="flex flex-col gap-8">
@@ -46,25 +46,23 @@ const inviteUrl = computed(() => `/invites/${props.invite.id}`);
4646

4747
<Card>
4848
<CardHeader class="text-center">
49-
<CardTitle class="text-xl">You've been invited!</CardTitle>
49+
<CardTitle class="text-xl">{{ $t('auth.accept_invite.title') }}</CardTitle>
5050
<CardDescription>
51-
You've been invited to join the
52-
<span class="font-medium text-foreground">{{ invite.workspace.name }}</span>
53-
workspace.
51+
{{ $t('auth.accept_invite.description', { workspace: invite.workspace.name }) }}
5452
</CardDescription>
5553
</CardHeader>
5654
<CardContent class="space-y-6">
5755
<div class="rounded-lg bg-muted p-4 space-y-2">
5856
<div class="flex justify-between text-sm">
59-
<span class="text-muted-foreground">Workspace</span>
57+
<span class="text-muted-foreground">{{ $t('auth.accept_invite.workspace') }}</span>
6058
<span class="font-medium">{{ invite.workspace.name }}</span>
6159
</div>
6260
<div class="flex justify-between text-sm">
63-
<span class="text-muted-foreground">Your role</span>
61+
<span class="text-muted-foreground">{{ $t('auth.accept_invite.your_role') }}</span>
6462
<span class="font-medium">{{ invite.role.label }}</span>
6563
</div>
6664
<div class="flex justify-between text-sm">
67-
<span class="text-muted-foreground">Email</span>
65+
<span class="text-muted-foreground">{{ $t('auth.accept_invite.email') }}</span>
6866
<span class="font-medium">{{ invite.email }}</span>
6967
</div>
7068
</div>
@@ -73,29 +71,29 @@ const inviteUrl = computed(() => `/invites/${props.invite.id}`);
7371
<div v-if="isLoggedIn" class="flex flex-col gap-3">
7472
<Button as-child size="lg" class="w-full">
7573
<Link :href="accept.url(invite.id)" method="post">
76-
Accept Invite
74+
{{ $t('auth.accept_invite.accept') }}
7775
</Link>
7876
</Button>
7977
<Button as-child variant="outline" size="lg" class="w-full">
8078
<Link :href="decline.url(invite.id)" method="post">
81-
Decline Invite
79+
{{ $t('auth.accept_invite.decline') }}
8280
</Link>
8381
</Button>
8482
</div>
8583

8684
<!-- User is not logged in - show Login/Register -->
8785
<div v-else class="flex flex-col gap-3">
8886
<p class="text-center text-sm text-muted-foreground">
89-
Log in or create an account to accept this invite.
87+
{{ $t('auth.accept_invite.login_prompt') }}
9088
</p>
9189
<Button as-child size="lg" class="w-full">
9290
<Link :href="login({ query: { redirect: inviteUrl } })">
93-
Log in
91+
{{ $t('auth.accept_invite.log_in') }}
9492
</Link>
9593
</Button>
9694
<Button as-child variant="outline" size="lg" class="w-full">
9795
<Link :href="register({ query: { redirect: inviteUrl } })">
98-
Create Account
96+
{{ $t('auth.accept_invite.create_account') }}
9997
</Link>
10098
</Button>
10199
</div>

resources/js/pages/auth/ForgotPassword.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ defineProps<{
1818

1919
<template>
2020
<AuthLayout
21-
title="Forgot password"
22-
description="Enter your email to receive a password reset link"
21+
:title="$t('auth.forgot_password.title')"
22+
:description="$t('auth.forgot_password.description')"
2323
>
24-
<Head title="Forgot password" />
24+
<Head :title="$t('auth.forgot_password.page_title')" />
2525

2626
<div
2727
v-if="status"
@@ -33,7 +33,7 @@ defineProps<{
3333
<div class="space-y-6">
3434
<Form v-bind="email.form()" v-slot="{ errors, processing }">
3535
<div class="grid gap-2">
36-
<Label for="email">Email address</Label>
36+
<Label for="email">{{ $t('auth.forgot_password.email') }}</Label>
3737
<Input
3838
id="email"
3939
type="email"
@@ -52,14 +52,14 @@ defineProps<{
5252
data-test="email-password-reset-link-button"
5353
>
5454
<Spinner v-if="processing" />
55-
Email password reset link
55+
{{ $t('auth.forgot_password.submit') }}
5656
</Button>
5757
</div>
5858
</Form>
5959

6060
<div class="space-x-1 text-center text-sm text-muted-foreground">
61-
<span>Or, return to</span>
62-
<TextLink :href="login()">log in</TextLink>
61+
<span>{{ $t('auth.forgot_password.return_to') }}</span>
62+
<TextLink :href="login()">{{ $t('auth.forgot_password.log_in') }}</TextLink>
6363
</div>
6464
</div>
6565
</AuthLayout>

resources/js/pages/auth/Login.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ defineProps<{
2121
</script>
2222

2323
<template>
24-
<AuthBase title="Log in to your account" description="Enter your email and password below to log in">
24+
<AuthBase :title="$t('auth.login.title')" :description="$t('auth.login.description')">
2525

26-
<Head title="Log in" />
26+
<Head :title="$t('auth.login.page_title')" />
2727

2828
<div v-if="status" class="mb-4 text-center text-sm font-medium text-green-600">
2929
{{ status }}
@@ -34,40 +34,40 @@ defineProps<{
3434
<input v-if="redirect" type="hidden" name="redirect" :value="redirect" />
3535
<div class="grid gap-6">
3636
<div class="grid gap-2">
37-
<Label for="email">Email address</Label>
37+
<Label for="email">{{ $t('auth.login.email') }}</Label>
3838
<Input id="email" type="email" name="email" required autofocus :tabindex="1" autocomplete="email"
3939
placeholder="[email protected]" :default-value="email ?? ''" />
4040
<InputError :message="errors.email" />
4141
</div>
4242

4343
<div class="grid gap-2">
4444
<div class="flex items-center justify-between">
45-
<Label for="password">Password</Label>
45+
<Label for="password">{{ $t('auth.login.password') }}</Label>
4646
<TextLink :href="request()" class="text-sm" :tabindex="5">
47-
Forgot password?
47+
{{ $t('auth.login.forgot_password') }}
4848
</TextLink>
4949
</div>
5050
<Input id="password" type="password" name="password" required :tabindex="2"
51-
autocomplete="current-password" placeholder="Password" />
51+
autocomplete="current-password" :placeholder="$t('auth.login.password')" />
5252
<InputError :message="errors.password" />
5353
</div>
5454

5555
<div class="flex items-center justify-between">
5656
<Label for="remember" class="flex items-center space-x-3">
5757
<Checkbox id="remember" name="remember" :tabindex="3" />
58-
<span>Remember me</span>
58+
<span>{{ $t('auth.login.remember_me') }}</span>
5959
</Label>
6060
</div>
6161

6262
<Button type="submit" class="mt-4 w-full" :tabindex="4" :disabled="processing" data-test="login-button">
6363
<Spinner v-if="processing" />
64-
Log in
64+
{{ $t('auth.login.submit') }}
6565
</Button>
6666
</div>
6767

6868
<div class="text-center text-sm text-muted-foreground">
69-
Don't have an account?
70-
<TextLink :href="register()" :tabindex="5">Sign up</TextLink>
69+
{{ $t('auth.login.no_account') }}
70+
<TextLink :href="register()" :tabindex="5">{{ $t('auth.login.sign_up') }}</TextLink>
7171
</div>
7272
</Form>
7373
</AuthBase>

0 commit comments

Comments
 (0)