PHPackages                             sebrogala/xsv-translate - 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. sebrogala/xsv-translate

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

sebrogala/xsv-translate
=======================

Zend Expressive Translation Module

3.0.0(7y ago)028BSD-3-ClausePHP

Since Jul 23Pushed 7y agoCompare

[ Source](https://github.com/SebRogala/xsv-translate)[ Packagist](https://packagist.org/packages/sebrogala/xsv-translate)[ Docs](https://github.com/SebRogala/xsv-translate)[ RSS](/packages/sebrogala-xsv-translate/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Zend Expressive Translation Module
==================================

[](#zend-expressive-translation-module)

Module made for database oriented resource translating with usage of Doctrine2. However it is quite simple to expand Translator with own kind of Adapter.

Installing (being in project root)
----------------------------------

[](#installing-being-in-project-root)

```
composer require sebrogala/xsv-translate^3.0
cp vendor/sebrogala/xsv-translate/data/xsv-translate-config.global.php.dist config/autoload/xsv-translate-config.global.php
```

- enable module in `config/config.php` adding `Xsv\Translate\ConfigProvider::class,`
- pipe middleware in `config/pipeline.php` before `DispatchMiddleware`:

```
/* ... */
$app->pipe(\Xsv\Translate\App\Middleware\TranslatorConfigMiddleware::class);
$app->pipe(DispatchMiddleware::class);
/* ... */
```

- change config file according to needs

```
vendor/bin/doctrine orm:schema-tool:update --force
```

Usage
-----

[](#usage)

- yet to done, for now only simple examples:

#### Recognizing which language to use

[](#recognizing-which-language-to-use)

- provide locale code with custom header:

```
X-Preferable-Locale locale_CODE

```

#### Adding translation

[](#adding-translation)

```
//adding translation interface
public static function addTranslation($resourceName, $resourceId, Locale $locale, $content)
```

```
use Xsv\Translate\Translator\Translator;
/*
...
*/
Translator::addTranslation("resource.name", "id", new Locale("pl_PL"), "TranslationToPolish");
```

Where:

- "resource.name" is self defined, can be "user.username" - it's about single field.
- "id" is unique id of row (currently it's based on uuid)

#### Translating resource

[](#translating-resource)

```
//translating interface
public static function translate(string $resourceName, string $resourceId, $defaultTranslationContent = "")
```

```
use Xsv\Translate\Translator\Translator;
/*
...
*/
return new JsonResponse(
    [
        "userName" => Translator::translate("user.name", $user->getId(), $user->getUserName())
    ]
);
```

TODO
----

[](#todo)

- remove single translation
- remove all translations for chosen ID
- provide better examples

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

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

Unknown

Total

1

Last Release

2850d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23e199a9c584deaf622ab523503eec877043bcb2a7da4e078b3e7658202c3b86?d=identicon)[SebRogala](/maintainers/SebRogala)

---

Top Contributors

[![SebRogala](https://avatars.githubusercontent.com/u/12585578?v=4)](https://github.com/SebRogala "SebRogala (3 commits)")

### Embed Badge

![Health badge](/badges/sebrogala-xsv-translate/health.svg)

```
[![Health](https://phpackages.com/badges/sebrogala-xsv-translate/health.svg)](https://phpackages.com/packages/sebrogala-xsv-translate)
```

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)

PHPackages © 2026

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