blackwoodseven/translation

Improved Translation Service Provider.

2.1.1 2016-10-11 11:30 UTC

This package is not auto-updated.

Last update: 2024-04-13 16:45:55 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') %}