2017 © Pedro Peláez
 

library lazy-strings-lumen

Lumen service provider for LazyStrings.

image

nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  • Wednesday, March 9, 2016
  • by jonathantorres
  • Repository
  • 2 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Lazy Strings for Lumen

Build Status, (*1)

Lumen service provider for LazyStrings., (*2)

Installation

Add Lazy Strings to your composer.json file., (*3)

composer require nobox/lazy-strings-lumen

Lumen versions

Here's a rundown on the version(s) of lazy strings that you can use on your current installed lumen version., (*4)

Lumen version Service Provider version to use
5.0 1.0.*
5.1 1.1.*
5.2 1.2.*

Register Lazy Strings configuration and service provider

You must enable facades. Uncomment the line $app->withFacades(); on bootstrap/app.php., (*5)

Register Lazy Strings configuration. Add this line on bootstrap/app.php. It can go anywhere, I would recommend to add it after $app->withEloquent();., (*6)

$app->configure('lazy-strings');

Finally, register Lazy Strings service provider, also in bootstrap/app.php., (*7)

$app->register(Nobox\LazyStrings\LazyStringsServiceProvider::class);

Publish configuration and assets

This package uses some basic configuration and pretty CSS and JS from bootstrap., (*8)

php artisan lazy:publish

Configuration

Configuration is pretty simple, each configuration item is described below. More details on how these work can be found in the Lazy Strings repo here., (*9)

  • csv-url Add the Google spreadsheet published url.
'csv-url' => 'http://docs.google.com/spreadsheets/d/1V_cHt5Fe4x9XwVepvlXB39sqKXD3xs_QbM-NppkrE4A/export?format=csv'
  • target-folder This folder will be in your storage folder and it just saves a backup of your strings in JSON format. By default is lazy-strings.
'target-folder' => 'lazy-strings'
  • strings-route This is the route that will be used to generate the strings. Visit http://my-app.com/lazy/build-copy and your strings will be updated. By default is build-copy. The route will always be under the lazy prefix.
'strings-route' => 'build-copy'
  • nested Whether or not you wish your generated strings array to be nested.
'nested' => true,
  • sheets Here you'll specify all the sheets in your Google doc.
'sheets' => [
    'en' => [0, 1626663029],
    'es' => 1329731586,
    'pt' => 1443604037
]

How it works

Lazy Strings uses an id => value convention to access the copy, it generates an lazy.php file inside the language locale folder. You can see an example doc here: https://docs.google.com/a/nobox.com/spreadsheets/d/1V_cHt5Fe4x9XwVepvlXB39sqKXD3xs_QbM-NppkrE4A/edit#gid=0., (*10)

id value
foo Hello!
lazy LazyStrings
laravel PHP Framework

In this doc you can access the first row in your view like this:, (*11)

trans('lazy.foo') // returns "Hello!"

Or in your controller like this:, (*12)

Lang::get('lazy.foo'); // returns "Hello!"

Generate your strings

Each time you need to generate your strings just visit the specified strings-route in your configuration. The route will always be under the lazy prefix. For example: http://my-app.com/lazy/build-copy., (*13)

You can also use the included artisan command php artisan lazy:deploy. It will do exactly the same. This is perfect when you're deploying your application with Forge or Envoyer., (*14)

License

MIT, (*15)

The Versions

09/03 2016

dev-master

9999999-dev https://github.com/Nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jonathan Torres
by Alberto Estrada
by Antonio Rodriguez
by Waldemar Figueroa

lumen spreadsheet googledocs

08/03 2016

1.2.x-dev

1.2.9999999.9999999-dev https://github.com/Nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jonathan Torres
by Alberto Estrada
by Antonio Rodriguez
by Waldemar Figueroa

lumen spreadsheet googledocs

08/03 2016

1.1.x-dev

1.1.9999999.9999999-dev https://github.com/Nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jonathan Torres
by Alberto Estrada
by Antonio Rodriguez
by Waldemar Figueroa

lumen spreadsheet googledocs

19/01 2016

v1.2.0

1.2.0.0 https://github.com/Nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jonathan Torres
by Alberto Estrada
by Antonio Rodriguez
by Waldemar Figueroa

lumen spreadsheet googledocs

15/01 2016

v1.1.0

1.1.0.0 https://github.com/Nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jonathan Torres
by Alberto Estrada
by Antonio Rodriguez
by Waldemar Figueroa

lumen spreadsheet googledocs

15/01 2016

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/Nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jonathan Torres
by Alberto Estrada
by Antonio Rodriguez
by Waldemar Figueroa

lumen spreadsheet googledocs

15/01 2016

v1.0.0

1.0.0.0 https://github.com/Nobox/lazy-strings-lumen

Lumen service provider for LazyStrings.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Jonathan Torres
by Alberto Estrada
by Antonio Rodriguez
by Waldemar Figueroa

lumen spreadsheet googledocs