How to switch language

With Laravel, this can be done easily in 2 steps:

1. First define in config/application.php in “languages” array all the languages your app supports.

2. Whenever you want a different language to be used (e.g. by validation errors) prepend to your url the language, for example if you want Arabic to be used instead of the default one (defined in config/application.php in “language”) on /user/add route change route to /ar/user/add

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s