Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic localization #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Composer.json file should not be updated.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only need to add description about the localization in doc. The readme file is the doc for this package. Thanks.

"name": "anam/captcha",
"name": "turanzamanli/captcha",
"description": "reCAPTCHA and invisible reCAPTCHA for Laravel. reCAPTCHA protects your app against spam and bot.",
"keywords": [
"Laravel Captcha",
Expand All @@ -11,12 +11,12 @@
"Captcha"
],
"type": "library",
"homepage": "https://github.com/anam-hossain/captcha",
"homepage": "https://github.com/turanzamanli/captcha",
"license": "MIT",
"authors": [
{
"name": "Anam Hossain",
"email": "enam33@gmail.com"
"name": "Turan Zamanli",
"email": "turanzamanli@gmail.com"
}
],
"require": {
Expand All @@ -25,12 +25,12 @@
},
"autoload": {
"psr-4": {
"Anam\\Captcha\\" : "src/"
"Turanzamanli\\Captcha\\" : "src/"
}
},
"autoload-dev": {
"psr-4": {
"Anam\\Captcha\\Tests\\": "tests/"
"Turanzamanli\\Captcha\\Tests\\": "tests/"
}
},
"require-dev": {
Expand All @@ -41,10 +41,10 @@
"extra": {
"laravel": {
"providers": [
"Anam\\Captcha\\ServiceProvider\\CaptchaServiceProvider"
"Turanzamanli\\Captcha\\ServiceProvider\\CaptchaServiceProvider"
],
"aliases": {
"Captcha": "Anam\\Captcha\\Facade\\Captcha"
"Captcha": "Turanzamanli\\Captcha\\Facade\\Captcha"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceProvider/CaptchaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public function boot()

$siteKey = $this->loadSiteKey($siteKey);

return "<script src='https://www.google.com/recaptcha/api.js' async defer></script>".
return "<script src='https://www.google.com/recaptcha/api.js?hl=".config('app.locale', 'en')."' async defer></script>".
"<div class='g-recaptcha' data-sitekey='{$siteKey}'></div>";
});

Blade::directive('invisiblecaptcha', function ($siteKey = null) {

$siteKey = $this->loadSiteKey($siteKey);

return "<script src='https://www.google.com/recaptcha/api.js'></script>".
return "<script src='https://www.google.com/recaptcha/api.js?hl=".config('app.locale', 'en')."'></script>".
"<script>
function onSubmit(token) {
document.forms[0].submit();
Expand Down