7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Laravel-Lang/publisherでLaravelを日本語対応する

Last updated at Posted at 2022-07-28

Laravel-Lang/publisherとは

Laravel-Lang/langを使用しLaravelの多言語対応を簡単に行えるパッケージです。
詳細についてはLaravel-Lang/publisherを参照して下さい。

環境

  • PHP 8.1.1
  • Composer version 2.3.10
  • Laravel Framework 9.22.1

手順

  1. laravel-lang/publisherとlaravel-lang/langをインストールします。

    composer require laravel-lang/publisher laravel-lang/lang --dev
    
  2. langフォルダ配下にjaフォルダとja.jsonを作成します

    php artisan lang:add ja
    
  3. config/app.phpを編集

    'locale' => 'ja',
    

これで日本語化されているはずです。

あとがき

現在Laravel-Lang/langでは78もの言語が翻訳されているそうです。
こんなに簡単に多言語対応させていただけるのは素晴らしいですね。

参考文献

Laravel-Lang/lang
Laravel-Lang/publisher

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?