PHP code example of nobox / lazy-strings

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

    

nobox / lazy-strings example snippets


$lazyStrings = new LazyStrings([
    'url' => 'http://docs.google.com/spreadsheets/d/1V_cHt5Fe4x9XwVepvlXB39sqKXD3xs_QbM-NppkrE4A/export?format=csv',
    'sheets' => [
        'en' => 0,
    ],
    'target' => 'path/to/strings/folder',
    'backup' => 'path/to/strings/folder',
    'nested' => true
]);

$lazyStrings->generate();

'url' => 'http://docs.google.com/spreadsheets/d/1V_cHt5Fe4x9XwVepvlXB39sqKXD3xs_QbM-NppkrE4A/export?format=csv'

'sheets' => [
    'en' => [0, 1626663029],
    'es' => 1329731586,
    'pt' => 1443604037
]

'target' => 'path/to/strings/folder'

'backup' => 'path/to/strings/folder'

'nested' => true

 return array (
    'title' => 'Your page title',
    'tagline' => 'Your page tagline',
    'laravel' => 'PHP Framework',
    'header' => array (
        'hero' => array (
            'headline' => 'Hero headlines',
            'subject' => 'Main hero subject',
        ),
    ),
);

 return array (
    'title' => 'Your page title',
    'tagline' => 'Your page tagline',
    'laravel' => 'PHP Framework',
    'header.hero.headline' => 'Hero headlines',
    'header.hero.subject' => 'Main hero subject',
);

$locale = 'en';
$strings =  Returns "Your page title"

├── folder/
│   ├── en/
│   │   ├── lazy.php
│   ├── es/
│   │   ├── lazy.php
│   ├── pt/
│   │   ├── lazy.php