PHPackages                             becklyn/translations - 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. becklyn/translations

ActiveSymfony-bundle[Localization &amp; i18n](/categories/localization)

becklyn/translations
====================

A bundle that extracts translations

1.3.0(4y ago)112.3k↓36.4%BSD-3-ClausePHPPHP &gt;=7.4

Since Jul 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Becklyn/translations-bundle)[ Packagist](https://packagist.org/packages/becklyn/translations)[ Docs](https://github.com/Becklyn/translations-bundle)[ RSS](/packages/becklyn-translations/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (12)Used By (0)

Becklyn Translations Bundle
===========================

[](#becklyn-translations-bundle)

This bundle provides several helpers for working with translations.

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

[](#installation)

First install this package:

```
composer require becklyn/translations
```

Then import the routing:

```
_import.becklyn_translations:
    resource: '@BecklynTranslationsBundle/Resources/config/routes.yaml'
    prefix: /_v/translations/
```

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

[](#configuration)

```
becklyn_translations:
    extract:
        frontend:
            messages:
                - test
                - abc.*
            backend:
                - *.error
        admin:
            messages:
                - admin.test.*

    cache_version: 1
```

The `extract` key defines which messages from which domain need to be extracted and dumped for usage in JavaScript. It is a nested array, where the first level key is the namespace (more on that below). The second level key is the translation domain and the values are the message keys. You can use `*` as a placeholder for the message keys.

The dumped JavaScript is cached. If somehow the cache is busted, you can manually invalidate the cache by bumping the `cache_version`.

Namespaces
----------

[](#namespaces)

The translations dumps are separated into namespaces, so that there can be for example one dump for frontend translations and one for the backend translations. The namespaces are just labels and are passed to the init function (see the next chapter).

JS Dumper + Loader
------------------

[](#js-dumper--loader)

This bundle exposes an endpoint that can be used to load translations in JS. Include it in your Twig using the twig function:

```
{{- javascript_translations_init(namespace) -}}
```

It will automatically use the locale of the current master request. To override this behaviour a custom locale can be passed:

```
{{- javascript_translations_init(namespace, locale) -}}
```

### Using the Translations

[](#using-the-translations)

The dumped translations will be added to a global `window.TranslatorInit.data` object. These are nested maps, the outer map has the domain as key, the inner value is a mapping from key → translation.

Linked translation builder
--------------------------

[](#linked-translation-builder)

This bundle provides a `LinkedTranslationBuilder` that can be used to handle translations that contain links. It can simply be used by using the `LinkedTranslationBuilderFactory` to create a new instance. Then a list of used links can be added to the `LinkedTranslationBuilder`. Finally, the `LinkedTranslationBuilder` is able to create all needed parameters for the translation:

```
$translator->trans("your.translation-key", $linkedTranslationBuilderFactory->create()
    ->link("beforeLink", "afterLink", $linkableInterface)
    ->link("beforeLinkTwo", "afterLinkTwo", $linkableInterfaceTwo)
    ->generateTranslationParameters()
);
```

The `LinkedTranslationBuilder` is also capable of handling links that have custom classes and contain icons.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

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

Recently: every ~112 days

Total

11

Last Release

1551d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1044355?v=4)[Becklyn Studios](/maintainers/becklyn)[@Becklyn](https://github.com/Becklyn)

---

Top Contributors

[![mangoischke](https://avatars.githubusercontent.com/u/22484446?v=4)](https://github.com/mangoischke "mangoischke (2 commits)")[![jesko-plitt](https://avatars.githubusercontent.com/u/54807545?v=4)](https://github.com/jesko-plitt "jesko-plitt (1 commits)")

### Embed Badge

![Health badge](/badges/becklyn-translations/health.svg)

```
[![Health](https://phpackages.com/badges/becklyn-translations/health.svg)](https://phpackages.com/packages/becklyn-translations)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[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)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[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)
