PHPackages                             azuretran/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. [API Development](/categories/api)
4. /
5. azuretran/translate

Abandoned → [atran/translate](/?search=atran%2Ftranslate)Library[API Development](/categories/api)

azuretran/translate
===================

Making Microsoft translator API version 3 consumption easier in Laravel 5+.

8.0(5y ago)1671[2 PRs](https://github.com/InputOutputZ/ATran/pulls)UnlicensePHP

Since Jan 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/InputOutputZ/ATran)[ Packagist](https://packagist.org/packages/azuretran/translate)[ Docs](https://github.com/InputOutputZ/ATran)[ RSS](/packages/azuretran-translate/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (2)Versions (12)Used By (0)

ATran
=====

[](#atran)

Making Microsoft translator API version 3 consumption easier in Laravel 5+.

### Through this integration you can do the following

[](#through-this-integration-you-can-do-the-following)

- Detects text information such as language code and script. Refer to ATran@detectTextInformation.
- Detects list of text information such as language code and script. Refer to ATran@detectTextsInformation.
- Translates text from one language to one or multiple languages. Refer to ATran@translateText.
- Produces transliteration of text from one language to another. Refer to ATran@transliterateTextInformation.
- Request available languages for translation including list of languages code. Refer to ATran@translationsAvailable.
- Request available languages for transliteration including list of available scripts. Refer to ATran@transliterationAvailable.

Laravel Microsoft Translator Integration
----------------------------------------

[](#laravel-microsoft-translator-integration)

There are 3 files to have a look at so to understand how the integration works

- config/atran.php (Configuration of API endpoints &amp; authorisation key)
- routes.php (Configuring PlayWithAPIController routes)
- ATran\\Translate\\PlayWithAPIController (A Controller with on hand methods playing with the API endpoints)

### Required Packages

[](#required-packages)

```
"guzzlehttp/guzzle": "^7.0.1",
"tebru/gson-php": "^0.7.3"
```

Installation for Laravel 5+. Tested on 8.40.
============================================

[](#installation-for-laravel-5-tested-on-840)

- 1- Go to your laravel project root directory and install the package locally:-

```
composer require "atran/translate"
```

- 2- Install the service provider and load config as well as routes references:-

```
php artisan vendor:publish
```

- 3- Choose "ATran\\Translate\\ATranServiceProvider" provider from the list via typing its index value.
- 4- Go to env file and include at the bottom:-

```
AZURETRAN_KEY=Azure Cognitive Services API SUBSCRIPTION KEY
```

- 5- Well Done!

Installation for older Laravel
==============================

[](#installation-for-older-laravel)

### You may expect more debugging to get it working.

[](#you-may-expect-more-debugging-to-get-it-working)

- 1- Go to your laravel project root directory and install the package locally:-

```
composer require "atran/translate"
```

- 2- Add ATran service provider manually to the providers list in config/app.php:-

```
'providers' => [
    // ...
    ATran\Translate\\ATranServiceProvider::class,
]
```

- 3- Load config as well as routes references:-

```
php artisan vendor:publish --force --provider="ATran\Translate\ATranServiceProvider"
```

- 4- Go to env file and include at the bottom:-

```
AZURETRAN_KEY=Azure Cognitive Services API SUBSCRIPTION KEY
```

- 5- Well Done!

Demo with PlayWithAPIController and Postman
===========================================

[](#demo-with-playwithapicontroller-and-postman)

Configuration
-------------

[](#configuration)

- Codebase Configuration

-1 Go To PlayWithAPIController

-2 Go to definition of detectTextInformation and transliterationsAvailable.

-3 Examine the functions

- detectTextInformation | Postman Configuration to route "" and POST type.

-1 Include following headers:-

```
Accept: application/json
```

2- Include following Body: form-data

```
KEY     TEXT
text    Hello
```

3- Response

```
{
    "language": "en",
    "score": 1,
    "isTranslationSupported": true,
    "isTransliterationSupported": false,
    "alternatives": [
        {
            "language": "de",
            "score": 1,
            "isTranslationSupported": true,
            "isTransliterationSupported": false
        },
        {
            "language": "fr",
            "score": 1,
            "isTranslationSupported": true,
            "isTransliterationSupported": false
        }
    ]
}
```

- transliterationsAvailable | Postman Configuration to route "" and POST type.

-1 Include following headers:-

```
Accept: application/json
```

2- Response

```
{
    "ar": {
        "name": "Arabic",
        "nativeName": "العربية",
        "scripts": [
            {
                "code": "Arab",
                "name": "Arabic",
                "nativeName": "العربية",
                "dir": "rtl",
                "toScripts": [
                    {
                        "code": "Latn",
                        "name": "Latin",
                        "nativeName": "اللاتينية",
                        "dir": "ltr"
                    }
                ]
            },
            {
                "code": "Latn",
                "name": "Latin",
                "nativeName": "اللاتينية",
                "dir": "ltr",
                "toScripts": [
                    {
                        "code": "Arab",
                        "name": "Arabic",
                        "nativeName": "العربية",
                        "dir": "rtl"
                    }
                ].............
```

Usage
=====

[](#usage)

### Import Use at the top in any of your laravel project controllers

[](#import-use-at-the-top-in-any-of-your-laravel-project-controllers)

```
use ATran;
```

### Access functions through

[](#access-functions-through)

```
ATran::detectTextInformation($text);
```

Available functions
-------------------

[](#available-functions)

- detectTextInformation($text)
- detectTextsInformation($texts)
- transliterateTextInformation($text,$language,$fromscript,$toscript)
- translateText($text, $to)
- transliterationsAvailable($languagecode = null)
- translationsAvailable($languagecode = null)

About
-----

[](#about)

The ATran package was published under The Unlicense licence. If you have any problems, please feel free to reach out at .

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 96.7% 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 ~208 days

Total

5

Last Release

1832d ago

Major Versions

1.3 → 7.02020-12-31

7.0 → 8.02021-05-04

### Community

Maintainers

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

---

Top Contributors

[![InputOutputZ](https://avatars.githubusercontent.com/u/4721398?v=4)](https://github.com/InputOutputZ "InputOutputZ (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

apilaravellanguagetranslatelanguagestranslationazuretranslatorservicestransliteratecognitive3easierversion3

### Embed Badge

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

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[chriskonnertz/deeply

DeepLy is a PHP client for the DeepL.com translation API

230116.2k8](/packages/chriskonnertz-deeply)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[eko/googletranslatebundle

A Symfony bundle to deals with Google Translate API

4337.1k](/packages/eko-googletranslatebundle)

PHPackages © 2026

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