PHPackages                             akibtanjim/google-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. akibtanjim/google-translate

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

akibtanjim/google-translate
===========================

This package is built for laravel with a view to translate any text from source language to destination language using Google Translate.

1.0(8y ago)43.1k↑33.3%2MITPHPPHP &gt;= 7.1.3

Since Mar 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/akibtanjim/google-translate)[ Packagist](https://packagist.org/packages/akibtanjim/google-translate)[ Docs](https://github.com/akibtanjim/google-translate)[ RSS](/packages/akibtanjim-google-translate/feed)WikiDiscussions master Synced yesterday

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

Laravel Google Translator
=========================

[](#laravel-google-translator)

This package is built for laravel with a view to translate any text from source language to destination language using Google Translate.

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

[](#installation)

Install using composer:

```

composer require akibtanjim/google-translate

```

After updating composer, add the ServiceProvider to the providers array in `config/app.php`

In the **providers** section add the below line:

```

  Akib\Translate\GoogleTranslateServiceProvider::class,

```

add the Alias to **aliases** section of config/app.php:

```

  'TranslateText'=>Akib\Translate\Facades\GoogleTranslate::class,

```

### Useage

[](#useage)

Create a new directory `app/Helper` and create a new file named `Functions.php` there. Then paste the code below

```

```

Open your `composer.json` file and add the below line of code under `autoload` section:

```
        "psr-4": {
            "App\\": "app/",
            "Akib\\Translate\\": "vendor/akibtanjim/google-translate/src"
        },
        "files": [
          "app/Helpers/Functions.php"
        ]

```

Now open your command promt and run the following comment.

```

  composer dump-autoload

```

### Example

[](#example)

Open command prompt and wrtie the following command:

```

  php artisan make:controller ExampleController

```

Now paste the following code:

```

```

Now create a view file in the `resources/views/test.blade.php` and paste the below code:

```
  Language:

    Select
    Bangla
    English
    Chinese

    {{ translateText("Hello World") }}

    $('.target').on('change',function(){
          var target = $(this).val();
          $.ajax({
              url:"{{url('/setTarget')}}",
              type:"POST",
              dataType:'json',
              data:{"_token": "{{ csrf_token() }}","target":target},
              success: function(data) {
                location.reload();
              },
              error: function(e) {

              }
          });
      });

```

In your `web.php` paste the following code.

```
  Route::get('/demo', 'ExampleController@index');
  Route::post('/setTarget', 'ExampleController@setTarget');

```

Now open your `.env` file and paste the follwing code:

```
  BaseLanguage=bn

```

Open command prompt and run:

```
  php artisan serve

```

Open the follwing link in your browser and change the language and see translation in action.

```
  http://127.0.0.1:8000/demo

```

Supported Languages and their shortcode
---------------------------------------

[](#supported-languages-and-their-shortcode)

LanguageShort CodeAfrikaansafAlbaniansqAmharicamArabicarArmenianhyAzeerbaijaniazBasqueeuBelarusianbeBengalibnBosnianbsBulgarianbgCatalancaCebuanoceb (ISO-639-2)Chinese (Simplified)zh-CN (BCP-47)Chinese (Traditional)zh-TW (BCP-47)CorsicancoCroatianhrCzechcsDanishdaDutchnlEnglishenEsperantoeoEstonianetFinnishfiFrenchfrFrisianfyGalicianglGeorgiankaGermandeGreekelGujaratiguHaitian CreolehtHausahaHawaiianhaw (ISO-639-2)HebrewiwHindihiHmonghmn (ISO-639-2)HungarianhuIcelandicisIgboigIndonesianidIrishgaItalianitJapanesejaJavanesejwKannadaknKazakhkkKhmerkmKoreankoKurdishkuKyrgyzkyLaoloLatvianlaLatvianlvLithuanianltLuxembourgishlbMacedonianmkMalagasymgMalaymsMalayalammlMaltesemtMaorimiMarathimrMongolianmnMyanmar (Burmese)myNepalineNorwegiannoNyanja (Chichewa)nyPashtopsPersianfaPolishplPortuguese (Portugal, Brazil)ptPunjabipaRomanianroRussianruSamoansmScots GaelicgdSerbiansrSesothostShonasnSindhisdSinhala (Sinhalese)siSlovakskSlovenianslSomalisoSpanishesSundanesesuSwahiliswSwedishsvTagalog (Filipino)tlTajiktgTamiltaTeluguteThaithTurkishtrUkrainianukUrduurUzbekuzVietnameseviWelshcyXhosaxhYiddishyiYorubayoZuluzuLimitations:
------------

[](#limitations)

- This package can only translate upto 5000 characters at a time.

Authors
-------

[](#authors)

- **Akib Tanjim** - [akibtanjim](https://github.com/akibtanjim)
- **Mohammad Rubab** - [rubab2020](https://github.com/rubab2020)

Acknowledgments
---------------

[](#acknowledgments)

- [statickidz/php-google-translate-free](https://github.com/statickidz/php-google-translate-free)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

3043d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b5def95341db1bf42b46c9b9caa9cb88c805dd0c1f36727f7662c4be3f4284b?d=identicon)[akibtanjim](/maintainers/akibtanjim)

---

Top Contributors

[![akibtanjim](https://avatars.githubusercontent.com/u/8993623?v=4)](https://github.com/akibtanjim "akibtanjim (10 commits)")

---

Tags

laravelgoogle-translatefree-google-translate

### Embed Badge

![Health badge](/badges/akibtanjim-google-translate/health.svg)

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

###  Alternatives

[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.4k](/packages/typicms-base)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

136327.1k3](/packages/vemcogroup-laravel-translation)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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