slaveofgod/laravel-translator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

slaveofgod/laravel-translator

Composer 安装命令:

composer require slaveofgod/laravel-translator

包简介

PHP Laravel artisan command that extracting translation contents and updating translation files automatically

README 文档

README

The most time-consuming tasks when translating an application is to extract all the template contents to be translated and to keep all the translation files in sync. This package includes a command called translation:update that helps you with these tasks.

Installation

$ composer require slaveofgod/laravel-translator dev-master

Commands:

Update Command:

Update translations from source code.

$ php artisan translation:update {locale} {--force} {--dump-messages}

Arguments:

Name Description Default
locale The locale -
path Directory where to extract the messages views

Options:

Name Description Default
force Should the update be done false
dump-messages Should the messages be dumped in the console false
no-backup Should backup not be done false
clean Should clean not found messages. But we will ignore next files: 'validation', 'auth', 'passwords', 'pagination' false
prefix Override the default prefix. __,@lang,trans_choice,@choice,__ab,@lang_ab,trans_choice_ab,@choice_ab

Update Untracked Command:

Update translations with untracked messages.

If you want to be able to tracked untracked messages please use __ab and trans_choice_ab.

What is untracked message: {{ __($message) }} or {{ trans_choice($message, 5, ['value' => 5]) }}.

When you use __ab, trans_choice_ab, @lang_ab or @choice_ab function they will work the same way as __, trans_choice``@lang or @choice plus loging all messages to the special log file.

$ php artisan translation:untracked {locale} {--force} {--dump-messages}

Arguments:

Name Description Default
locale The locale -

Options:

Name Description Default
force Should the update be done false
dump-messages Should the messages be dumped in the console false
no-backup Should backup not be done false

Diff Command:

Difference between translation files and source code messages.

php artisan translation:diff en

Arguments:

Name Description Default
locale The locale -
path Directory where to extract the messages views

Options:

Name Description Default
prefix Override the default prefix. __,@lang,trans_choice,@choice,__ab,@lang_ab,trans_choice_ab,@choice_ab

if for any reason artisan can't find commands, you can register the provider manually on your config/app.php file:

return [
    ...
    'providers' => [
        ...
        AB\Laravel\Translator\ServiceProvider::class,
        ...
    ]
]

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固