Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit c48ff46

Browse files
authored
refactor: better localization and clean up of hardcoded text (#10)
1 parent 5ca4cee commit c48ff46

34 files changed

+356
-145
lines changed

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,58 @@ return [
4242
```
4343

4444
**Note:** If you use the `username_alt` setting, you need to ensure that your users table has that column.
45+
46+
6. Register databags in your `AppServiceProvider` that are used by the auth pages
47+
48+
```php
49+
use Konceiver\DataBags\DataBag;
50+
51+
...
52+
53+
public function boot()
54+
{
55+
...
56+
57+
$this->registerDataBags();
58+
}
59+
60+
private function registerDataBags(): void
61+
{
62+
DataBag::register('fortify-content', [
63+
'register' => [
64+
'pageTitle' => '',
65+
'title' => '',
66+
'description' => '',
67+
],
68+
'login' => [
69+
'pageTitle' => '',
70+
'title' => '',
71+
'description' => '',
72+
],
73+
'password' => [
74+
'reset' => [
75+
'pageTitle' => '',
76+
],
77+
'request' => [
78+
'pageTitle' => '',
79+
],
80+
],
81+
'verification' => [
82+
'notice' => [
83+
'pageTitle' => '',
84+
],
85+
'verify' => [
86+
'pageTitle' => '',
87+
],
88+
'send' => [
89+
'pageTitle' => '',
90+
],
91+
],
92+
'two-factor' => [
93+
'login' => [
94+
'pageTitle' => '',
95+
],
96+
],
97+
]);
98+
}
99+
```

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"jenssegers/agent": "^2.6",
1818
"arkecosystem/ui": "^1.0",
1919
"spatie/laravel-personal-data-export": "^1.3",
20-
"spatie/laravel-medialibrary": "^8.9"
20+
"spatie/laravel-medialibrary": "^8.9",
21+
"konceiver/laravel-data-bags": "^1.1"
2122
},
2223
"autoload": {
2324
"psr-4": {

composer.lock

Lines changed: 74 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/lang/en/actions.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
<?php
22

33
return [
4-
5-
'disable' => 'Disable',
6-
'enable' => 'Enable',
7-
'export_personal_data' => 'Export Personal Data',
8-
'understand' => 'I Understand',
9-
'update' => 'Update',
10-
'select_timezone' => 'Select Timezone',
4+
'disable' => 'Disable',
5+
'enable' => 'Enable',
6+
'export_personal_data' => 'Export Personal Data',
7+
'understand' => 'I Understand',
8+
'update' => 'Update',
9+
'select_timezone' => 'Select Timezone',
10+
'sign_in' => 'Sign In',
11+
'reset_password' => 'Reset Password',
12+
'use_recovery_code' => 'Use a recovery code',
13+
'use_authentication_code' => 'Use an authentication code',
14+
'verify' => 'Verify',
15+
'delete_account' => 'Delete Account',
16+
'nevermind' => 'Nevermind',
17+
'done' => 'Done',
18+
'confirm_logout' => 'Logout Other Browser Sessions',
1119
];

resources/lang/en/auth.php

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
<?php
22

33
return [
4+
'confirm-password' => [
5+
'page_header' => 'Confirm Password',
6+
],
7+
8+
'forgot-password' => [
9+
'page_header' => 'Password Reset Email',
10+
'reset_link' => 'Send Password Reset Link',
11+
],
12+
13+
'sign-in' => [
14+
'forgot_password' => 'Forgot password?',
15+
'register_now' => 'Not a member? <a href=":route" class="link">Sign up now</a>',
16+
],
17+
18+
'register-form' => [
19+
'conditions' => "Creating an account means you're okay with our <a href=':termsOfServiceRoute' class='link'>Terms of Service</a> and <a href=':privacyPolicyRoute' class='link'>Privacy Policy</a>.",
20+
'create_account' => 'Create Account',
21+
'already_member' => 'Already a member? <a href=":route" class="link">Sign in</a>',
22+
],
23+
24+
'register' => [
25+
'page_header' => 'Sign Up',
26+
],
27+
28+
'reset-password' => [
29+
'page_header' => 'Reset Password',
30+
],
31+
32+
'two-factor' => [
33+
'page_header' => 'Two-Factor Authentication',
34+
],
435

536
'verified' => [
637
'page_header' => 'Congratulations!',
@@ -13,5 +44,4 @@
1344
'link_description' => 'A verification link has been sent to your email address.',
1445
'resend_verification' => 'Before proceeding, please check your email for a verification link. If you did not receive the email, <button type="submit" class="link">click here to request another</button>.',
1546
],
16-
1747
];

resources/lang/en/forms.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
return [
4-
54
'confirm_password' => 'Confirm Password',
65
'current_password' => 'Current Password',
76
'email_address' => 'Email Address',
@@ -10,16 +9,37 @@
109
'new_password' => 'New Password',
1110
'password' => 'Password',
1211
'username' => 'Username',
12+
'code' => 'Code',
13+
'recovery_code' => 'Recovery Code',
1314

14-
'update_password' => [
15+
'update-password' => [
1516
'requirements_notice' => 'Password must be 12–128 characters, and include a number, a symbol, a lower and an upper case letter.',
1617
],
1718

18-
'password_rules' => [
19+
'password-rules' => [
1920
'needs_lowercase' => 'One lowercase character',
2021
'needs_uppercase' => 'One uppercase character',
2122
'needs_numeric' => 'One number',
2223
'needs_special_character' => 'One special character',
2324
'needs_minimum_length' => '12 characters minumum',
2425
],
26+
27+
'delete-user' => [
28+
'title' => 'Delete Account',
29+
'description' => 'Permanently delete your account.',
30+
'content' => 'Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.',
31+
'confirmation' => 'Are you sure you want to delete your account? Once your account is deleted, all of its resources and data will be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.',
32+
],
33+
34+
'logout-sessions' => [
35+
'title' => 'Browser Sessions',
36+
'description' => 'Manage and logout your active sessions on other browsers and devices.',
37+
'content' => 'If necessary, you may logout of all of your other browser sessions across all of your devices. If you feel your account has been compromised, you should also update your password',
38+
'confirm_logout' => 'Logout Other Browser Sessions',
39+
],
40+
41+
'confirming-logout' => [
42+
'title' => 'Logout Other Browser Sessions',
43+
'content' => 'Please enter your password to confirm you would like to logout of your other browser sessions across all of your devices.',
44+
],
2545
];

resources/lang/en/generic.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
return [
4+
'this_device' => 'This Device',
5+
'last_active' => 'Last Active',
6+
];

resources/lang/en/menu.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?php
22

33
return [
4-
54
'2fa' => 'Two Factor Authentication',
6-
'password-reset-email' => 'Password Reset Email',
5+
'password_reset_email' => 'Password Reset Email',
76
'register' => 'Register',
8-
'reset-password' => 'Reset Password',
9-
'sign-in' => 'Sign In to MarketSquare',
10-
'sign-up' => 'Sign Up to MarketSquare',
7+
'reset_password' => 'Reset Password',
8+
'sign_in' => 'Sign In to MarketSquare',
9+
'sign_up' => 'Sign Up to MarketSquare',
1110
'verify' => 'Verify Email',
12-
11+
'home' => 'Home',
1312
];

resources/lang/en/messages.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
'invalid_2fa_authentication_code' => 'The provided two factor authentication code was invalid',
5+
];

resources/lang/en/metatags.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
<?php
22

33
return [
4-
5-
'reset-password' => 'Reset Password',
4+
'reset_password' => 'Reset Password',
65
'login' => 'Login',
76
'register' => 'Register',
8-
'login-with-two-factor' => 'Login With Two Factor',
7+
'login_with_two_factor' => 'Login With Two Factor',
98
'verify' => 'Verify',
10-
119
];

0 commit comments

Comments
 (0)