PHP code example of xdroidteam / translation

1. Go to this page and download the library: Download xdroidteam/translation 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/ */

    

xdroidteam / translation example snippets


'XdroidTeam\Translation\TranslationServiceProvider',



return array(

    'route' => [
        'prefix' => 'custom-translations-route',
        'middleware' => [
            'web',
            'auth',
            'custom middleware',
        ],
    ],

	'exclude_groups' => ['auth', 'base'],
    
    'translation_model' => '\App\Models\Translation',

);




namespace App\Models;

use XdroidTeam\Translation\Translation as XdroidTranslation;

class Translation extends XdroidTranslation
{
    public static function getLanguages(){
        // original:
        // return explode(',', env('LANGUAGES'));
		
        //custom:
        return ['en', 'hu'];
    }
}


XdroidTeam\Translation::exportToCSV('path/to/file');
shell
php artisan vendor:publish --tag=xdroidteam-translation
shell
php artisan migrate