Home > PHP Framework > Laravel > About Laravel form validation prompt setting multi-language

About Laravel form validation prompt setting multi-language

藏色散人
Release: 2020-08-17 16:03:17
forward
2708 people have browsed it

The following tutorial column from Laravel will introduce you to setting up multi-language Laravel form validation prompts. I hope it will be helpful to friends in need!

About Laravel form validation prompt setting multi-language

#The default form prompt is in English. We can install language packs to build a multi-language environment.

Select commands based on version

For Laravel 7.x : run composer require caouecs/laravel-lang:~6.0 
For Laravel 6.x : run composer require caouecs/laravel-lang:~5.0 
For Laravel 5.8 : run composer require caouecs/laravel-lang:~4.0 
For Laravel 5.1-5.7 : run composer require caouecs/laravel-lang:~3.0
For Laravel 5 : run composer require caouecs/laravel-lang:~2.0
Copy after login

The extension includes most languages, and the language packs are located in the vendor/caouecs/larvel-lang/src directory.

Copy the language pack to the resources/lang directory as needed.

Modify the config/app.php configuration file

'locale' => 'zh-CN',
Copy after login

The above is the detailed content of About Laravel form validation prompt setting multi-language. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:wjcms
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template