PHPackages                             laasti/symfony-translation-provider - 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. [Localization &amp; i18n](/categories/localization)
4. /
5. laasti/symfony-translation-provider

ActiveLibrary[Localization &amp; i18n](/categories/localization)

laasti/symfony-translation-provider
===================================

A league/container v2 service provider for Symfony's translation component.

v2.0.1(10y ago)1335[1 PRs](https://github.com/laasti/symfony-translation-provider/pulls)1MITPHP

Since Aug 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/laasti/symfony-translation-provider)[ Packagist](https://packagist.org/packages/laasti/symfony-translation-provider)[ RSS](/packages/laasti-symfony-translation-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (1)

Laasti/symfony-translation-provider
===================================

[](#laastisymfony-translation-provider)

A league/container v2 service provider for Symfony's translation component.

Installation
------------

[](#installation)

```
composer require laasti/symfony-translation-provider

```

Usage
-----

[](#usage)

```
$container = new League\Container\Container;
$container->addServiceProvider('Laasti\SymfonyTranslationProvider\SymfonyTranslationProvider');

$container->add('config.translation', [
    //Two-letter or four-letter locales are accepted
    'locale' => 'en',
    //When a message is not found in the locale, look in those too
    'fallback_locales' => ['en'],
    'message_selector_class' => 'Symfony\Component\Translation\MessageSelector',
    //Symfony's package offers many different loaders
    'loaders' => [
        'array' => 'Symfony\Component\Translation\Loader\ArrayLoader',
        'json' => 'Symfony\Component\Translation\Loader\JsonFileLoader'
    ],
    'resources' => [
        'en' => [
            //The first item is the loader to use, the second the resource the loader will use
            ['array', ['hello_world' => 'Hello']]
            //The third item in array is the resource's domain
            //Sseful to namespace messages, defaults to messages
            ['json', 'my-json-file.json', 'forms']
        ]
    ],
]);

$translator = $container->get('Symfony\Component\Translation\Translator');

$translator->trans('hello_world); //returns "Hello"
```

Contributing
------------

[](#contributing)

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

History
-------

[](#history)

See Github's releases, or tags

Credits
-------

[](#credits)

Author: Sonia Marquette (@nebulousGirl)

License
-------

[](#license)

Released under the MIT License. See LICENSE.txt file.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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.

###  Release Activity

Cadence

Every ~58 days

Total

5

Last Release

3680d ago

Major Versions

v1.1.1 → v2.0.02016-02-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/48bb7fdba3e642d3dc668b9ff03ff949b9043f58096f3c85c13de508b53e7d68?d=identicon)[nebulousGirl](/maintainers/nebulousGirl)

---

Top Contributors

[![nebulousGirl](https://avatars.githubusercontent.com/u/1899256?v=4)](https://github.com/nebulousGirl "nebulousGirl (6 commits)")[![bjdelange](https://avatars.githubusercontent.com/u/2757512?v=4)](https://github.com/bjdelange "bjdelange (1 commits)")

### Embed Badge

![Health badge](/badges/laasti-symfony-translation-provider/health.svg)

```
[![Health](https://phpackages.com/badges/laasti-symfony-translation-provider/health.svg)](https://phpackages.com/packages/laasti-symfony-translation-provider)
```

###  Alternatives

[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

177661.4M4.8k](/packages/nesbot-carbon)[willdurand/js-translation-bundle

A pretty nice way to expose your translation messages to your JavaScript.

58917.1M55](/packages/willdurand-js-translation-bundle)[lexik/translation-bundle

This bundle allows to import translation files content into the database and provide a GUI to edit translations.

4362.7M19](/packages/lexik-translation-bundle)[jms/translation-bundle

Puts the Symfony Translation Component on steroids

42510.8M63](/packages/jms-translation-bundle)[php-translation/symfony-bundle

3244.1M9](/packages/php-translation-symfony-bundle)[php-translation/common

Common translation stuff

934.3M6](/packages/php-translation-common)

PHPackages © 2026

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