PHPackages                             wickedone/phrase-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. wickedone/phrase-translation-provider

ActiveSymfony-translation-bridge

wickedone/phrase-translation-provider
=====================================

symfony phrase translation provider bridge

3.0.0(5mo ago)23.4k[1 issues](https://github.com/wickedOne/phrase-translation-provider/issues)MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Dec 28Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/wickedOne/phrase-translation-provider)[ Packagist](https://packagist.org/packages/wickedone/phrase-translation-provider)[ GitHub Sponsors](https://github.com/wickedOne)[ RSS](/packages/wickedone-phrase-translation-provider/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (13)Versions (14)Used By (0)

phrase-translation-provider
===========================

[](#phrase-translation-provider)

symfony phrase translation provider bridge

[![infection](https://camo.githubusercontent.com/bd53905883e1934c9219922bff318355cba0fdd4e28f041d840e24f7e65cdf4f/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532467769636b65644f6e652532467068726173652d7472616e736c6174696f6e2d70726f76696465722532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/wickedOne/phrase-translation-provider/master)[![codecov](https://camo.githubusercontent.com/280d108f089fd70bfa57aa644f2dc9f946cdc22bebe565500358edef037b7bdd/68747470733a2f2f636f6465636f762e696f2f67682f7769636b65644f6e652f7068726173652d7472616e736c6174696f6e2d70726f76696465722f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d55484b41564755525037)](https://codecov.io/gh/wickedOne/phrase-translation-provider)[![stable](https://camo.githubusercontent.com/0a46b1f51a7a133622d2f35db37c878093458470578346f046fa17533df2d416/68747470733a2f2f706f7365722e707567782e6f72672f7769636b65646f6e652f7068726173652d7472616e736c6174696f6e2d70726f76696465722f76)](https://packagist.org/packages/wickedone/phrase-translation-provider)[![downloads](https://camo.githubusercontent.com/0c3605bab45a099fdfedc952f2d1d6f2fb8f82d00be559ac21592e8b079574b5/68747470733a2f2f706f7365722e707567782e6f72672f7769636b65646f6e652f7068726173652d7472616e736c6174696f6e2d70726f76696465722f646f776e6c6f616473)](https://packagist.org/packages/wickedone/phrase-translation-provider)[![license](https://camo.githubusercontent.com/58f7b9ed364354952fb8c70f114f334c34a7c15b139ca5c7eae1373b4962f0c9/68747470733a2f2f706f7365722e707567782e6f72672f7769636b65646f6e652f7068726173652d7472616e736c6174696f6e2d70726f76696465722f6c6963656e7365)](https://packagist.org/packages/wickedone/phrase-translation-provider)[![php](https://camo.githubusercontent.com/ee8b5aef58d89cf9ceb165a5197b68f6bcb0d661272de3741b4c23aa893068d2/68747470733a2f2f706f7365722e707567782e6f72672f7769636b65646f6e652f7068726173652d7472616e736c6174696f6e2d70726f76696465722f726571756972652f706870)](https://packagist.org/packages/wickedone/phrase-translation-provider)

> ⚠️ this translation provider [has been integrated](https://github.com/symfony/phrase-translation-provider) into symfony starting at version 6.4. this repository will be archived once [lts expires](https://symfony.com/releases/5.4) for symfony 5.4

installation
------------

[](#installation)

```
composer require wickedone/phrase-translation-provider
```

dsn example
-----------

[](#dsn-example)

```
PHRASE_DSN=phrase://PROJECT_ID:API_TOKEN@default?userAgent=myProject
```

### dsn elements

[](#dsn-elements)

- `PROJECT_ID`: can be retrieved in phrase from `project settings > API > Project ID`
- `API_TOKEN`: can be created in your [phrase profile settings](https://app.phrase.com/settings/oauth_access_tokens)
- `default`: endpoint, defaults to `api.phrase.com`

### required dsn query parameters

[](#required-dsn-query-parameters)

- `userAgent`: please read [this](https://developers.phrase.com/api/#overview--identification-via-user-agent) for some examples.

see [fine tuning your phrase api calls](#fine-tuning-your-phrase-api-calls) for additional dsn options

service phrase provider
-----------------------

[](#service-phrase-provider)

in your `services.yaml` add the following to enable the phrase provider.

```
Symfony\Component\Translation\Bridge\Phrase\PhraseProviderFactory:
    tags: ['translation.provider_factory']
    arguments:
        $defaultLocale: '%kernel.default_locale%'
        $loader: '@translation.loader.xliff'
        $xliffFileDumper: '@translation.dumper.xliff'
        $cache: '@cache.app'
```

and in your `translations.yaml` you can add:

```
framework:
    translator:
        providers:
            phrase:
                dsn: '%env(PHRASE_DSN)%'
                domains: ~
                locales: ~
```

phrase locale names
-------------------

[](#phrase-locale-names)

translations being imported using the symfony xlf format in phrase, locales are matched on locale name in phrase. therefor it's necessary the locale names should be as defined in [RFC4646](https://www.ietf.org/rfc/rfc4646.txt) (e.g. pt-BR rather than pt\_BR). not doing so will result in phrase creating a new locale for the imported keys.

locale creation
---------------

[](#locale-creation)

if you define a locale in your `translation.yaml` which is not configured in your phrase project, it will be automatically created. deletion of locales however, is (currently) not managed by this provider.

domains as tags
---------------

[](#domains-as-tags)

translations will be tagged in phrase with the symfony translation domain they belong to. check the [wickedone/phrase-tag-bundle](https://github.com/wickedOne/phrase-tag-bundle) if you need help managing your tags in phrase

cache
-----

[](#cache)

the read responses from phrase are cached to speed up the read and delete method of this provider. therefor the factory should be initialised with a PSR-6 compatible cache adapter.

events
------

[](#events)

to enable you to perform post-processing on translation values and / or keys, two events are dispatched by this provider class.

### PhraseReadEvent

[](#phrasereadevent)

*after* reading the catalogue from phrase, the resulting `TranslatorBag` is dispatched in a `PhraseReadEvent` prior to being returned from the read method.

### PhraseWriteEvent

[](#phrasewriteevent)

*before* writing the catalogue to phrase, the `TranslatorBag` is dispatched in a `PhraseWriteEvent`.

fine tuning your phrase api calls
---------------------------------

[](#fine-tuning-your-phrase-api-calls)

you can fine tune the read and write methods of this provider by adding query parameters to your dsn configuration. general usage is `read|write[option_name]=value`

**example:** `phrase://PROJECT_ID:API_TOKEN@default?read[encoding]=UTF-8&write[update_descriptions]=0`

see tables below for available options and, if applicable, their default values.

### read

[](#read)

in order to read translations from phrase the [download locale](https://developers.phrase.com/api/#get-/projects/-project_id-/locales/-id-/download) call is made to the phrase api. this call provides the following options.

nametypedefault valuecomment`branch`string`include_empty_translations`bool1`exclude_empty_zero_forms`bool`include_translated_keys`bool`keep_notranslate_tags`bool`format_options`arrayenclose\_in\_cdata`encoding`string`skip_unverified_translations`bool`include_unverified_translations`bool`use_last_reviewed_version`bool`fallback_locale_enabled`bool0when the fallback locale is enabled, caching responses from phrase will be disabled### write

[](#write)

in order to write translations to phrase the [upload](https://developers.phrase.com/api/#post-/projects/-project_id-/uploads) call is made to the phrase api. this call provides the following options.

nametypedefault valuecomment`update_translations`bool1`update_descriptions`bool`skip_upload_tags`bool`skip_unverification`bool`file_encoding`string`locale_mapping`array`format_options`array`autotranslate`bool`mark_reviewed`bool

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance72

Regular maintenance activity

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

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

###  Release Activity

Cadence

Every ~133 days

Recently: every ~186 days

Total

9

Last Release

164d ago

Major Versions

1.2.0 → 2.0.02025-03-09

2.0.0 → 3.0.02025-11-29

PHP version history (5 changes)1.0.0PHP ~8.1.0 || ~8.2.0

1.1.0PHP ~8.2.0 || ~8.3.0

1.2.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0

2.0.0PHP ~8.3.0 || ~8.4.0

3.0.0PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

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

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (777 commits)")[![wickedOne](https://avatars.githubusercontent.com/u/343850?v=4)](https://github.com/wickedOne "wickedOne (56 commits)")

---

Tags

phrasesymfonytranslation-providers

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wickedone-phrase-translation-provider/health.svg)

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

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

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