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

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

nodes/translate
===============

Enable usage of translation services rather than local files

1.2.6(6y ago)28.7k2MITPHP

Since Jan 10Pushed 6y ago3 watchersCompare

[ Source](https://github.com/nodes-php/nodes-php-translate)[ Packagist](https://packagist.org/packages/nodes/translate)[ RSS](/packages/nodes-translate/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (2)Versions (32)Used By (0)

Translate
---------

[](#translate)

A package to enable usage of translation services rather than local files.

[![Total downloads](https://camo.githubusercontent.com/6613cda84a7de03c30db93dc0f0c3386375ea1995e96c2dfb6d9979331dfcbf6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f6465732f7472616e736c6174652e737667)](https://packagist.org/packages/nodes/translate)[![Monthly downloads](https://camo.githubusercontent.com/6f02a4da446bb850cb7bf56a7d9e3a52e600a5718556b6e56c04f3a4c3f68a31/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6e6f6465732f7472616e736c6174652e737667)](https://packagist.org/packages/nodes/translate)[![Latest release](https://camo.githubusercontent.com/a2c884adb455581f7d82d418f0e909f869e3d919dc7e9a3131498536e9540e5e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f6465732f7472616e736c6174652e737667)](https://packagist.org/packages/nodes/translate)[![Open issues](https://camo.githubusercontent.com/d4078586f6e3629e6f93222d3b103a5743f9a8ed861c51c1dc28d1cc177a1c6c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6e6f6465732d7068702f7472616e736c6174652e737667)](https://github.com/nodes-php/translate/issues)[![License](https://camo.githubusercontent.com/1241d5f83073e6cdcff26f968335e810e376bcbe901432384a246d22dca65a45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6f6465732f7472616e736c6174652e737667)](https://packagist.org/packages/nodes/translate)[![Star repository on GitHub](https://camo.githubusercontent.com/49e03d55abc174b258f01cd373d50b424b947ef5ae1ba73f04c6585c36c63ed6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6e6f6465732d7068702f7472616e736c6174652e7376673f7374796c653d736f6369616c266c6162656c3d53746172)](https://github.com/nodes-php/translate/stargazers)[![Watch repository on GitHub](https://camo.githubusercontent.com/10eda16041e6f92aef29a61c3f93848be90c9a84f65dcc8d9f7ea345817dc362/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f6e6f6465732d7068702f7472616e736c6174652e7376673f7374796c653d736f6369616c266c6162656c3d5761746368)](https://github.com/nodes-php/translate/watchers)[![Fork repository on GitHub](https://camo.githubusercontent.com/c1d567b919ff1bf268f1e16d921a0f835574f553794839d4013beae5c81f0326/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6e6f6465732d7068702f7472616e736c6174652e7376673f7374796c653d736f6369616c266c6162656c3d466f726b)](https://github.com/nodes-php/translate/network)[![StyleCI](https://camo.githubusercontent.com/060867d4b9ecaf84729b756dd8a1ba3d66ce5e9624b34a9a537905d90d7f6f77/68747470733a2f2f7374796c6563692e696f2f7265706f732f34353738363037392f736869656c64)](https://styleci.io/repos/45786079)

📝 Introduction
--------------

[](#-introduction)

At [Nodes](http://nodesagency.com) we create a lot of stuff, which needs to be supported in multiple languages. The translation feature that comes out of the box requires a developer to change it in a local file and commit and deploy that. But we wanted to use a service where other people - clients, project managers etc. - would be able to manage translations.

This package makes it easy to create translation providers and use them genericly in your [Laravel](http://laravel.com/docs/5.2) application.

Right it only comes with support for:

- [NStack](http://nstack.io)

But we very much welcome pull requests with providers to other services.

📦 Installation
--------------

[](#-installation)

To install this package you will need:

- Laravel 5.1+
- PHP 5.5.9+

You must then modify your `composer.json` file and run `composer update` to include the latest version of the package in your project.

```
"require": {
    "nodes/translate": "^1.0"
}
```

Or you can run the composer require command from your terminal.

```
composer require nodes/translate:^1.0
```

🔧 Setup
-------

[](#-setup)

> In Laravel 5.5 and above, service providers and aliases are [automatically registered](https://laravel.com/docs/5.5/packages#package-discovery). If you're using Laravel 5.5 or above, skip ahead directly to *Publish config files*.

Setup service provider in `config/app.php`

```
Nodes\Translate\ServiceProvider::class
```

Setup alias in `config/app.php`

```
'Translate' => Nodes\Translate\Support\Facades\Translate::class
```

Publish config files

```
php artisan vendor:publish --provider="Nodes\Translate\ServiceProvider"
```

If you want to overwrite any existing config files use the `--force` parameter

```
php artisan vendor:publish --provider="Nodes\Translate\ServiceProvider" --force
```

⚙ Usage
-------

[](#-usage)

### Global methods

[](#global-methods)

```
translate($key, $replacements = [], $locale = null, $platform = null)

translate_app($app, $key, $replacements = [], $locale = null, $platform = null)

translate_or_fail($key, array $replacements = [], $locale = null, $platform = null)

translate_app_or_fail($application, $key, $replacements = [], $locale = null, $platform = null)

translate_with_fallback($key, $fallback, array $replacements = [], $locale = null, $platform = null)

translate_app_with_fallback($application, $key, $fallback, $replacements = [], $locale = null, $platform = null)
```

### Fallbacks

[](#fallbacks)

There are two ways to handle fallbacks, if key is either missing or NStack is down and cache is invalid

1. By default the translate() func will use laravel's trans('nstack.' . key) as fallback, that means you can download the nstack keys and reformat them to a php array in insert the file into `/ressources/lang/en/nstack.php`
2. Use the translate\_with\_fallback and decide what to use

🏆 Credits
---------

[](#-credits)

This package is developed and maintained by the PHP team at [Nodes](http://nodesagency.com)

[![Follow Nodes PHP on Twitter](https://camo.githubusercontent.com/a898a5b14227bafa0c17c43be4f67460fe2b1dc3b88627d7b959e7fae4256a45/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6e6f6465737068702e7376673f7374796c653d736f6369616c)](https://twitter.com/nodesphp) [![Tweet Nodes PHP](https://camo.githubusercontent.com/8c1a307180498b3bb360cf73e63da1bfa3afc0306f601be021acd1e85d2bb4e4/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f687474702f6e6f6465737068702e7376673f7374796c653d736f6369616c)](https://twitter.com/nodesphp)

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 86.2% 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 ~57 days

Recently: every ~154 days

Total

27

Last Release

2282d ago

Major Versions

0.1.7 → 1.0.02016-05-17

### Community

Maintainers

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

---

Top Contributors

[![Casperhr](https://avatars.githubusercontent.com/u/1279756?v=4)](https://github.com/Casperhr "Casperhr (56 commits)")[![0hsn](https://avatars.githubusercontent.com/u/3197377?v=4)](https://github.com/0hsn "0hsn (3 commits)")[![carmenioanamihaila](https://avatars.githubusercontent.com/u/20821982?v=4)](https://github.com/carmenioanamihaila "carmenioanamihaila (3 commits)")[![rugaard](https://avatars.githubusercontent.com/u/179868?v=4)](https://github.com/rugaard "rugaard (2 commits)")[![Zeneo](https://avatars.githubusercontent.com/u/5598307?v=4)](https://github.com/Zeneo "Zeneo (1 commits)")

---

Tags

laraveltranslationstranslatenodesnstack

### Embed Badge

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

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

###  Alternatives

[vemcogroup/laravel-translation

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

135304.0k2](/packages/vemcogroup-laravel-translation)[genl/matice

Use your Laravel translations in JavaScript. Generates a Blade directive exporting all of your Laravel translations and provides a nice trans() helper function in JavaScript.

101339.4k2](/packages/genl-matice)[statikbe/laravel-chained-translator

The Laravel Chained Translator can combine several translators that can override each others translations.

36149.4k6](/packages/statikbe-laravel-chained-translator)[vildanbina/laravel-auto-translation

A Laravel package for automating the translation of language files.

9220.5k2](/packages/vildanbina-laravel-auto-translation)[cactus-galaxy/filament-astrotomic

Filament support for Astrotomic's Laravel Translatable package.

2516.3k](/packages/cactus-galaxy-filament-astrotomic)[itsmattburgess/laravel-translate

Populate laravel translation files using services such as Google Translate

222.5k](/packages/itsmattburgess-laravel-translate)

PHPackages © 2026

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