PHP code example of bab55z / laravel-locale-switcher
1. Go to this page and download the library: Download bab55z/laravel-locale-switcher library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bab55z / laravel-locale-switcher example snippets
'languages' => [
/**
* Key is the Laravel locale code
* Index 0 of sub-array is the Carbon locale code
* Index 1 of sub-array is the PHP locale code for setlocale()
* Index 2 of sub-array is whether or not to use RTL (right-to-left) css for this language
* Index 3 of sub-array is displayable name
*/
'en' => ['en', 'en_US', false, 'English'],
'de' => ['de', 'de_DE', false, 'Deutsch'],
'pl' => ['pl', 'pl_PL', false, 'Polski'],
'fr' => ['fr', 'fr_FR', false, 'Français'],
'es' => ['es', 'es_ES', false, 'Español'],
'it' => ['it', 'it_IT', false, 'Italiano'],
'pt' => ['pt_BR', 'pt_PT', false, 'Português'],
/*'ar' => ['ar', 'ar_AR', true, 'العربية'],
'da' => ['da', 'da_DK', false, 'Dansk'],
'sv' => ['sv', 'sv_SE', false, 'Svenska'],
'th' => ['th', 'th_TH', false, 'Thailändisch'],*/
],