PHP code example of devaslanphp / auto-translate

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

    

devaslanphp / auto-translate example snippets


//...

'providers' => [
      // ...

      \Devaslanphp\AutoTranslate\AutoTranslateProvider::class,
],

// ...



return [

    /*
     * 
     * Locales managed by auto-translation package, will be used by the 
     * command "auto:translate" to generate a JSON file for each of this 
     * locales, and by the command "translate:missing" to generate their
     * missing translations
     * 
     */
    'locales' => [
        'fr',
        'ar'
    ],

    /*
     * 
     * The base locale to use when using the command "translate:missing" to
     * generate missing translations for other JSON files
     * 
     */
    'base_locale' => 'fr'

];
shell
php artisan vendor:publish --tag=auto-translate-config
shell
php artisan auto:translate
shell
php artisan translate:missing