herrera-io / silex-translation-files
This package is abandoned and no longer maintained.
No replacement package was suggested.
A Silex service provider for using translation files.
1.1.0
2013-08-15 20:25 UTC
Requires
- php: >=5.3.3
- silex/silex: ~1.0
- symfony/config: ~2.3
- symfony/translation: ~2.3
Requires (Dev)
- herrera-io/go: ~2.0
- herrera-io/phpunit-test-case: ~1.0
- phpunit/phpunit: ~3.7
Suggests
- symfony/yaml: For loading YAML translation files.
This package is not auto-updated.
Last update: 2021-12-07 01:37:24 UTC
README
This is a Silex service provider that extends the existing Translation service in order to more easily support the use of translation files. You can specify the loader, the files, and the locales all as a parameter.
Example
use Herrera\Silex\Provider\TranslationServiceProvider; use Silex\Application; $app = new Application(); $app->register( new TranslationServiceProvider(), array( 'translation.files' => array( 'Symfony\\Component\\Translation\\Loader\\YamlFileLoader' => array( '/path/to/file.de.yml' => 'de', '/path/to/file.en.yml' => 'en', '/path/to/file.fr.yml' => 'fr' ) ) ) ); $translated = $app['translator']->trans($key);
Installation
Use Composer:
$ composer.phar require "herrera-io/silex-translation-files=~1.0"