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

Fix: remove unnecessary comma from email template #6

Merged
merged 4 commits into from
Oct 28, 2022
Merged
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
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/askdkc/breezejp/Fix%20PHP%20code%20style%20issues?label=code%20style)](https://github.com/askdkc/breezejp/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/askdkc/breezejp.svg?style=flat-square)](https://packagist.org/packages/askdkc/breezejp)

このパッケージはLaravel Breezeを日本語化するパッケージです。
Laravel Breezeをインストールした後に最初にインストールしてください。
後からインストールすると既存の言語ファイルを上書きするため、ご自身の修正が消えてしまう場合があります
このパッケージはLaravel Breezeを日本語化するパッケージです。<br>
Laravel Breezeをインストールした後にインストールしてください。<br>
翻訳ファイルをLaravelの`lang`ディレクトリ配下に出力して日本語化していますので、詳しくはこのREADMEの[日本語のカスタマイズ](#日本語のカスタマイズ)をご確認願います

## インストール

Expand Down Expand Up @@ -83,11 +83,14 @@ http://localhost:8000/ にアクセス
## 日本語のカスタマイズ
言語ファイルは下記ディレクトリに出力されていますので、こちらのファイルの中身を修正することで自由にカスタマイズ可能です
```
/lang/ja.json ← Breezeの各画面の日本語ファイル / メール通知の翻訳もこちら
/lang/ja/auth.php ← 認証画面の警告メッセージの日本語ファイル
/lang/ja/pagination.php ← ページ送りの日本語ファイル
/lang/ja/auth.php ← 認証画面のパスワード関係の日本語ファイル
/lang/ja/validation.php ← 各種バリデーションの日本語ファイル
.
└─ lang
├── ja.json ← Breezeの各画面の日本語ファイル / メール通知の翻訳もこちら
└─ ja
├── auth.php ← 認証画面の警告メッセージの日本語ファイル
├── pagination.php ← ページ送りの日本語ファイル
├── auth.php ← 認証画面のパスワード関係の日本語ファイル
└── validation.php ← 各種バリデーションの日本語ファイル
```

## テスト方法
Expand Down
29 changes: 29 additions & 0 deletions src/BreezejpServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
namespace Askdkc\Breezejp;

use Askdkc\Breezejp\Commands\BreezejpCommand;
use Illuminate\Auth\Notifications\ResetPassword;
use Illuminate\Auth\Notifications\VerifyEmail;
use Illuminate\Notifications\Messages\MailMessage;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

Expand All @@ -19,4 +22,30 @@ public function configurePackage(Package $package): void
->name('breezejp')
->hasCommand(BreezejpCommand::class);
}

public function boot()
{
ResetPassword::toMailUsing(function ($notifiable, $token) {
return (new MailMessage)
->subject(__('Reset Password Notification'))
->line(__('You are receiving this email because we received a password reset request for your account.'))
->action(__('Reset Password'), route('password.reset', $token))
->line(__('This password reset link will expire in :count minutes.', ['count' => config('auth.passwords.'.config('auth.defaults.passwords').'.expire')]))
->line(__('If you did not request a password reset, no further action is required.'))
->line(__('Regards'))
->salutation(\config('app.name'));
});

VerifyEmail::toMailUsing(function ($notifiable, $url) {
return (new MailMessage)
->subject(__('Verify Email Address'))
->line(__('Please click the button below to verify your email address.'))
->action(__('Verify Email Address'), $url)
->line(__('If you did not create an account, no further action is required.'))
->line(__('Regards'))
->salutation(__(\config('app.name')));
});

return parent::boot();
}
}
2 changes: 1 addition & 1 deletion src/Commands/BreezejpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class BreezejpCommand extends Command
{
public $signature = 'breezejp';

public $description = 'My command';
public $description = 'Add Japanese Translation files for Laravel Breeze';

public function handle(): int
{
Expand Down