diff --git a/app/Http/Controllers/OAuth/BaseController.php b/app/Http/Controllers/OAuth/BaseController.php index 5b04d4bd..f5bb3614 100644 --- a/app/Http/Controllers/OAuth/BaseController.php +++ b/app/Http/Controllers/OAuth/BaseController.php @@ -42,7 +42,7 @@ class BaseController extends Controller return $this->login($type, $info); } - return redirect()->route('login')->withErrors('第三方登录失败!'); + return redirect()->route('login')->withErrors(trans('auth.oauth.login_failed')); } private function bind(string $type, $user, $info) @@ -52,12 +52,12 @@ class BaseController extends Controller if ($auth) { $user->userAuths()->whereType($type)->update($data); - return redirect()->route('profile')->with('successMsg', '重新绑定成功'); + return redirect()->route('profile')->with('successMsg', trans('auth.oauth.rebind_success')); } $user->userAuths()->create($data); - return redirect()->route('profile')->with('successMsg', '绑定成功'); + return redirect()->route('profile')->with('successMsg', trans('auth.oauth.bind_success')); } private function login(string $type, $info) @@ -84,10 +84,10 @@ class BaseController extends Controller { $user = Auth::user(); if ($user && $user->userAuths()->whereType($type)->delete()) { - return redirect()->route('profile')->with('successMsg', '解绑成功'); + return redirect()->route('profile')->with('successMsg', trans('auth.oauth.unbind_success')); } - return redirect()->route('profile')->with('successMsg', '解绑失败'); + return redirect()->route('profile')->with('successMsg', trans('auth.oauth.unbind_failed')); } public function binding($type) @@ -101,10 +101,10 @@ class BaseController extends Controller return $this->bind($type, $user, $info); } - return redirect()->route('profile')->withErrors('绑定失败'); + return redirect()->route('profile')->withErrors(trans('auth.oauth.bind_failed')); } - return redirect()->route('login')->withErrors('第三方登录失败!'); + return redirect()->route('login')->withErrors(trans('auth.oauth.login_failed')); } public function logining($type) @@ -115,7 +115,7 @@ class BaseController extends Controller return $this->login($type, $info); } - return redirect()->route('login')->withErrors('第三方登录失败!'); + return redirect()->route('login')->withErrors(trans('auth.oauth.login_failed')); } public function register($type) @@ -143,13 +143,13 @@ class BaseController extends Controller return redirect()->route('login'); } - return redirect()->route('register')->withErrors('注册失败'); + return redirect()->route('register')->withErrors(trans('auth.oauth.register_failed')); } } - return redirect()->route('login')->withErrors('已注册,请直接登录'); + return redirect()->route('login')->withErrors(trans('auth.oauth.registered')); } - return redirect()->route('login')->withErrors('第三方登录失败!'); + return redirect()->route('login')->withErrors(trans('auth.oauth.login_failed')); } } diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index eab049d4..ae6ab25d 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -43,6 +43,17 @@ return [ 'logout' => 'Logout', 'maintenance' => 'Maintain', 'maintenance_tip' => 'Website under maintenance', + 'oauth' => [ + 'bind_success' => 'Binding success', + 'bind_failed' => 'Binding failed', + 'login_failed' => 'Sign in failed!', + 'register' => 'Quick registration', + 'registered' => 'Already registered, please login directly', + 'register_failed' => 'Registration failed', + 'rebind_success' => 'Rebinding success', + 'unbind_success' => 'Unbinding success', + 'unbind_failed' => 'Unbinding failed', + ], 'optional' => 'Optional', 'password' => [ 'forget' => 'Forgot password?', @@ -75,6 +86,5 @@ return [ ], 'remember_me' => 'Remember me', 'request' => 'Request', - 'sign_in_with' => 'Sign in with :app', 'tos' => 'Terms of Service', ]; diff --git a/resources/lang/en/user.php b/resources/lang/en/user.php index 2bf0848a..2f01c042 100644 --- a/resources/lang/en/user.php +++ b/resources/lang/en/user.php @@ -72,10 +72,18 @@ return [ 'nodes' => 'Node', 'referrals' => 'Affiliates', 'shop' => 'Shop', + 'profile' => 'Settings', 'tickets' => 'Ticket', - 'admin_dashboard' => 'Admin Dashboard', + 'admin_dashboard' => 'Dashboard', ], 'contact' => 'Contact Info', + 'oauth' => [ + 'bind_title' => 'Binding Your Social Accounts', + 'not_bind' => 'Not Yet Bound', + 'bind' => 'Bind', + 'rebind' => 'Rebind', + 'unbind' => 'Unbind', + ], 'coupon' => [ 'attribute' => 'Coupon', 'voucher' => 'Voucher', @@ -128,7 +136,6 @@ return [ 'payment_method' => 'payment method', 'pay' => 'Pay', 'input_coupon' => 'Please enter the gift code', - 'user_profile' => 'Account settings', 'recharge' => 'Pay', 'recharge_credit' => 'Add Funds', 'recharging' => 'Paying ...', diff --git a/resources/lang/zh_CN/auth.php b/resources/lang/zh_CN/auth.php index 48843201..790b3d37 100644 --- a/resources/lang/zh_CN/auth.php +++ b/resources/lang/zh_CN/auth.php @@ -40,6 +40,17 @@ return [ 'logout' => '登 出', 'maintenance' => '维护', 'maintenance_tip' => '网站维护中', + 'oauth' => [ + 'bind_success' => '绑定成功', + 'bind_failed' => '绑定失败', + 'login_failed' => '第三方登录失败!', + 'register' => '快速注册', + 'registered' => '已注册,请直接登录', + 'register_failed' => '注册失败', + 'rebind_success' => '重新绑定成功', + 'unbind_success' => '解绑成功', + 'unbind_failed' => '解绑失败', + ], 'optional' => '可选', 'password' => [ 'forget' => '忘记密码?', @@ -69,6 +80,5 @@ return [ ], 'remember_me' => '记住我', 'request' => '获 取', - 'sign_in_with' => ':app账号登录', 'tos' => '用户条款', ]; diff --git a/resources/lang/zh_CN/user.php b/resources/lang/zh_CN/user.php index badc2dee..9d9a13ec 100644 --- a/resources/lang/zh_CN/user.php +++ b/resources/lang/zh_CN/user.php @@ -57,11 +57,11 @@ return [ 'purchase_required' => '本功能对非付费用户禁用!请', 'more' => '更多', 'attribute' => [ - 'node' => '线路', - 'data' => '流量', - 'ip' => 'IP地址', - 'isp' => '运营商', - 'address' => '地区', + 'node' => '线路', + 'data' => '流量', + 'ip' => 'IP地址', + 'isp' => '运营商', + 'address' => '地区', ], 'purchase_promotion' => '快 来 购 买 服 务 吧!', 'menu' => [ @@ -72,10 +72,18 @@ return [ 'nodes' => '线 路', 'referrals' => '推 广', 'shop' => '服 务', + 'profile' => '设 置', 'tickets' => '工 单', - 'admin_dashboard' => '管理面板', + 'admin_dashboard' => '管 理', ], 'contact' => '联系方式', + 'oauth' => [ + 'bind_title' => '绑定社交账号', + 'not_bind' => '尚未绑定', + 'bind' => '绑 定', + 'rebind' => '重新绑定', + 'unbind' => '解 绑', + ], 'coupon' => [ 'attribute' => '优惠券', 'voucher' => '代金券', @@ -128,7 +136,6 @@ return [ 'payment_method' => '支付方式', 'pay' => '支付', 'input_coupon' => '请输入充值券码', - 'user_profile' => '个人设置', 'recharge' => '充值', 'recharge_credit' => '余额充值', 'recharging' => '充值中...', diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 14611b67..bbc644f0 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -102,7 +102,7 @@ @if(sysConfig('is_register') && sysConfig('oauth_path'))
- 快速注册 + {{trans('auth.oauth.register')}}
@foreach (json_decode(sysConfig('oauth_path')) as $item) @if ($item !== 'telegram') diff --git a/resources/views/user/layouts.blade.php b/resources/views/user/layouts.blade.php index 5419c8b9..07a97689 100644 --- a/resources/views/user/layouts.blade.php +++ b/resources/views/user/layouts.blade.php @@ -66,13 +66,13 @@
diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index 07361693..65e450ac 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -34,7 +34,7 @@ @if(sysConfig('oauth_path'))
- 绑定社交账号 + {{trans('user.oauth.bind_title')}}
@foreach (json_decode(sysConfig('oauth_path')) as $item) @@ -42,16 +42,16 @@ @if($item !== 'telegram') href="{{route('oauth.route', ['type' => $item, 'action' => 'binding'])}}" @endif> {{config('common.oauth.labels')[$item]}} : @if(in_array($item, $auth)) - 重新绑定 + {{trans('user.oauth.rebind')}} @else - 未绑定 + {{trans('user.oauth.not_bind')}} @endif @if($item === 'telegram') {!! Socialite::driver('telegram')->getButton() !!} @endif @if(in_array($item, $auth)) - 解绑 + {{trans('user.oauth.unbind')}} @endif @endforeach