PHPackages                             sircoolmind/laravel-ai-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. sircoolmind/laravel-ai-translation

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

sircoolmind/laravel-ai-translation
==================================

AI Translation Tool for Laravel using Gemini

1.0.0(6mo ago)014[1 issues](https://github.com/SirCoolMind/laravel-ai-translation/issues)MITPHPPHP ^8.1

Since Dec 23Pushed 6mo agoCompare

[ Source](https://github.com/SirCoolMind/laravel-ai-translation)[ Packagist](https://packagist.org/packages/sircoolmind/laravel-ai-translation)[ Docs](https://github.com/sircoolmind/laravel-ai-translation)[ RSS](/packages/sircoolmind-laravel-ai-translation/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (5)Versions (3)Used By (0)

Laravel AI Translation Tool
===========================

[](#laravel-ai-translation-tool)

This package automates your Laravel localization process. It uses **Google Gemini AI** to automatically translate your language keys from English to other supported languages (e.g., Malay, Chinese) and saves them directly to your JSON language files (`lang/ms.json`, `lang/zh_CN.json`, etc.).

It comes with a **built-in UI**, a **Command Line tool**, and a **Facade** for programmatic usage.

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

[](#installation)

You can install the package via composer:

```
composer require sircoolmind/laravel-ai-translation
```

### 1. Publish Configuration

[](#1-publish-configuration)

Publish the configuration file to setup your API keys and supported languages.

```
php artisan vendor:publish --tag="ai-translation-config"
```

### 2. Configure API Key

[](#2-configure-api-key)

Open your `.env` file and add your Google Gemini API Key:

```
GEMINI_API_KEY=your_api_key_here
```

You can also customize supported languages in `config/ai-translation.php`.

---

Usage
-----

[](#usage)

### 1. Via Visual Interface (UI)

[](#1-via-visual-interface-ui)

This package comes with a built-in dashboard to manage translations easily.

1. Open your browser and visit: `http://your-app.test/ai-translations`
2. Enter a **Key** (e.g., `welcome_message`) and the **Word** (e.g., "Welcome to our system").
3. Click **Auto Translate**.
4. The system will generate translations for all configured languages and save them to your JSON files.

### 2. Via Command Line (CLI)

[](#2-via-command-line-cli)

Perfect for developers who want to add translations quickly without leaving the terminal.

**Syntax:**

```
php artisan ai-translator-lang {key} "{word}"
```

**Example:**Translate "Dashboard" to all supported languages:

```
php artisan ai-translator-lang dashboard_title "Dashboard"
```

**Override Source Language:**If your input word is in Malay:

```
php artisan ai-translator-lang dashboard_title "Papan Pemuka" --source=ms
```

### 3. Via Facade (Code)

[](#3-via-facade-code)

You can use the `AiTranslator` facade inside your Controllers, Jobs, or Seeders to trigger translations programmatically.

```
use SirCoolMind\AiTranslation\Facades\AiTranslator;

public function store(Request $request)
{
    // ... create product logic ...

    // Automatically translate the success message
    AiTranslator::translateAndSave('product_created', 'Product created successfully');

    return back();
}
```

---

Configuration (`config/ai-translation.php`)
-------------------------------------------

[](#configuration-configai-translationphp)

```
return [
    // Default source language for input
    'source_locale' => 'en',

    // Languages to translate into
    'supported_locales' => ['en', 'ms', 'zh'],

    // Mapping Laravel locales to Google Translate codes
    'google_map' => [
        'zh' => 'zh-CN',
        'ms' => 'ms',
    ],

    'api_key' => env('GEMINI_API_KEY'),
];
```

Testing
-------

[](#testing)

To run the test suite included in this package:

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Hafiz Ruslan](https://github.com/hafizunijaya)
- [Ahyew Unijaya](https://github.com/ahyewunijaya)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance67

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

192d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/58092306?v=4)[SirCoolMind](/maintainers/SirCoolMind)[@SirCoolMind](https://github.com/SirCoolMind)

---

Top Contributors

[![SirCoolMind](https://avatars.githubusercontent.com/u/58092306?v=4)](https://github.com/SirCoolMind "SirCoolMind (6 commits)")

---

Tags

laravelsircoolmindlaravel-ai-translation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sircoolmind-laravel-ai-translation/health.svg)

```
[![Health](https://phpackages.com/badges/sircoolmind-laravel-ai-translation/health.svg)](https://phpackages.com/packages/sircoolmind-laravel-ai-translation)
```

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.0M69](/packages/spatie-laravel-responsecache)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[bezhansalleh/filament-language-switch

Zero config Language Switch(Changer/Localizer) plugin for filamentphp admin

3581.3M27](/packages/bezhansalleh-filament-language-switch)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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