承接 bestmomo/laravel5-artisan-language 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bestmomo/laravel5-artisan-language

最新稳定版本:V1.0.2

Composer 安装命令:

composer require bestmomo/laravel5-artisan-language

包简介

Add artisan commands for language strings

README 文档

README

This package is to add artisan commands for language strings to Laravel>=5.4 project.

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...

Features

Add these 4 artisan commands :

  • 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 :

    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):

    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 :

<?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 :

php artisan language:make fr

use option --force if the file already exists and you want overwrite it.

And it's done !

统计信息

  • 总下载量: 23.72k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 28
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 27
  • Watchers: 4
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-15