2017 © Pedro Pelรกez
 

library translate

Enable usage of translation services rather than local files

image

nodes/translate

Enable usage of translation services rather than local files

  • Monday, June 11, 2018
  • by nodes
  • Repository
  • 2 Watchers
  • 2 Stars
  • 4,496 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 29 Versions
  • 32 % Grown

The README.md

Translate

A package to enable usage of translation services rather than local files., (*1)

Total downloads Monthly downloads Latest release Open issues License Star repository on GitHub Watch repository on GitHub Fork repository on GitHub StyleCI, (*2)

๐Ÿ“ Introduction

At Nodes 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., (*3)

This package makes it easy to create translation providers and use them genericly in your Laravel application., (*4)

Right it only comes with support for:, (*5)

But we very much welcome pull requests with providers to other services., (*6)

๐Ÿ“ฆ Installation

To install this package you will need:, (*7)

  • 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., (*8)

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

Or you can run the composer require command from your terminal., (*9)

composer require nodes/translate:^1.0

๐Ÿ”ง Setup

In Laravel 5.5 and above, service providers and aliases are automatically registered. If you're using Laravel 5.5 or above, skip ahead directly to Publish config files., (*10)

Setup service provider in config/app.php, (*11)

Nodes\Translate\ServiceProvider::class

Setup alias in config/app.php, (*12)

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

Publish config files, (*13)

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

If you want to overwrite any existing config files use the --force parameter, (*14)

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

โš™ Usage

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

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

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, (*16)

2) Use the translate_with_fallback and decide what to use, (*17)

๐Ÿ† Credits

This package is developed and maintained by the PHP team at Nodes, (*18)

Follow Nodes PHP on Twitter Tweet Nodes PHP, (*19)

๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license, (*20)

The Versions

11/06 2018

dev-master

9999999-dev

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

11/06 2018

1.2.4

1.2.4.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

11/06 2018

dev-develop

dev-develop

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

06/06 2018

1.2.3

1.2.3.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

06/06 2018

1.2.1

1.2.1.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

06/06 2018

1.2.2

1.2.2.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

05/06 2018

1.2.0

1.2.0.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

06/09 2017

1.1.3

1.1.3.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

30/08 2017

1.1.2

1.1.2.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

19/06 2017

1.1.1

1.1.1.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

14/06 2017

1.1.0

1.1.0.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

16/02 2017

1.0.7

1.0.7.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

10/09 2016

1.0.6

1.0.6.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

08/09 2016

1.0.5

1.0.5.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

28/07 2016

dev-analysis-8APaWk

dev-analysis-8APaWk

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

13/07 2016

1.0.4

1.0.4.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

10/06 2016

1.0.3

1.0.3.0

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

10/06 2016

dev-feature/multi-apps

dev-feature/multi-apps

Enable usage of translation services rather than local files

  Sources   Download

MIT

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

08/06 2016

1.0.2

1.0.2.0

Enable usage of translation services rather than local files

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translations translate nodes nstack

08/06 2016

1.0.1

1.0.1.0

Makes it easier to use and manage translation providers

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

17/05 2016

1.0.0

1.0.0.0

Makes it easier to use and manage translation providers

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

18/04 2016

0.1.7

0.1.7.0

Makes it easier to use and manage translation providers

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

06/02 2016

0.1.6

0.1.6.0

Makes it easier to use and manage translation providers

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

20/01 2016

0.1.5

0.1.5.0

Package to make use different translate systems

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

16/01 2016

0.1.4

0.1.4.0

Package to make use different translate systems

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

10/01 2016

0.1.3

0.1.3.0

Package to make use different translate systems

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

10/01 2016

0.1.1

0.1.1.0

Package to make use different translate systems

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

10/01 2016

0.1.2

0.1.2.0

Package to make use different translate systems

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack

10/01 2016

0.1.0

0.1.0.0

Package to make use different translate systems

  Sources   Download

The Requires

 

by Casper Rasmussen

laravel translate nodes nstack