PHPackages                             trinavo/translation-sync - 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. trinavo/translation-sync

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

trinavo/translation-sync
========================

Translation sync package for Laravel applications

1163PHP

Since Sep 18Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/doonfrs/laravel-translation-sync)[ Packagist](https://packagist.org/packages/trinavo/translation-sync)[ RSS](/packages/trinavo-translation-sync/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

Translation Sync for Laravel
============================

[](#translation-sync-for-laravel)

A simple Laravel package to extract translation keys used in your app and sync them into one or more language JSON files (e.g., `lang/it.json`).

---

📦 Installation
--------------

[](#-installation)

```
composer require trinavo/translation-sync --dev
```

---

⚙️ Configuration
----------------

[](#️-configuration)

First, publish the package configuration:

```
php artisan vendor:publish --tag=translation-sync-config
```

This will create a config file at:

```
config/translation-sync.php

```

In this file, set the path(s) to your translation JSON files:

```
return [
    'lang_files' => [
        resource_path('lang/it.json'), // laravel < 12
        base_path('lang/ar.json'), // laravel 12+
    ],
];
```

---

🚀 Usage
-------

[](#-usage)

Once you've configured the paths, run the following command:

```
php artisan translations:sync
```

This will:

- Scan your `app/` and `resources/` directories for any usage of:
    - `__('...')`
    - `trans('...')`
    - `@lang('...')`
- Collect all found keys.
- Merge them into the specified language JSON file(s).
- Preserve existing values and sort them alphabetically.

---

📁 Example Output
----------------

[](#-example-output)

If your app contains:

```
__('Welcome');
@lang('Logout');
```

Then `lang/ar.json` will be updated to include:

```
{
    "Logout": "",
    "Welcome": ""
}
```

You can then update the values as needed for translation.

---

---

📝 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

---

Made with ❤️ by Feras AbdAlrahman

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance41

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4661009?v=4)[Feras A. S.](/maintainers/doonfrs)[@doonfrs](https://github.com/doonfrs)

---

Top Contributors

[![doonfrs](https://avatars.githubusercontent.com/u/4661009?v=4)](https://github.com/doonfrs "doonfrs (20 commits)")

### Embed Badge

![Health badge](/badges/trinavo-translation-sync/health.svg)

```
[![Health](https://phpackages.com/badges/trinavo-translation-sync/health.svg)](https://phpackages.com/packages/trinavo-translation-sync)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

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