PHP code example of tobimori / kirby-trawl

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

    

tobimori / kirby-trawl example snippets


return [
  'tobimori.trawl' => [
    'sourceLanguage' => 'en',        // Source language for extraction (leave empty to output just keys)
    'languages' => ['de', 'en']      // Languages to validate
  ],
];



use Kirby\Data\Json;

return [
  'code' => 'de',
  'default' => true,
  'direction' => 'ltr',
  'locale' => [
    'LC_ALL' => 'de_DE'
  ],
  'name' => 'Deutsch',
  'translations' => Json::read(__DIR__ . '/../translations/de.json'),
  'url' => ''
];
bash
php kirby trawl:extract --output=site/translations/en.json --format=json