PHP code example of blackwoodseven / translation

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

    

blackwoodseven / translation example snippets



$app->register(new \Silex\Provider\TranslationServiceProvider(), [
    'locale_fallbacks' => ['en'],
    'locale' => 'en',
]);

$app->register(new \BlackwoodSeven\Translation\TranslationServiceProvider(), [
    'translation.path' => __DIR__ . '/locale',
    'translation.contexts' => ['mycontext1', 'mycontext2'],
    'translation.locales' => ['en', 'de'],
]);

$app['formatter.date']($date, 'my_date_format');