Provides a new Angular JS filter which can access to Symfony 2 translations.
innova/angular-ui-translation-bundle is a Laravel package for provides a new angular js filter which can access to symfony 2 translations..
It currently has 1 GitHub stars and 1.694 downloads on Packagist (latest version 5.0.1).
Install it with composer require innova/angular-ui-translation-bundle.
Discover more Laravel packages by innova
or browse all Laravel packages to compare alternatives.
Last updated
Provides Symfony 2 translations into your AngularJS application.
$ composer require "innova/angular-ui-translation-bundle" "~5.0"
As BazingaExposeTranslation, the filter implements the Symfony2
TranslatorInterface
and provides the same trans() and transChoice() methods:
{{ 'translation_id' | trans:{}:'DOMAIN_NAME' }}
// the translated message or the translation id
{{ 'translation_id' | transChoice:1:{}:'DOMAIN_NAME' }}
// the translated message or the translation id
If you want to access translations for a specific domain, don't forget to include translation JS file.
Example using assetic :
{% javascripts 'js/translations/DOMAIN_NAME/*.js' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}