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

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

alkalab/magic-translation
=========================

Automatically translate your Laravel localization files to any language using Google Translate through an Artisan command.

0.0.2(8y ago)332MITPHP

Since Apr 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/2Fwebd/magic-translation)[ Packagist](https://packagist.org/packages/alkalab/magic-translation)[ Docs](https://github.com/2Fwebd/magic-translation)[ RSS](/packages/alkalab-magic-translation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Laravel Magic Translation
=========================

[](#laravel-magic-translation)

Automatically translate your Laravel localization files to any language using Google Translate through an Artisan command.

This package supports for any string:

- Parameters (example: 'localized string :foo')
- Emojis (example: 'localized string 🚀')
- HTML tags (example: 'localized string &lt;i&gt;yes &lt;/i&gt;')

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

[](#installation)

As any Laravel package, simply

`composer require alkalab/magic-translation`

How to use it?
--------------

[](#how-to-use-it)

Simple, once installed the Artisan command is:

`php artisan magic:translate {file} {target} {--no-validation}`

- **{file}**: the file that needs to be translated inside your `resources/assets/lang/en/`, without the .php extension. *Example: "validation" to translate resources/assets/lang/en/validation.php*
- **{target}**: the language code (2 characters) in which the strings will be translated. *Example: "fr" to translate to resources/assets/lang/fr/*
- **--no-validation**: an optional command option. If set, the strings will be automatically translated without validation. You can always change them afterward of course. Otherwise, you will be validating every translation 1 by 1.

Example:

`php artisan magic:translate validation fr --no-validation`

Important notes
---------------

[](#important-notes)

- This is using Google Translator, please **check the translations** as even though it's pretty good sometimes it will not work correctly 😉.
- This first version only translates **from** English to another language. Not the other way around.
- As of right now, this is using the wonderful [Stichoza/google-translate-php](https://github.com/Stichoza/google-translate-php)package. This package does not use the Google Cloud API but directly the Google Translate website. Therefore, it might stop working at some point. If that happens, this package will be updated to use the Cloud API instead.

**Any bug, idea or improvement, feel free to improve it or create a new issue.**

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

2954d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e37de5308aec372318531e17454645182236855fe820e8078ad7802cf299abff?d=identicon)[2Fwebd](/maintainers/2Fwebd)

---

Top Contributors

[![2Fwebd](https://avatars.githubusercontent.com/u/5446124?v=4)](https://github.com/2Fwebd "2Fwebd (9 commits)")

---

Tags

phplaraveltranslategoogleautomatic

### Embed Badge

![Health badge](/badges/alkalab-magic-translation/health.svg)

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

###  Alternatives

[mcamara/laravel-localization

Easy localization for Laravel

3.5k9.1M112](/packages/mcamara-laravel-localization)[stichoza/google-translate-php

Free Google Translate API PHP Package

2.0k7.6M124](/packages/stichoza-google-translate-php)[josiasmontag/laravel-localization

Localization for Laravel framework

2336.2k](/packages/josiasmontag-laravel-localization)[laurentesc/laravel-subdomain-localization

Subdomain localization support for Laravel

1911.3k](/packages/laurentesc-laravel-subdomain-localization)

PHPackages © 2026

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