PHPackages                             68publishers/translation-bridge - 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. 68publishers/translation-bridge

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

68publishers/translation-bridge
===============================

Bridges between integrations of translation component and '68publishers bundles.

v2.1.0(1y ago)03.3k↓47.5%6MITPHPPHP ^8.1

Since Nov 15Pushed 1y ago1 watchersCompare

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

READMEChangelog (9)Dependencies (11)Versions (11)Used By (6)

Translation bridge
==================

[](#translation-bridge)

[![Checks](https://camo.githubusercontent.com/9db949b83897e548d40933fd0a49932b55942560c98f030a02c7ab22e949b142/68747470733a2f2f62616467656e2e6e65742f6769746875622f636865636b732f36387075626c6973686572732f7472616e736c6174696f6e2d6272696467652f6d6173746572)](https://github.com/68publishers/translation-bridge/actions)[![Coverage Status](https://camo.githubusercontent.com/7b261dbe834474602ddf786c75cdedb498ec8e56dd0f136e8a6b0e032011bab0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f36387075626c6973686572732f7472616e736c6174696f6e2d6272696467652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/68publishers/translation-bridge?branch=master)[![Total Downloads](https://camo.githubusercontent.com/9c8288278c795603c81ddd1ee83c5ff7a6ba0e7714c5ef57edb1f90d8b90e4db/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f64742f36387075626c6973686572732f7472616e736c6174696f6e2d627269646765)](https://packagist.org/packages/68publishers/translation-bridge)[![Latest Version](https://camo.githubusercontent.com/06976c239e25f71a79d8f115edcf72a7f0b8bbc4d4237045b18440df11d6dee0/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f36387075626c6973686572732f7472616e736c6174696f6e2d627269646765)](https://packagist.org/packages/68publishers/translation-bridge)[![PHP Version](https://camo.githubusercontent.com/facffe933a28a7a0973a93ccee14997770fa7e83d61b42b55cbb8ac3996eced9/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f36387075626c6973686572732f7472616e736c6174696f6e2d627269646765)](https://packagist.org/packages/68publishers/translation-bridge)

About
-----

[](#about)

The package contains bridges for the following integrations of [symfomy/translation](https://symfony.com/doc/current/translation.html) into [Nette Framework](https://nette.org):

- [contributte/translations](https://github.com/contributte/translation)

Why? Because we want to keep our bundles independent of specific integrations so applications can use any of the integrations mentioned above and will be still compatible with our bundles.

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

[](#installation)

The best way to install 68publishers/translation-bridge is using Composer:

```
$ composer require 68publishers/translation-bridge
```

Configuration
-------------

[](#configuration)

```
extensions:
    # if you are using contributte/translation:
    translation_bridge: SixtyEightPublishers\TranslationBridge\Bridge\Nette\DI\ContributteTranslationBridgeExtension
```

Usage
-----

[](#usage)

### Translation Resources Provider

[](#translation-resources-provider)

Extensions can provide paths with translation resources.

```
use Nette\DI\CompilerExtension;
use SixtyEightPublishers\TranslationBridge\Bridge\Nette\DI\TranslationProviderInterface;

final class MyBundleExtension extends CompilerExtension implements TranslationProviderInterface
{
    public function getTranslationResources(): array
    {
        return [
            __DIR__ . '/translations',
        ];
    }
}
```

### Translator Aware

[](#translator-aware)

All services that implement an interface `TranslatorAwareInterface` will automatically receive the Translator instance.

```
