diff --git a/modules/system/lang/en/validation.php b/modules/system/lang/en/validation.php index e359ac1a9..93a81b984 100644 --- a/modules/system/lang/en/validation.php +++ b/modules/system/lang/en/validation.php @@ -140,6 +140,23 @@ return [ 'new_message' => 'New message', 'payment_reviewed' => 'Payment has been reviewed', 'product_reviewed' => 'Post has been reviewed', + 'api' => [ + 'sign_up_excp' => 'Registration error', + 'bank_services_unavailable' => 'Bank services are unavailable.', + 'online_payment_failed' => 'Online payment has been failed.', + 'bank_payment_saved' => 'The bank transfer payment saved. Admin will consider it and approve later.', + 'bank_payment_failed' => 'The bank transfer payment failed.', + // 'contact_message_sent' => 'Contact message has been sent', + 'cannot_verify_invalid_email' => 'Cannot verify. Invalid email address.', + 'verification_link_sent' => 'Verification link has been sent to your email. Log in to tmex.gov.tm before checking your email.', + 'email_already_verified' => 'You have already verified your email address.', + 'sms_sent' => 'SMS has been sent.', + 'sms_not_sent_error' => 'SMS has not been sent. Error.', + 'user_not_tm_resident' => 'This user is not a resident.', + 'phone_already_verified' => 'You have already verified your phone number.', + 'phone_verified_message' => 'Your phone number has been succesfully verified', + 'phone_verification_code_invalid' => 'Invalid sms code', + ], /* |-------------------------------------------------------------------------- diff --git a/modules/system/lang/ru/validation.php b/modules/system/lang/ru/validation.php index 0d985bdb8..bd4d90341 100644 --- a/modules/system/lang/ru/validation.php +++ b/modules/system/lang/ru/validation.php @@ -140,6 +140,23 @@ return [ 'new_message' => 'Новое сообщение', 'payment_reviewed' => 'Платеж рассмотрен', 'product_reviewed' => 'Объявление рассмотрено', + 'api' => [ + 'sign_up_excp' => 'Ошибка при регистрации', + 'bank_services_unavailable' => 'Службы банка недоступны.', + 'online_payment_failed' => 'Онлайн оплата не прошла.', + 'bank_payment_saved' => 'Оплата банковским переводом сохранена и позже будет проверена администратором.', + 'bank_payment_failed' => 'Оплата банковским переводом не прошла.', + // 'contact_message_sent' => 'Письмо отправлено.', + 'cannot_verify_invalid_email' => 'Верификация Email невозможна. Неверный Email', + 'verification_link_sent' => 'Ссылка для подтверждения отправлена на ваш Email. Авторизуйтесь на tmex.gov.tm перед проверкой Email.', + 'email_already_verified' => 'Вы уже подтвердили свой Email.', + 'sms_sent' => 'СМС отправлен.', + 'sms_not_sent_error' => 'СМС не отправлен. Ошибка.', + 'user_not_tm_resident' => 'Пользователь не является резидентом.', + 'phone_already_verified' => 'Номер телефона уже подтвержден.', + 'phone_verified_message' => 'Ваш номер телефона подтвержден', + 'phone_verification_code_invalid' => 'Неверный СМС код', + ], /* |-------------------------------------------------------------------------- diff --git a/modules/system/lang/tm/validation.php b/modules/system/lang/tm/validation.php index ff51eb1b1..dede076bd 100644 --- a/modules/system/lang/tm/validation.php +++ b/modules/system/lang/tm/validation.php @@ -142,6 +142,23 @@ return [ 'new_message' => 'Täze hat', 'payment_reviewed' => 'Töleg gözden geçirildi', 'product_reviewed' => 'Bildiriş gözden geçirildi', + 'api' => [ + 'sign_up_excp' => 'Hasaba alyş ýalňyşy', + 'bank_services_unavailable' => 'Bank hyzmatlary elýeterli däl.', + 'online_payment_failed' => 'Onlaýn töleg geçmedi.', + 'bank_payment_saved' => 'Bank üsti bilen töleg ýazyldy we soňra administrator tarapyndan gözden geçiriler.', + 'bank_payment_failed' => 'Bank üsti bilen töleg geçmedi.', + // 'contact_message_sent' => 'Hat ugradyldy.', + 'cannot_verify_invalid_email' => 'Tassyklama grçmedi. El. bukjaňyz nädogry.', + 'verification_link_sent' => 'Tassyklama düwmesi El. bukjaňyza iberildi. El. bukjaňyzy barlamazdan öň tmex.gov.tm-da şahsy hasabyňyza giriň.', + 'email_already_verified' => 'Siziň el. bukjaňyz eýýäm tassyklanan.', + 'sms_sent' => 'SMS iberildi.', + 'sms_not_sent_error' => 'SMS iberilmedi. Ýalňyş.', + 'user_not_tm_resident' => 'Ulanyjy ýerli ýaşaýjy däl.', + 'phone_already_verified' => 'Siziň telefon belgiňiz eýýäm tassyklanan.', + 'phone_verified_message' => 'Siziň telefon belgiňiz tassyklandy', + 'phone_verification_code_invalid' => 'Nädogry SMS kody', + ], /* |-------------------------------------------------------------------------- diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/EmailVerificationController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/EmailVerificationController.php index f80f103d3..a15fe171b 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/EmailVerificationController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/EmailVerificationController.php @@ -34,16 +34,16 @@ class EmailVerificationController extends KabinetAPIController } catch(Throwable $th) { \Log::info($th); - return response()->json('Cannot verify. Invalid email address.', 400); + return response()->json(trans('validation.api.cannot_verify_invalid_email', [], $inputData['locale']), 400); } $this->user->email_activation_code = $code; $this->user->save(); - return response()->json('Verification link has been sent. Log in to tmex.gov.tm before checking your email.', 201); + return response()->json(trans('validation.api.verification_link_sent', [], $inputData['locale']), 201); } else { - return response()->json('You have already verified your email address.', 200); + return response()->json(trans('validation.api.email_already_verified', [], $inputData['locale']), 200); } } } diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/SmsController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/SmsController.php index 4ff5ddf54..fd66f1dc5 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/SmsController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/SmsController.php @@ -30,12 +30,24 @@ class SmsController extends KabinetAPIController if($this->user->dial_code != '+993') { return response()->json([ 'dial_code' => $this->user->dial_code, - 'message' => 'This user is not a resident of Turkmenistan.' + 'result' => 1, + 'message' => [ + 'ru' => trans('validation.api.user_not_tm_resident', [], 'ru'), + 'en' => trans('validation.api.user_not_tm_resident', [], 'en'), + 'tm' => trans('validation.api.user_not_tm_resident', [], 'tm'), + ] ], 400); } if($this->user->phone_verified && $this->user->dial_code == '+993') { - return response()->json('User phone already verified', 200); + return response()->json([ + 'result' => 1, + 'message' => [ + 'ru' => trans('validation.api.phone_already_verified', [], 'ru'), + 'en' => trans('validation.api.phone_already_verified', [], 'en'), + 'tm' => trans('validation.api.phone_already_verified', [], 'tm'), + ] + ], 200); } $code = random_int(1000, 9999); @@ -49,21 +61,33 @@ class SmsController extends KabinetAPIController $this->user->save(); return response()->json([ 'result' => $result, - 'message' => 'Message has been succesfully sent' + 'message' => [ + 'ru' => trans('validation.api.sms_sent', [], 'ru'), + 'en' => trans('validation.api.sms_sent', [], 'en'), + 'tm' => trans('validation.api.sms_sent', [], 'tm'), + ] ], 201); break; case 1: return response()->json([ 'result' => $result, - 'message' => 'Error' + 'message' => [ + 'ru' => trans('validation.api.sms_not_sent_error', [], 'ru'), + 'en' => trans('validation.api.sms_not_sent_error', [], 'en'), + 'tm' => trans('validation.api.sms_not_sent_error', [], 'tm'), + ] ], 500); break; default: return response()->json([ 'result' => $result, - 'message' => 'Error' + 'message' => [ + 'ru' => trans('validation.api.sms_not_sent_error', [], 'ru'), + 'en' => trans('validation.api.sms_not_sent_error', [], 'en'), + 'tm' => trans('validation.api.sms_not_sent_error', [], 'tm'), + ] ], 500); break; } @@ -74,12 +98,24 @@ class SmsController extends KabinetAPIController if($this->user->dial_code != '+993') { return response()->json([ 'dial_code' => $this->user->dial_code, - 'message' => 'This user is not a resident of Turkmenistan.' + 'status' => false, + 'message' => [ + 'ru' => trans('validation.api.user_not_tm_resident', [], 'ru'), + 'en' => trans('validation.api.user_not_tm_resident', [], 'en'), + 'tm' => trans('validation.api.user_not_tm_resident', [], 'tm'), + ] ], 400); } if($this->user->phone_verified && $this->user->dial_code == '+993') { - return response()->json('User phone already verified', 200); + return response()->json([ + 'status' => false, + 'message' => [ + 'ru' => trans('validation.api.phone_already_verified', [], 'ru'), + 'en' => trans('validation.api.phone_already_verified', [], 'en'), + 'tm' => trans('validation.api.phone_already_verified', [], 'tm'), + ] + ], 200); } $validator = Validator::make($request->all(), [ @@ -93,9 +129,23 @@ class SmsController extends KabinetAPIController $this->user->phone_verified = true; $this->user->phone_activation_code = null; $this->user->save(); - return response()->json('User phone has been succesfully verified', 201); + return response()->json([ + 'status' => true, + 'message' => [ + 'ru' => trans('validation.api.phone_verified_message', [], 'ru'), + 'en' => trans('validation.api.phone_verified_message', [], 'en'), + 'tm' => trans('validation.api.phone_verified_message', [], 'tm'), + ] + ], 201); } else { - return response()->json('Wrong sms code', 400); + return response()->json([ + 'status' => false, + 'message' => [ + 'ru' => trans('validation.api.phone_verification_code_invalid', [], 'ru'), + 'en' => trans('validation.api.phone_verification_code_invalid', [], 'en'), + 'tm' => trans('validation.api.phone_verification_code_invalid', [], 'tm'), + ] + ], 400); } } } diff --git a/plugins/ahmadfatoni/apigenerator/controllers/api/TransactionsApiController.php b/plugins/ahmadfatoni/apigenerator/controllers/api/TransactionsApiController.php index eee69b20a..939d30bb2 100644 --- a/plugins/ahmadfatoni/apigenerator/controllers/api/TransactionsApiController.php +++ b/plugins/ahmadfatoni/apigenerator/controllers/api/TransactionsApiController.php @@ -68,14 +68,24 @@ class TransactionsApiController extends KabinetAPIController return response()->json(['formUrl' => $result['formUrl']], 200); } else { - return response()->json('bank services are unavailable', 200); + return response()->json(['error' => [ + 'ru' => trans('validation.api.bank_services_unavailable', [], 'ru'), + 'en' => trans('validation.api.bank_services_unavailable', [], 'en'), + 'tm' => trans('validation.api.bank_services_unavailable', [], 'tm'), + ]], 200); } } catch(\Throwable $th){ $payment->status = 'failed'; $payment->save(); - return response()->json(['message' => $th->getMessage()], 500); + Log::info($th->getMessage()); + + return response()->json(['error' => [ + 'ru' => trans('validation.api.online_payment_failed', [], 'ru'), + 'en' => trans('validation.api.online_payment_failed', [], 'en'), + 'tm' => trans('validation.api.online_payment_failed', [], 'tm'), + ]], 500); } } elseif($payment->payment_type == 'bank'){ @@ -84,9 +94,17 @@ class TransactionsApiController extends KabinetAPIController if($payment->save()){ Event::fire('tps.payment.received',$payment); - return response()->json('The payment saved. Admin will consider it and approve later', 200); + return response()->json(['success' => [ + 'ru' => trans('validation.api.bank_payment_saved', [], 'ru'), + 'en' => trans('validation.api.bank_payment_saved', [], 'en'), + 'tm' => trans('validation.api.bank_payment_saved', [], 'tm'), + ]], 200); } else { - return response()->json('The payment saving failed.', 500); + return response()->json(['error' => [ + 'ru' => trans('validation.api.bank_payment_failed', [], 'ru'), + 'en' => trans('validation.api.bank_payment_failed', [], 'en'), + 'tm' => trans('validation.api.bank_payment_failed', [], 'tm'), + ]], 500); } } diff --git a/plugins/rainlab/user/components/resetpassword/check.htm b/plugins/rainlab/user/components/resetpassword/check.htm index 49677d9eb..51a0d9889 100644 --- a/plugins/rainlab/user/components/resetpassword/check.htm +++ b/plugins/rainlab/user/components/resetpassword/check.htm @@ -1 +1,5 @@ -
{{ 'auth.password_reset_check'|_ }}
\ No newline at end of file +{{ 'auth.password_reset_complete'|_ }}
\ No newline at end of file +- {{ 'auth.password_reset_check_mail_message'|_ }} -
- -