Stars: 307
Forks: 86
Pull Requests: 306
Issues: 178
Watchers: 16
Last Updated: 2022-11-24 22:24:13
Symfony integration for Translations
License: MIT License
Languages: PHP, CSS, JavaScript, Makefile, Twig
Symfony integration for PHP Translation
Install this bundle via Composer:
$ composer require php-translation/symfony-bundle
If you're using Symfony Flex - you're done! Symfony Flex will create default configuration for you, change it if needed. If you don't use Symfony Flex, you will need to do a few more simple steps.
# config/bundles.php
return [
// ...
Translation\Bundle\TranslationBundle::class => ['all' => true],
];
# config/packages/php_translation.yaml
translation:
locales: ["en"]
edit_in_place:
enabled: false
config_name: app
configs:
app:
dirs: ["%kernel.project_dir%/templates", "%kernel.project_dir%/src"]
output_dir: "%kernel.project_dir%/translations"
excluded_names: ["*TestCase.php", "*Test.php"]
excluded_dirs: [cache, data, logs]
# config/packages/dev/php_translation.yaml
translation:
symfony_profiler:
enabled: true
webui:
enabled: true
# config/routes/dev/php_translation.yaml
_translation_webui:
resource: '@TranslationBundle/Resources/config/routing_webui.yaml'
prefix: /admin
_translation_profiler:
resource: '@TranslationBundle/Resources/config/routing_symfony_profiler.yaml'
# config/routes/php_translation.yaml
_translation_edit_in_place:
resource: '@TranslationBundle/Resources/config/routing_edit_in_place.yaml'
prefix: /admin
Read the full documentation at https://php-translation.readthedocs.io.