blackwoodseven/translation

Improved Translation Service Provider.

This package's canonical repository appears to be gone and the package has been frozen as a result.

2.1.1 2016-10-11 11:30 UTC

This package is not auto-updated.

Last update: 2024-12-07 20:22:54 UTC


README

To install the BlackwoodSeven translation library in your project using Composer:

composer require blackwoodseven/translation

Configuration

$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'],
]);

Usage

$app['formatter.date']($date, 'my_date_format');
{% mydate|formatDate('my_date_format') %}