tlr/laravel-lang-tools
Composer 安装命令:
composer require tlr/laravel-lang-tools
包简介
Some Language Import/Export tools for Laravel
README 文档
README
A language export and import command for Laravel 4. (yes, laravel 5 is coming...)
When dealing with agencies and companies who translate programming projects and websites into other languages, they often request it in certain formats.
- Currently works with csv only
Installation
Add the following to your composer.json's require object:
"tlr/laravel-lang-tools": "1.x"
Then, add Tlr\LaravelLangTools\LaravelLangToolsServiceProvider to the providers array in config/app.php.
Usage
The package provides two CLI commands:
artisan lang:export
Running php artisan lang:export will display the current lang tokens, and all of their translations in a table in the terminal - in a similar manner to viewing laravel's routes.
Running php artisan lang:export --format csv > translations.csv will save a csv of all of the translations, and their keys, to a csv file. This can be sent to translators.
artisan lang:import
Running php artisan lang:import translations.csv will convert a csv file (in the same format as the one outputted) into a laravel-style lang directory structure, with lang.php files in. At the moment, the path to the provided file must be relative to the project directory.
By default, the output is saved to a directory called lang in your project's root directory. You can pass a relative path as a third argument to change this. The target directory must not already exist.
Notes for translators
You may want to give translators some notes from laravel's localization docs page - especially regarding variables, and pluralisation.
tlr/laravel-lang-tools 适用场景与选型建议
tlr/laravel-lang-tools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.73k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 tlr/laravel-lang-tools 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tlr/laravel-lang-tools 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-02-13