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

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

goodmagma/laravel-translations
==============================

Export Localization strings and translate it via Google Translate for Laravel

1.1.1(1y ago)23.4k↓43.1%1MITPHPPHP ^8.2

Since Dec 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/goodmagma/laravel-translations)[ Packagist](https://packagist.org/packages/goodmagma/laravel-translations)[ RSS](/packages/goodmagma-laravel-translations/feed)WikiDiscussions develop Synced 3d ago

READMEChangelog (5)Dependencies (7)Versions (8)Used By (0)

Export Strings and Automatic translate via Google Translate Tools for Laravel
=============================================================================

[](#export-strings-and-automatic-translate-via-google-translate-tools-for-laravel)

[![Latest Version](https://camo.githubusercontent.com/74e94531fcf85155967685cde1b3a635badeb29d33ee354e2fdd20f0a20ddbc8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f676f6f646d61676d612f6c61726176656c2d7472616e736c6174696f6e732e737667)](https://github.com/goodmagma/laravel-translations)[![Packagist Downloads](https://camo.githubusercontent.com/5fc0b14dc045635c3bb9c752a094e8511218331be24dc6c7c17427ca27583166/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f6f646d61676d612f6c61726176656c2d7472616e736c6174696f6e732e737667)](https://packagist.org/packages/goodmagma/laravel-translations)[![Tests Status Badge](https://github.com/goodmagma/laravel-translations/actions/workflows/run-tests.yml/badge.svg)](https://github.com/goodmagma/laravel-translations/actions/workflows/run-tests.yml)[![PHPStan Status Badge](https://github.com/goodmagma/laravel-translations/actions/workflows/phpstan.yml.yml/badge.svg)](https://github.com/goodmagma/laravel-translations/actions/workflows/phpstan.yml.yml)[![Code Styles Check Badge](https://github.com/goodmagma/laravel-translations/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/goodmagma/laravel-translations/actions/workflows/php-cs-fixer.yml)

You can use `__('Translate me')` or `@lang('Translate me')` with translations in JSON files to translate strings. Laravel Translation Tools is composed by two commands:

- exporter: Collect all translatable strings of an application and create corresponding translation files in JSON format
- autotranslate: Translate all the strings of a specific language and save it to the corresponding JSON file. You may define a `persistent-strings` file in order to keep some translations.

Attribution
-----------

[](#attribution)

This project includes code from the following open-source projects:

**Translatable String Exporter for Laravel**

- Repository:
- License: [MIT License](https://github.com/kkomelin/laravel-translatable-string-exporter/blob/master/LICENSE)

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

[](#installation)

You can install the package via composer:

```
composer require goodmagma/laravel-translations --dev
```

You can publish the config file with:

```
php artisan vendor:publish --tag="translations-config"
```

[Click here to see the contents of the config file](config/translations.php).

You should read through the config, which serves as additional documentation and make changes as needed.

Usage
-----

[](#usage)

### Export translatable strings

[](#export-translatable-strings)

```
php artisan translations:export
```

Where `` is a language code or a comma-separated list of language codes. For example:

```
php artisan translations:export es
php artisan translations:export es,bg,de
```

The command with the `"es,bg,de"` parameter passed will create `es.json`, `bg.json`, `de.json` files with translatable strings or update the existing files in the `lang/` folder of your project.

### Translate strings

[](#translate-strings)

```
php artisan translations:translate
```

Where `` is a language code or a comma-separated list of language codes. For example:

```
php artisan translations:translate es
php artisan translations:translate es,bg,de
```

### Persistent Strings

[](#persistent-strings)

Some strings are not included in the export, because they are being dynamically generated. For example:

`{{ __(sprintf('Dear customer, your order has been %s', $orderStatus)) }}`

Where `$orderStatus` can be `'approved'`, `'paid'`, `'cancelled'` and so on.

In this case, you can add the strings to the `.json` file manually. For example:

```
  ...,
  "Dear customer, your order has been approved": "Dear customer, your order has been approved",
  "Dear customer, your order has been paid": "Dear customer, your order has been paid",
  ...

```

In order for those, manually added, strings not to get removed the next time you run the export command, you should add them to a json file named `persistent-strings-.json`. For example:

```
[
  ...,
  "Dear customer, your order has been %s": "Gentile cliente, il tuo ordine è stato approvato",
  ...
]

```

You may also use the `persistent-strings-.json` file to fix some translations when you use translate command. When a translation is defined here will not be automatic translated via Google Translate. This is useful for example when the automatic translation output for a particular string is not accurate.

Contributing
------------

[](#contributing)

Contributions are what makes the open source community such an amazing place to learn, inspire and create. Any contributions you make are **greatly appreciated**.

- Give us a star ⭐
- Fork and Clone! Awesome
- Select existing [issues](https://github.com/goodmagma/laravel-translations/issues) or create a [new issue](https://github.com/goodmagma/laravel-translations/issues/new) and give us a PR with your bugfix or improvement after. We love it ❤️

If you want to make a PR:

1. Fork the Project and checkout `develop` branch
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

License
-------

[](#license)

Distributed under the MIT License. See [LICENSE](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance42

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

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

Every ~118 days

Total

5

Last Release

472d ago

PHP version history (2 changes)v1.0.0PHP ^8.0

1.1.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b244ef2e9faeaeae54812975acc30e13c8b7ddded3f1587755250b9b1b7922ca?d=identicon)[denistorresan](/maintainers/denistorresan)

---

Top Contributors

[![denistorresan](https://avatars.githubusercontent.com/u/1846826?v=4)](https://github.com/denistorresan "denistorresan (39 commits)")

---

Tags

jsonlaravellocalizationtranslationstranslationexportexporter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

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

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

###  Alternatives

[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3301.5M20](/packages/kkomelin-laravel-translatable-string-exporter)[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.8M18](/packages/barryvdh-laravel-translation-manager)[tio/laravel

Add this package to localize your Laravel application (PHP, JSON or GetText).

170341.2k](/packages/tio-laravel)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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