PHP code example of dive-be / laravel-lingo

1. Go to this page and download the library: Download dive-be/laravel-lingo 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/ */

    

dive-be / laravel-lingo example snippets


return [
    'exclude' => [],
];

Lingo::make()
    ->parseFile('/path/to/translations.csv', 'nl')
    ->persist('nl');

Lingo::make()
    ->load('nl')
    ->parseFile('/path/to/translations.csv', 'nl')
    ->persist('nl');

Lingo::make()
    ->load('es')
    ->parseFile(
        filePath: '/path/to/translations.csv', 
        locales: 'es',
        replacingExistingValues: false,
    )
    ->persist('es');

Lingo::make()
    ->load($languages = ['en', 'nl', 'fr'])
    ->exportToCsvFile('path/to/output.csv', $languages);