2017 © Pedro Peláez
 

library laravel5-artisan-language

Add artisan commands for language strings

image

bestmomo/laravel5-artisan-language

Add artisan commands for language strings

  • Friday, September 1, 2017
  • by bestmomo
  • Repository
  • 1 Watchers
  • 11 Stars
  • 4,567 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 5 Versions
  • 12 % Grown

The README.md

Laravel Artisan Language

This package is to add artisan commands for language strings to Laravel>=5.4 project., (*1)

Because when you have all your base strings in your project you have no way to easily get them to create a JSON file for a locale. You have to check all files... So this package helps you and do that automaticaly, and do some other tasks like list all strings and synchronise a locale JSON file..., (*2)

Features

Add these 4 artisan commands :, (*3)

  • language:strings to list all project strings (in app and resource/views folders)
  • language:make to create a JSON file for the locale filled with project strings
  • language:diff to show differences between locale JSON file and project strings
  • language:sync to synchronise locale JSON file with project strings

Installation

Add package to your composer.json file :, (*4)

    composer require bestmomo/laravel5-artisan-language --dev

For Laravel 5.4 add service provider to config/app.php (with Laravel >=5.5 there is the package discovery):, (*5)

    Bestmomo\ArtisanLanguage\ArtisanLanguageProvider::class,

Configuration (optional)

if you need to change some parameters you can add a config file in the config path of your project which name is artisan-language.php with content like before :, (*6)

<?php
return [
    "scan_paths" => [
        app_path(),
        resource_path('views'),
        resource_path('assets/js'),
    ],
    "scan_pattern" => '/(@lang|__|\$t|\$tc)\s*(\(\s*[\'"])([^$]*)([\'"]+\s*(,[^\)]*)*\))/U',
    "lang_path" => resource_path('lang'),
];

Use

to generate a translation file for locale "fr" you should launch command before : shell script php artisan language:make fr use option --force if the file already exists and you want overwrite it., (*7)

And it's done !, (*8)

The Versions

01/09 2017

dev-master

9999999-dev https://github.com/bestmomo/laravel-artisan-language

Add artisan commands for language strings

  Sources   Download

MIT

The Requires

 

01/09 2017

V0.1.2

0.1.2.0 https://github.com/bestmomo/laravel-artisan-language

Add artisan commands for language strings

  Sources   Download

MIT

The Requires

 

01/09 2017

V0.1.3

0.1.3.0 https://github.com/bestmomo/laravel-artisan-language

Add artisan commands for language strings

  Sources   Download

MIT

The Requires

 

27/06 2017

V0.1.1

0.1.1.0 https://github.com/bestmomo/laravel-artisan-language

Add artisan commands for language strings

  Sources   Download

MIT

The Requires

 

15/05 2017

V0.1.0

0.1.0.0 https://github.com/bestmomo/laravel-artisan-language

Add artisan commands for language strings

  Sources   Download

MIT

The Requires