PHPackages                             undf/angular-utrans - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. undf/angular-utrans

ActiveSymfony-bundle

undf/angular-utrans
===================

Symfony2 and AngularJS module for client side translations

1101PHP

Since Sep 20Pushed 12y ago2 watchersCompare

[ Source](https://github.com/guilleferrer/AngularTranslatorBundle)[ Packagist](https://packagist.org/packages/undf/angular-utrans)[ RSS](/packages/undf-angular-utrans/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

AngularTransBundle
==================

[](#angulartransbundle)

The AngularTranslator Bundle ( Symfony2 ) provides a translator in the client side. This translator can be accessed via an angular filter or a service.

Install
=======

[](#install)

Include the Bundle from packagist in your composer.json file:

```
require: { "undf/angular-utrans": "dev-master" }

```

Include the javascript :

```
  @UndfAngularTransBundle/Resources/public/js/services/uTrans.js
```

Pass a json with all the exposed message keys that will feed your translator from a certain Catalogue.

Just include the twig function, in the first argument and the name of the catalogue Domain in the second argument.

```
  {{ utrans_expose_translations('NameOfTheCatalogueYouWantToExpose', 'locale') }}
```

*utrans\_expose\_translations* reads the Catalogue "NameOfTheCatalogueYouWantToExpose", using the "translator" service and creates a { json object } which exposes all the translations to the client side. So, you don't have to worry about creating this configuration, the Twig function does it for you. This is what the twig helper will do for you:

```

                    angular.module("uTrans").value("translations", {
                            "key-to-translate" : "Translated String"
           });

```

This bundle uses an Angular Module called "uTrans"
Don't forget to include this module as a dependency of your AngularJS application.

Example:
```html

...

```

```
// You must add the uTrans module in your app's dependencies
angular.module('mainModule', [ 'ng', 'uTrans' , '...' ]);
```

Usage
=====

[](#usage)

from a \*.html.twig file:

```
{% raw %}

  {{ 'key_to_translate' | trans  }}

{# Note that the curly braces are a string that will be interpreted by angularJS #}

{% endraw %}
```

if you need to pass parameters pass them with a placeholder %myVariable%

```
  {{ 'key_to_translate' | trans: { '%myVariable%' : javascriptVar }  }}
```

You can also use the uTrans Service and allow AngularJS to inject the service for you, wherever you need it:

```
angular.module('aModule', [ 'uTrans' ]).
    factory('aService', function( uTrans ){
    //  uTrans is the service injected by Angular I will use in my 'aService';

        var foo = 'bar';
        var message = uTrans.trans('myKey', { '%param%' : foo })
        alert( message );

});
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/990622?v=4)[guilleferrer](/maintainers/guilleferrer)[@guilleferrer](https://github.com/guilleferrer)

---

Top Contributors

[![guilleferrer](https://avatars.githubusercontent.com/u/990622?v=4)](https://github.com/guilleferrer "guilleferrer (24 commits)")[![danidelalin](https://avatars.githubusercontent.com/u/1449678?v=4)](https://github.com/danidelalin "danidelalin (2 commits)")

### Embed Badge

![Health badge](/badges/undf-angular-utrans/health.svg)

```
[![Health](https://phpackages.com/badges/undf-angular-utrans/health.svg)](https://phpackages.com/packages/undf-angular-utrans)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
